diff --git a/.gitignore b/.gitignore index 4be171848..31be7680f 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ package-lock.json Pulumi.*.yaml .idea/ *.iml +key.rsa* \ No newline at end of file diff --git a/azure-ts-aks-helm/cluster.ts b/azure-ts-aks-helm/cluster.ts index 5c917e6ce..628b938f6 100644 --- a/azure-ts-aks-helm/cluster.ts +++ b/azure-ts-aks-helm/cluster.ts @@ -1,14 +1,15 @@ // Copyright 2016-2018, Pulumi Corporation. All rights reserved. import * as azure from "@pulumi/azure"; +import * as azuread from "@pulumi/azuread"; import * as pulumi from "@pulumi/pulumi"; import * as k8s from "@pulumi/kubernetes"; import * as config from "./config"; // Create the AD service principal for the K8s cluster. -let adApp = new azure.ad.Application("aks"); -let adSp = new azure.ad.ServicePrincipal("aksSp", { applicationId: adApp.applicationId }); -let adSpPassword = new azure.ad.ServicePrincipalPassword("aksSpPassword", { +let adApp = new azuread.Application("aks"); +let adSp = new azuread.ServicePrincipal("aksSp", { applicationId: adApp.applicationId }); +let adSpPassword = new azuread.ServicePrincipalPassword("aksSpPassword", { servicePrincipalId: adSp.id, value: config.password, endDate: "2099-01-01T00:00:00Z", @@ -26,9 +27,9 @@ export const k8sCluster = new azure.containerservice.KubernetesCluster("aksClust dnsPrefix: `${pulumi.getStack()}-kube`, linuxProfile: { adminUsername: "aksuser", - sshKeys: [{ + sshKey: { keyData: config.sshPublicKey, - }], + }, }, servicePrincipal: { clientId: adApp.applicationId, diff --git a/azure-ts-aks-helm/package.json b/azure-ts-aks-helm/package.json index c3c50c4f3..0ce33e37d 100644 --- a/azure-ts-aks-helm/package.json +++ b/azure-ts-aks-helm/package.json @@ -6,6 +6,7 @@ }, "dependencies": { "@pulumi/azure": "latest", + "@pulumi/azuread": "latest", "@pulumi/kubernetes": "latest", "@pulumi/pulumi": "latest" }, diff --git a/azure-ts-aks-mean/cluster.ts b/azure-ts-aks-mean/cluster.ts index 5c917e6ce..628b938f6 100644 --- a/azure-ts-aks-mean/cluster.ts +++ b/azure-ts-aks-mean/cluster.ts @@ -1,14 +1,15 @@ // Copyright 2016-2018, Pulumi Corporation. All rights reserved. import * as azure from "@pulumi/azure"; +import * as azuread from "@pulumi/azuread"; import * as pulumi from "@pulumi/pulumi"; import * as k8s from "@pulumi/kubernetes"; import * as config from "./config"; // Create the AD service principal for the K8s cluster. -let adApp = new azure.ad.Application("aks"); -let adSp = new azure.ad.ServicePrincipal("aksSp", { applicationId: adApp.applicationId }); -let adSpPassword = new azure.ad.ServicePrincipalPassword("aksSpPassword", { +let adApp = new azuread.Application("aks"); +let adSp = new azuread.ServicePrincipal("aksSp", { applicationId: adApp.applicationId }); +let adSpPassword = new azuread.ServicePrincipalPassword("aksSpPassword", { servicePrincipalId: adSp.id, value: config.password, endDate: "2099-01-01T00:00:00Z", @@ -26,9 +27,9 @@ export const k8sCluster = new azure.containerservice.KubernetesCluster("aksClust dnsPrefix: `${pulumi.getStack()}-kube`, linuxProfile: { adminUsername: "aksuser", - sshKeys: [{ + sshKey: { keyData: config.sshPublicKey, - }], + }, }, servicePrincipal: { clientId: adApp.applicationId, diff --git a/azure-ts-aks-mean/package.json b/azure-ts-aks-mean/package.json index 15a4a4d6c..276910571 100644 --- a/azure-ts-aks-mean/package.json +++ b/azure-ts-aks-mean/package.json @@ -5,6 +5,7 @@ }, "dependencies": { "@pulumi/azure": "latest", + "@pulumi/azuread": "latest", "@pulumi/kubernetes": "latest", "@pulumi/pulumi": "latest", "@types/mongoose": "^5.2.11", diff --git a/azure-ts-aks-multicluster/index.ts b/azure-ts-aks-multicluster/index.ts index 9b38b5d9a..ee35f7931 100644 --- a/azure-ts-aks-multicluster/index.ts +++ b/azure-ts-aks-multicluster/index.ts @@ -1,6 +1,7 @@ // Copyright 2016-2018, Pulumi Corporation. All rights reserved. import * as azure from "@pulumi/azure"; +import * as azuread from "@pulumi/azuread"; import * as pulumi from "@pulumi/pulumi"; import * as config from "./config"; @@ -21,9 +22,9 @@ const aksClusterConfig = [ ]; // Create the AD service principal for the K8s cluster. -const adApp = new azure.ad.Application("aks"); -const adSp = new azure.ad.ServicePrincipal("aksSp", {applicationId: adApp.applicationId}); -const adSpPassword = new azure.ad.ServicePrincipalPassword("aksSpPassword", { +const adApp = new azuread.Application("aks"); +const adSp = new azuread.ServicePrincipal("aksSp", {applicationId: adApp.applicationId}); +const adSpPassword = new azuread.ServicePrincipalPassword("aksSpPassword", { servicePrincipalId: adSp.id, value: config.password, endDate: "2099-01-01T00:00:00Z", @@ -36,9 +37,9 @@ const k8sClusters = aksClusterConfig.map((perClusterConfig, index) => { resourceGroupName: config.resourceGroup.name, linuxProfile: { adminUsername: "aksuser", - sshKeys: [{ + sshKey: { keyData: config.sshPublicKey, - }], + }, }, servicePrincipal: { clientId: adApp.applicationId, diff --git a/azure-ts-aks-multicluster/package.json b/azure-ts-aks-multicluster/package.json index 4b27ff743..5dd759e3a 100644 --- a/azure-ts-aks-multicluster/package.json +++ b/azure-ts-aks-multicluster/package.json @@ -6,6 +6,7 @@ }, "dependencies": { "@pulumi/azure": "latest", + "@pulumi/azuread": "latest", "@pulumi/kubernetes": "latest", "@pulumi/pulumi": "latest" },