Last active
January 25, 2021 23:55
-
-
Save dancrumb/b182d7969a26a685468bc60283d8cdca to your computer and use it in GitHub Desktop.
Terraform CDK issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"//": { | |
"metadata": { | |
"version": "0.1.0", | |
"stackName": "cdk" | |
} | |
}, | |
"variable": { | |
"auth0_mgmt_domain": { | |
"default": "", | |
"type": "string" | |
}, | |
"auth0_mgmt_client_id": { | |
"default": "", | |
"type": "string" | |
}, | |
"auth0_mgmt_client_secret": { | |
"default": "", | |
"type": "string" | |
} | |
}, | |
"terraform": { | |
"required_providers": { | |
"auth0": { | |
"version": "0.15.2", | |
"source": "alexkappa/auth0" | |
} | |
}, | |
"backend": { | |
"remote": { | |
"hostname": "app.terraform.io", | |
"organization": "care-neighborhood", | |
"workspaces": { | |
"name": "local" | |
} | |
} | |
} | |
}, | |
"provider": { | |
"auth0": [ | |
{ | |
"client_id": { | |
"creation_stack": [ | |
"new Intrinsic (/Users/danrumney/Projects/care-neighbourhood/auth0/cdk/node_modules/cdktf/lib/tokens/private/intrinsic.js:21:44)", | |
"Function.asAny (/Users/danrumney/Projects/care-neighbourhood/auth0/cdk/node_modules/cdktf/lib/tokens/token.js:87:59)", | |
"TerraformVariable.get value [as value] (/Users/danrumney/Projects/care-neighbourhood/auth0/cdk/node_modules/cdktf/lib/terraform-variable.js:148:31)", | |
"new MyStack (/Users/danrumney/Projects/care-neighbourhood/auth0/cdk/main.js:31:41)", | |
"Object.<anonymous> (/Users/danrumney/Projects/care-neighbourhood/auth0/cdk/main.js:37:15)", | |
"Module._compile (internal/modules/cjs/loader.js:955:30)", | |
"Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)", | |
"Module.load (internal/modules/cjs/loader.js:811:32)", | |
"Function.Module._load (internal/modules/cjs/loader.js:723:14)", | |
"Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)", | |
"internal/main/run_main_module.js:17:11" | |
], | |
"value": "${var.auth0_mgmt_client_id}" | |
}, | |
"client_secret": { | |
"creation_stack": [ | |
"new Intrinsic (/Users/danrumney/Projects/care-neighbourhood/auth0/cdk/node_modules/cdktf/lib/tokens/private/intrinsic.js:21:44)", | |
"Function.asAny (/Users/danrumney/Projects/care-neighbourhood/auth0/cdk/node_modules/cdktf/lib/tokens/token.js:87:59)", | |
"TerraformVariable.get value [as value] (/Users/danrumney/Projects/care-neighbourhood/auth0/cdk/node_modules/cdktf/lib/terraform-variable.js:148:31)", | |
"new MyStack (/Users/danrumney/Projects/care-neighbourhood/auth0/cdk/main.js:32:49)", | |
"Object.<anonymous> (/Users/danrumney/Projects/care-neighbourhood/auth0/cdk/main.js:37:15)", | |
"Module._compile (internal/modules/cjs/loader.js:955:30)", | |
"Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)", | |
"Module.load (internal/modules/cjs/loader.js:811:32)", | |
"Function.Module._load (internal/modules/cjs/loader.js:723:14)", | |
"Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)", | |
"internal/main/run_main_module.js:17:11" | |
], | |
"value": "${var.auth0_mgmt_client_secret}" | |
}, | |
"domain": { | |
"creation_stack": [ | |
"new Intrinsic (/Users/danrumney/Projects/care-neighbourhood/auth0/cdk/node_modules/cdktf/lib/tokens/private/intrinsic.js:21:44)", | |
"Function.asAny (/Users/danrumney/Projects/care-neighbourhood/auth0/cdk/node_modules/cdktf/lib/tokens/token.js:87:59)", | |
"TerraformVariable.get value [as value] (/Users/danrumney/Projects/care-neighbourhood/auth0/cdk/node_modules/cdktf/lib/terraform-variable.js:148:31)", | |
"new MyStack (/Users/danrumney/Projects/care-neighbourhood/auth0/cdk/main.js:30:37)", | |
"Object.<anonymous> (/Users/danrumney/Projects/care-neighbourhood/auth0/cdk/main.js:37:15)", | |
"Module._compile (internal/modules/cjs/loader.js:955:30)", | |
"Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)", | |
"Module.load (internal/modules/cjs/loader.js:811:32)", | |
"Function.Module._load (internal/modules/cjs/loader.js:723:14)", | |
"Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)", | |
"internal/main/run_main_module.js:17:11" | |
], | |
"value": "${var.auth0_mgmt_domain}" | |
} | |
} | |
] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"language": "typescript", | |
"app": "npm run --silent compile && node main.js", | |
"terraformProviders": [ | |
"alexkappa/auth0@0.15.2" | |
], | |
"context": { | |
"excludeStackIdFromLogicalIds": "true", | |
"allowSepCharsInLogicalIds": "true" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CDKTF_LOG_LEVEL=debug cdktf synth -o local | |
[2021-01-25T17:53:29.481] [DEBUG] default - Terraform v0.14.3 | |
[2021-01-25T17:53:29.483] [DEBUG] default - Your version of Terraform is out of date! The latest version | |
is 0.14.5. You can update by downloading from https://www.terraform.io/downloads.html | |
Generated Terraform code in the output directory: local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Construct } from "constructs"; | |
import { App, TerraformStack, RemoteBackend, TerraformVariable } from "cdktf"; | |
import { Auth0Provider, Rule } from "./.gen/providers/auth0"; | |
import { readFileSync } from "fs"; | |
const file = (fileName: string) => readFileSync(fileName, "utf-8"); | |
const { TF_ENV } = process.env; | |
if (!TF_ENV) { | |
console.error("Please set TF_ENV"); | |
process.exit(1); | |
} | |
class CareNeighborhoodStack extends TerraformStack { | |
constructor(scope: Construct, name: string) { | |
super(scope, name); | |
const auth0MgmtDomain = new TerraformVariable(this, "auth0_mgmt_domain", { | |
type: "string", | |
default: "", | |
}); | |
const auth0MgmtClientId = new TerraformVariable( | |
this, | |
"auth0_mgmt_client_id", | |
{ | |
type: "string", | |
default: "", | |
} | |
); | |
const auth0MgmtClientSecret = new TerraformVariable( | |
this, | |
"auth0_mgmt_client_secret", | |
{ | |
type: "string", | |
default: "", | |
} | |
); | |
new Auth0Provider(this, "auth0", { | |
domain: auth0MgmtDomain.value, | |
clientId: auth0MgmtClientId.value, | |
clientSecret: auth0MgmtClientSecret.value, | |
}); | |
new Rule(this, "addP1Role", { | |
name: "addP1Role", | |
script: file("./rules/addP1Role.js"), | |
enabled: true, | |
}); | |
} | |
} | |
const app = new App(); | |
const stack = new CareNeighborhoodStack(app, "cdk"); | |
new RemoteBackend(stack, { | |
hostname: "app.terraform.io", | |
organization: "care-neighborhood", | |
workspaces: { | |
name: TF_ENV, | |
}, | |
}); | |
app.synth(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment