Created
February 21, 2024 23:15
-
-
Save sapslaj/017ed9ec3265d062e8207df408a0564c to your computer and use it in GitHub Desktop.
cdktf-aws-cdk idempotency 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
$ npx ts-node repro.ts | |
/home/sapslaj/code/github.com/sapslaj/scratch/cdktf-adapter-repro/node_modules/constructs/src/construct.ts:447 | |
throw new Error(`There is already a Construct with name '${childName}' in ${typeName}${name.length > 0 ? ' [' + name + ']' : ''}`); | |
^ | |
Error: There is already a Construct with name 'bucket43879C71' in TerraformHost [adapter] | |
at Node.addChild (/home/sapslaj/code/github.com/sapslaj/scratch/cdktf-adapter-repro/node_modules/constructs/src/construct.ts:447:13) | |
at new Node (/home/sapslaj/code/github.com/sapslaj/scratch/cdktf-adapter-repro/node_modules/constructs/src/construct.ts:71:17) | |
at new Construct (/home/sapslaj/code/github.com/sapslaj/scratch/cdktf-adapter-repro/node_modules/constructs/src/construct.ts:499:17) | |
at new TerraformElement (/home/sapslaj/code/github.com/sapslaj/scratch/cdktf-adapter-repro/node_modules/cdktf/lib/terraform-element.ts:36:5) | |
at new TerraformResource (/home/sapslaj/code/github.com/sapslaj/scratch/cdktf-adapter-repro/node_modules/cdktf/lib/terraform-resource.ts:155:5) | |
at new CloudcontrolapiResource (/home/sapslaj/code/github.com/sapslaj/scratch/cdktf-adapter-repro/node_modules/@cdktf/aws-cdk/src/aws/cloudcontrolapi-resource/index.ts:246:5) | |
at Object.resource (/home/sapslaj/code/github.com/sapslaj/scratch/cdktf-adapter-repro/node_modules/@cdktf/aws-cdk/src/mapping/index.ts:53:14) | |
at TerraformHost.newTerraformResource (/home/sapslaj/code/github.com/sapslaj/scratch/cdktf-adapter-repro/node_modules/@cdktf/aws-cdk/src/aws-adapter.ts:157:19) | |
at TerraformHost.convert (/home/sapslaj/code/github.com/sapslaj/scratch/cdktf-adapter-repro/node_modules/@cdktf/aws-cdk/src/aws-adapter.ts:89:16) | |
at Object.visit (/home/sapslaj/code/github.com/sapslaj/scratch/cdktf-adapter-repro/node_modules/@cdktf/aws-cdk/src/aws-adapter.ts:50:16) |
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 { AwsTerraformAdapter } from '@cdktf/aws-cdk'; | |
import { AwsProvider } from '@cdktf/provider-aws/lib/provider'; | |
import { Bucket } from 'aws-cdk-lib/aws-s3'; | |
import { App, TerraformStack } from 'cdktf'; | |
const app = new App(); | |
const stack = new TerraformStack(app, 'stack'); | |
new AwsProvider(stack, 'aws'); | |
const adapter = new AwsTerraformAdapter(stack, 'adapter'); | |
new Bucket(adapter, 'bucket'); | |
app.synth(); | |
app.synth(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment