Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update to latest deps and make runable #2

Merged
merged 1 commit into from
May 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
672 changes: 0 additions & 672 deletions Gopkg.lock

This file was deleted.

54 changes: 0 additions & 54 deletions Gopkg.toml

This file was deleted.

21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
PROJECT_NAME := Pulumi AzureRM Resource Provider

PACK := azurerm
PROJECT := github.com/pulumi/pulumi-azurerm
PROVIDER := pulumi-resource-${PACK}
VERSION := 0.1

VERSION_FLAGS := -ldflags "-X github.com/pulumi/pulumi-kubernetes/provider/v2/pkg/version.Version=${VERSION}"

GO ?= go
CURL ?= curl

ensure::
@echo "GO111MODULE=on go mod tidy"; GO111MODULE=on go mod tidy
@echo "GO111MODULE=on go mod download"; GO111MODULE=on go mod download

build::
$(GO) install $(VERSION_FLAGS) $(PROJECT)/cmd/$(PROVIDER)

builddebug:
$(GO) install $(VERSION_FLAGS) -gcflags="all=-N -l" $(PROJECT)/cmd/$(PROVIDER)
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ APIs and Swagger specs.
### Building and Testing

```
$ go install ./cmd/pulumi-resource-azurerm/
$ make ensure
$ make build
$ cd ./exampes/simple
$ pulumi config set azurerm:subscriptionId <sub-id>
$ pulumi up
```
57 changes: 33 additions & 24 deletions examples/simple/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import * as pulumi from "@pulumi/pulumi";
import { networkInterfaces } from "os";

class ResourceGroup extends pulumi.CustomResource {
constructor(name: string, args: any, opts?: pulumi.CustomResourceOptions) {
super("azurerm:core:ResourceGroup", name, args, opts);
}
}

class ContainerGroup extends pulumi.CustomResource {
constructor(name: string, args: any, opts?: pulumi.CustomResourceOptions) {
super("azurerm:containerinstance:ContainerGroup", name, args, opts);
Expand Down Expand Up @@ -28,21 +34,32 @@ class VirtualNetwork extends pulumi.CustomResource {
}
}

const resourceGroupName = "azurerm";

const resourceGroup = new ResourceGroup("azurerm", {
resourceGroupName: resourceGroupName,
parameters: {
location: "westus2",
tags: {
Owner: "mikhailshilkov",
},
},
});

const containerinstance = new ContainerGroup("abc", {
resourceGroupName: "azuretest",
resourceGroupName: resourceGroupName,
// should be autonamed?
containerGroupName: "abc-1234",
containerGroupName: "abc-1234",
// should be inlined via use of `"in": "body"`?
containerGroup: {
location: "westus2",
containerGroup: {
location: "westus2",
// should be inlined via 'x-ms-client-flatten'
properties: {
properties: {
osType: "Linux",
containers: [{
name: "foo",
// should be inlined via 'x-ms-client-flatten'
properties: {
properties: {
image: "nginx",
resources: {
requests: {
Expand All @@ -54,10 +71,10 @@ const containerinstance = new ContainerGroup("abc", {
}],
},
},
});
}, { dependsOn: [resourceGroup]});

const vnet = new VirtualNetwork("vnet", {
resourceGroupName: "azuretest",
resourceGroupName: resourceGroupName,
virtualNetworkName: "vnet-1234",
parameters: {
location: "westus2",
Expand All @@ -73,10 +90,10 @@ const vnet = new VirtualNetwork("vnet", {
}],
},
},
});
}, { dependsOn: [resourceGroup]});

const networkInterface = new NetworkInterface("nic", {
resourceGroupName: "azuretest",
resourceGroupName: "aks-rg70afafca",
networkInterfaceName: "nic-1234",
parameters: {
location: "westus2",
Expand All @@ -95,11 +112,11 @@ const networkInterface = new NetworkInterface("nic", {
});

const virtualmachine = new VirtualMachine("vm", {
resourceGroupName: "azuretest",
vmName: "abc-1234",
resourceGroupName: resourceGroupName,
vmName: "abc-1234",
parameters: {
location: "westus2",
properties: {
properties: {
hardwareProfile: {
vmSize: "Standard_A0",
},
Expand All @@ -118,17 +135,9 @@ const virtualmachine = new VirtualMachine("vm", {
},
osProfile: {
computerName: "foo",
adminUsername: "lukehoban",
linuxConfiguration: {
disablePasswordAuthentication: true,
ssh: {
publicKeys: [{
path: "/home/lukehoban/.ssh/authorized_keys",
keyData: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCaMWLUeL02T3k5E+tr+0BwmHyzkvEWkOuC+Y8c4o5FY+WuCZqzK4pyHrhWqtVOQEnsMOjIRzPVjX3URcJxuCZnEC8Kblru+tIzf1xkpexxzYUPF3BgLLSCFp0hm28BVkmktkhaPzAWuCBsYIJY6t2SHxT2BbGrsXlmKItUP78ViZaMdKWAAToNPuvJnSV1XAKI0tet6bzMN2ZOWDByrXWi1AjMHuJwHWDAOWTKRcO1MgqNbIPI1mPGIbIwJ0bHyaJLIGqCJLWd+g9VOA4D/T3qahzO3y1xkJB315J/QyCVS3Cdbt4kxQIsCmYsAaxB4/uM8lNGShP6H2p72n4CY9Dov7Fh2je4jBGVT/1873f3xEE24KtIiulebusIIOUH1T+TgUo2mPU+wlO1jQaEbp8bHK/216/dXIzr67+4nmCasvIiI0ZbspQ0Yz/sSUoDDV3pF9WnG8Y11thjfu62TEM66iNaS0NgTHJHUtHs0/jezTIAW/yJ9a7i113xZAtnq3KHi6AzG08HlQyGLqsF1ny80+aT/KYcipXMrsBIO6p1zL4JGSnFyEQuc2SdQ/DTOKF2Tz55KXdrkQ5jeQNWcNSW5BfoWhVfa1/cIfxNBEi2ZqScmDwkienkd3CZG1ci9UJQyrtfhkO1c8mN8BeVhD2rljrk+y5cO3Tw9H1hTYkFWQ== luke@pulumi.com"
}],
},
},
adminUsername: "someusername",
adminPassword: "someFancyp@wd2!",
},
},
},
});
});
22 changes: 22 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module github.com/pulumi/pulumi-azurerm

go 1.13

require (
github.com/Azure/go-autorest/autorest v0.10.0
github.com/Azure/go-autorest/autorest/azure/auth v0.4.2
github.com/go-openapi/spec v0.19.7
github.com/go-openapi/swag v0.19.9
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/golang/protobuf v1.3.5
github.com/pkg/errors v0.9.1
github.com/pulumi/pulumi/pkg/v2 v2.0.1-0.20200424001829-090f390d7b1a
github.com/pulumi/pulumi/sdk/v2 v2.0.1-0.20200424001829-090f390d7b1a
google.golang.org/grpc v1.28.0
)

replace (
github.com/Azure/go-autorest => github.com/tombuildsstuff/go-autorest v14.0.1-0.20200416184303-d4e299a3c04a+incompatible
github.com/Azure/go-autorest/autorest => github.com/tombuildsstuff/go-autorest/autorest v0.10.1-0.20200416184303-d4e299a3c04a
github.com/Azure/go-autorest/autorest/azure/auth => github.com/tombuildsstuff/go-autorest/autorest/azure/auth v0.4.3-0.20200416184303-d4e299a3c04a
)
Loading