colossal-school-15171
10/25/2020, 2:54 AM$ pulumi up
Previewing update (identity)
View Live: <https://app.pulumi.com/dangersorus/k8s-az-identity/identity/previews/7d98c3c1-8011-4cef-af17-b168d33489e7>
Type Name Plan Info
+ pulumi:pulumi:Stack k8s-az-identity-identity create 1 error
Diagnostics:
pulumi:pulumi:Stack (k8s-az-identity-identity):
error: Running program '/Users/admin/Documents/workspace/k8s-cluster/01-identity' failed with an unhandled exception:
TSError: ⨯ Unable to compile TypeScript:
index.ts(114,39): error TS2339: Property 'objectId' does not exist on type 'Promise<GetClientConfigResult>'.
index.ts(139,13): error TS2339: Property 'objectId' does not exist on type 'Promise<GetUserResult>'.
at createTSError (/Users/admin/Documents/workspace/k8s-cluster/01-identity/node_modules/ts-node/src/index.ts:261:12)
at getOutput (/Users/admin/Documents/workspace/k8s-cluster/01-identity/node_modules/ts-node/src/index.ts:367:40)
at Object.compile (/Users/admin/Documents/workspace/k8s-cluster/01-identity/node_modules/ts-node/src/index.ts:558:11)
at Module.m._compile (/Users/admin/Documents/workspace/k8s-cluster/01-identity/node_modules/ts-node/src/index.ts:439:43)
at Module._extensions..js (node:internal/modules/cjs/loader:1112:10)
at Object.require.extensions.<computed> [as .ts] (/Users/admin/Documents/workspace/k8s-cluster/01-identity/node_modules/ts-node/src/index.ts:442:12)
at Module.load (node:internal/modules/cjs/loader:948:32)
at Function.Module._load (node:internal/modules/cjs/loader:789:14)
at Module.require (node:internal/modules/cjs/loader:972:19)
at require (node:internal/modules/cjs/helpers:88:18)
and then a different error code here
$ pulumi stack select
Please choose a stack, or create a new one: infra
$ pulumi up
Previewing update (infra)
View Live: <https://app.pulumi.com/dangersorus/k8s-az-infra/infra/previews/55b69106-e31c-4dc9-902a-3f804174a9cb>
Type Name Plan Info
+ pulumi:pulumi:Stack k8s-az-infra-infra create 1 error
Diagnostics:
pulumi:pulumi:Stack (k8s-az-infra-infra):
error: Running program '/Users/admin/Documents/workspace/k8s-cluster/02-managed-infra' failed with an unhandled exception:
TSError: ⨯ Unable to compile TypeScript:
index.ts(1,24): error TS2307: Cannot find module '@pulumi/azure'.
at createTSError (/Users/admin/Documents/workspace/k8s-cluster/node_modules/ts-node/src/index.ts:261:12)
at getOutput (/Users/admin/Documents/workspace/k8s-cluster/node_modules/ts-node/src/index.ts:367:40)
at Object.compile (/Users/admin/Documents/workspace/k8s-cluster/node_modules/ts-node/src/index.ts:558:11)
at Module.m._compile (/Users/admin/Documents/workspace/k8s-cluster/node_modules/ts-node/src/index.ts:439:43)
at Module._extensions..js (node:internal/modules/cjs/loader:1112:10)
at Object.require.extensions.<computed> [as .ts] (/Users/admin/Documents/workspace/k8s-cluster/node_modules/ts-node/src/index.ts:442:12)
at Module.load (node:internal/modules/cjs/loader:948:32)
at Function.Module._load (node:internal/modules/cjs/loader:789:14)
at Module.require (node:internal/modules/cjs/loader:972:19)
at require (node:internal/modules/cjs/helpers:88:18)
billowy-army-68599
10/25/2020, 3:20 AM@pulumi/azure
error can be fixed by doing npm install @pulumi/azure
colossal-school-15171
10/26/2020, 9:06 PM${name}-app-server
, { replyUrls: ["http://k8s_server"], type: "webapp/api", groupMembershipClaims: "All", requiredResourceAccesses: [ // Windows Azure Active Directory API { resourceAppId: "00000002-0000-0000-c000-000000000000", resourceAccesses: [{ // DELEGATED PERMISSIONS: "Sign in and read user profile" id: "311a71cc-e848-46a1-bdf8-97ff7156d8e6", type: "Scope", }], }, // MicrosoftGraph API { resourceAppId: "00000003-0000-0000-c000-000000000000", resourceAccesses: [ // APPLICATION PERMISSIONS: "Read directory data" { id: "7ab1d382-f21e-4acd-a863-ba3e13f7da61", type: "Role", }, // DELEGATED PERMISSIONS: "Sign in and read user profile" { id: "e1fe6dd8-ba31-4d61-89e7-88639da4683d", type: "Scope", }, // DELEGATED PERMISSIONS: "Read directory data" { id: "06da0dbc-49e2-44d2-8312-53f166ab848a", type: "Scope", }, ], }, ], }); const principalServer = new azuread.ServicePrincipal(${name}-sp-server
, { applicationId: applicationServer.applicationId, }); // Generate a strong password for the Service Principal. const passwordServer = new random.RandomString(${name}-pwd-server
, { length: 20, special: true, }, {additionalSecretOutputs: ["result"]}).result; const spPasswordServer = new azuread.ServicePrincipalPassword(${name}-sppwd-server
, { servicePrincipalId: principalServer.id, value: passwordServer, endDate: "2099-01-01T00:00:00Z", }); const applicationClient = new azuread.Application(${name}-app-client
, { replyUrls: ["http://k8s_server"], type: "native", requiredResourceAccesses: [ // Windows Azure Active Directory API { resourceAppId: "00000002-0000-0000-c000-000000000000", resourceAccesses: [{ // DELEGATED PERMISSIONS: "Sign in and read user profile" id: "311a71cc-e848-46a1-bdf8-97ff7156d8e6", type: "Scope", }], }, // AKS ad application server { resourceAppId: applicationServer.applicationId, resourceAccesses: [{ // Server app Oauth2 permissions id id: applicationServer.oauth2Permissions[0].id, type: "Scope", }], }, ], }); const principalClient = new azuread.ServicePrincipal(${name}-sp-client
, { applicationId: applicationClient.applicationId, }); // Generate a strong password for the Service Principal. const passwordClient = new random.RandomString(${name}-pwd-client
, { length: 20, special: true, }, {additionalSecretOutputs: ["result"]}).result; const spPasswordClient = new azuread.ServicePrincipalPassword(${name}-sppwd-client
, { servicePrincipalId: principalClient.id, value: passwordClient, endDate: "2099-01-01T00:00:00Z", }); // Define a resource group (shared for all stacks) const resourceGroup = new azure.core.ResourceGroup("k8s-az"); // Grant the resource group the "Network Contributor" role so that it // can link the static IP to a Service LoadBalancer. const rgNetworkRole = new azure.role.Assignment(${name}-spRole
, { principalId: principalClient.id, scope: resourceGroup.id, roleDefinitionName: "Network Contributor", }); const clientConfig = azure.core.getClientConfig(); const currentPrincipal = clientConfig.objectId; const admins = new azuread.Group("admins", { name: "pulumi:admins", members: [ currentPrincipal, ], }); /* Create a new user in AD. const dev = new azuread.User("k8s-dev", { userPrincipalName: "k8sdev@example.com", displayName: "Kubernetes Dev", password: "Qjker21!G", }); */ const dev = azuread.getUser({ userPrincipalName: "alice@example.com", }); const devs = new azuread.Group("devs", { name: "pulumi:devs", members: [ // Assign a new or existing user to the group. dev.objectId, ], }); // Export outputs for other stacks export const resourceGroupName = resourceGroup.name; export const adServerAppId = applicationServer.applicationId; export const adServerAppSecret = spPasswordServer.value; export const adClientAppId = applicationClient.applicationId; export const adClientAppSecret = spPasswordClient.value; export const adGroupAdmins = admins.objectId; export const adGroupDevs = devs.objectId;`billowy-army-68599
10/26/2020, 9:07 PMcolossal-school-15171
10/26/2020, 9:07 PM