From f8ef2997cd835139a3d5b4dd2a264a6158eb0943 Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Mon, 16 Oct 2023 18:44:37 +0000 Subject: [PATCH 1/3] chore!: upgrade to cdktf 0.19.0 Signed-off-by: team-tf-cdk --- .projen/deps.json | 2 +- .projenrc.ts | 4 ++-- package.json | 4 ++-- yarn.lock | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.projen/deps.json b/.projen/deps.json index 2c8eff6..1a1cd99 100644 --- a/.projen/deps.json +++ b/.projen/deps.json @@ -118,7 +118,7 @@ }, { "name": "cdktf", - "version": ">=0.18.0", + "version": ">=0.19.0", "type": "peer" }, { diff --git a/.projenrc.ts b/.projenrc.ts index 53ff9d1..77be30f 100644 --- a/.projenrc.ts +++ b/.projenrc.ts @@ -36,7 +36,7 @@ const project = new ConstructLibraryCdktf({ name: "team-tf-cdk", email: "github-team-tf-cdk@hashicorp.com", }, - cdktfVersion: "0.18.0", + cdktfVersion: "0.19.0", mergify: false, depsUpgradeOptions: { workflowOptions: { @@ -61,7 +61,7 @@ new Automerge(project); new UpgradeCDKTF(project); project.addPeerDeps( - "cdktf@>=0.18.0", + "cdktf@>=0.19.0", "@cdktf/provider-null@>=8.0.0", "constructs@^10.0.25" ); diff --git a/package.json b/package.json index a1d58dd..770392e 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", "@typescript-eslint/parser": "^6", - "cdktf": "0.18.0", + "cdktf": "0.19.0", "constructs": "10.0.25", "eslint": "^8", "eslint-config-prettier": "^8.10.0", @@ -67,7 +67,7 @@ }, "peerDependencies": { "@cdktf/provider-null": ">=8.0.0", - "cdktf": ">=0.18.0", + "cdktf": ">=0.19.0", "constructs": "^10.0.25" }, "keywords": [ diff --git a/yarn.lock b/yarn.lock index 33da44d..8373ae9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1662,10 +1662,10 @@ case@^1.6.3: resolved "https://registry.yarnpkg.com/case/-/case-1.6.3.tgz#0a4386e3e9825351ca2e6216c60467ff5f1ea1c9" integrity sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ== -cdktf@0.18.0: - version "0.18.0" - resolved "https://registry.yarnpkg.com/cdktf/-/cdktf-0.18.0.tgz#b79eb924afff7af38877bb4ffdfe3bdf954131b0" - integrity sha512-iTWy2g0mCE2YW2hPxdWEzMwCVgyzDyheHWJTS4OcLZsR+lXETFX0lonoc5XGnX8CHBL4AbFY+EEqCUs5v7A4bQ== +cdktf@0.19.0: + version "0.19.0" + resolved "https://registry.yarnpkg.com/cdktf/-/cdktf-0.19.0.tgz#097a3241b95e77eeab8ae1f7a714bf45dc6ca55b" + integrity sha512-5tcNhvrvsE9WawC5cPwV7B9ATQ5lWNjyCJN7EnMofxTtkBEdnnGx0esC+vpNO4Fs0LhmV37qCUlm+K6anZaPYw== dependencies: archiver "5.3.1" json-stable-stringify "^1.0.2" From cadd62f97caca3b2dcab69919ee8dd19d166371a Mon Sep 17 00:00:00 2001 From: Daniel Schmidt Date: Wed, 18 Oct 2023 12:09:20 +0200 Subject: [PATCH 2/3] chore: update peer dependencies --- .projen/deps.json | 4 ++-- .projenrc.ts | 4 ++-- package.json | 6 +++--- yarn.lock | 16 ++++++++-------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.projen/deps.json b/.projen/deps.json index 1a1cd99..078e589 100644 --- a/.projen/deps.json +++ b/.projen/deps.json @@ -2,7 +2,7 @@ "dependencies": [ { "name": "@cdktf/provider-random", - "version": ">=9.0.0", + "version": ">=10.0.0", "type": "build" }, { @@ -113,7 +113,7 @@ }, { "name": "@cdktf/provider-null", - "version": ">=8.0.0", + "version": ">=9.0.0", "type": "peer" }, { diff --git a/.projenrc.ts b/.projenrc.ts index 77be30f..eb52e89 100644 --- a/.projenrc.ts +++ b/.projenrc.ts @@ -62,10 +62,10 @@ new UpgradeCDKTF(project); project.addPeerDeps( "cdktf@>=0.19.0", - "@cdktf/provider-null@>=8.0.0", + "@cdktf/provider-null@>=9.0.0", "constructs@^10.0.25" ); -project.addDevDeps("ts-node@10.9.1", "@cdktf/provider-random@>=9.0.0"); +project.addDevDeps("ts-node@10.9.1", "@cdktf/provider-random@>=10.0.0"); // Run copywrite tool to add copyright headers to all files project.buildWorkflow?.addPostBuildSteps( diff --git a/package.json b/package.json index 770392e..57d92d1 100644 --- a/package.json +++ b/package.json @@ -36,8 +36,8 @@ "organization": true }, "devDependencies": { - "@cdktf/provider-null": "8.0.0", - "@cdktf/provider-random": ">=9.0.0", + "@cdktf/provider-null": "9.0.0", + "@cdktf/provider-random": ">=10.0.0", "@types/jest": "^27", "@types/node": "^16", "@typescript-eslint/eslint-plugin": "^6", @@ -66,7 +66,7 @@ "typescript": "^4.9.5" }, "peerDependencies": { - "@cdktf/provider-null": ">=8.0.0", + "@cdktf/provider-null": ">=9.0.0", "cdktf": ">=0.19.0", "constructs": "^10.0.25" }, diff --git a/yarn.lock b/yarn.lock index 8373ae9..a6589c1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -295,15 +295,15 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@cdktf/provider-null@8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@cdktf/provider-null/-/provider-null-8.0.0.tgz#8bbcd0c4030ba3fc8edfc557700c302b3082b76d" - integrity sha512-ikSMynn+boAZRd3o8erY1L2RhtlAXupMq9VyPBNAPYrXxLeGlBNLcb6H8gpheKtInjysVEhj3InBQ8vNsY30bA== - -"@cdktf/provider-random@>=9.0.0": +"@cdktf/provider-null@9.0.0": version "9.0.0" - resolved "https://registry.yarnpkg.com/@cdktf/provider-random/-/provider-random-9.0.0.tgz#dc16ca235865345aec0aec91aa25e6fcd0b606bd" - integrity sha512-c3d29Io2RFYj8DQlp5+ChGkvCXp96QK4c7jMpQgqrRpmkyL+9DAyJd5c0eCV1Kxem2CoYBE+tMM3jiWLCz12Lg== + resolved "https://registry.yarnpkg.com/@cdktf/provider-null/-/provider-null-9.0.0.tgz#ee33adc837076ce9f9a54252c846a6344c5abedb" + integrity sha512-5osel2UvwtB2RaOHECFvane43E4RbhOLzhrRUGJjoPCpb2E7LT8vrq4r9nA098BQvxGHPWtE+YR5OsvWUH5ouA== + +"@cdktf/provider-random@>=10.0.0": + version "10.0.0" + resolved "https://registry.yarnpkg.com/@cdktf/provider-random/-/provider-random-10.0.0.tgz#8eb614ff2159a07b7d2664a5d77bcbcf40da5043" + integrity sha512-MTOq2+zvmNEbT0v1vpUfGHXxeL1Up7i8IkxjHuVeGPXpXJ+42WzASxTcaO6597IYwTnvpyv6gbTsPQMFHMex2A== "@colors/colors@1.5.0": version "1.5.0" From 4374c390f7bea2668d942fd25950ad87917fc8ad Mon Sep 17 00:00:00 2001 From: team-tf-cdk Date: Wed, 18 Oct 2023 10:11:13 +0000 Subject: [PATCH 3/3] chore: self mutation Signed-off-by: team-tf-cdk --- API.md | 151 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) diff --git a/API.md b/API.md index bcdb105..aa00429 100644 --- a/API.md +++ b/API.md @@ -89,6 +89,7 @@ new LocalExec(scope: Construct, id: string, config: LocalExecConfig) | resetOverrideLogicalId | Resets a previously passed logical Id to use the auto-generated logical id again. | | toMetadata | *No description.* | | toTerraform | Adds this resource to the terraform JSON output. | +| addMoveTarget | Adds a user defined moveTarget string to this resource to be later used in .moveTo(moveTarget) to resolve the location of the move. | | getAnyMapAttribute | *No description.* | | getBooleanAttribute | *No description.* | | getBooleanMapAttribute | *No description.* | @@ -98,7 +99,9 @@ new LocalExec(scope: Construct, id: string, config: LocalExecConfig) | getNumberMapAttribute | *No description.* | | getStringAttribute | *No description.* | | getStringMapAttribute | *No description.* | +| importFrom | *No description.* | | interpolationForAttribute | *No description.* | +| moveTo | Moves this resource to the target resource given by moveTarget. | | resetTriggers | *No description.* | --- @@ -167,6 +170,22 @@ public toTerraform(): any Adds this resource to the terraform JSON output. +##### `addMoveTarget` + +```typescript +public addMoveTarget(moveTarget: string): void +``` + +Adds a user defined moveTarget string to this resource to be later used in .moveTo(moveTarget) to resolve the location of the move. + +###### `moveTarget`Required + +- *Type:* string + +The string move target that will correspond to this resource. + +--- + ##### `getAnyMapAttribute` ```typescript @@ -275,6 +294,24 @@ public getStringMapAttribute(terraformAttribute: string): {[ key: string ]: stri --- +##### `importFrom` + +```typescript +public importFrom(id: string, provider?: TerraformProvider): void +``` + +###### `id`Required + +- *Type:* string + +--- + +###### `provider`Optional + +- *Type:* cdktf.TerraformProvider + +--- + ##### `interpolationForAttribute` ```typescript @@ -287,6 +324,30 @@ public interpolationForAttribute(terraformAttribute: string): IResolvable --- +##### `moveTo` + +```typescript +public moveTo(moveTarget: string, index?: string | number): void +``` + +Moves this resource to the target resource given by moveTarget. + +###### `moveTarget`Required + +- *Type:* string + +The previously set user defined string set by .addMoveTarget() corresponding to the resource to move to. + +--- + +###### `index`Optional + +- *Type:* string | number + +Optional The index corresponding to the key the resource is to appear in the foreach of a resource to move to. + +--- + ##### `resetTriggers` ```typescript @@ -300,6 +361,7 @@ public resetTriggers(): void | isConstruct | Checks if `x` is a construct. | | isTerraformElement | *No description.* | | isTerraformResource | *No description.* | +| generateConfigForImport | Generates CDKTF code for importing a Resource resource upon running "cdktf plan ". | --- @@ -349,6 +411,50 @@ LocalExec.isTerraformResource(x: any) --- +##### `generateConfigForImport` + +```typescript +import { LocalExec } from 'cdktf-local-exec' + +LocalExec.generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: TerraformProvider) +``` + +Generates CDKTF code for importing a Resource resource upon running "cdktf plan ". + +###### `scope`Required + +- *Type:* constructs.Construct + +The scope in which to define this construct. + +--- + +###### `importToId`Required + +- *Type:* string + +The construct id used in the generated config for the Resource to import. + +--- + +###### `importFromId`Required + +- *Type:* string + +The id of the existing Resource that should be imported. + +Refer to the {@link https://registry.terraform.io/providers/hashicorp/null/3.2.1/docs/resources/resource#import import section} in the documentation of this resource for the id to use + +--- + +###### `provider`Optional + +- *Type:* cdktf.TerraformProvider + +? Optional instance of the provider where the Resource to import is found. + +--- + #### Properties | **Name** | **Type** | **Description** | @@ -720,6 +826,7 @@ public resetAlias(): void | isConstruct | Checks if `x` is a construct. | | isTerraformElement | *No description.* | | isTerraformProvider | *No description.* | +| generateConfigForImport | Generates CDKTF code for importing a NullProvider resource upon running "cdktf plan ". | --- @@ -769,6 +876,50 @@ NullProvider.isTerraformProvider(x: any) --- +##### `generateConfigForImport` + +```typescript +import { NullProvider } from 'cdktf-local-exec' + +NullProvider.generateConfigForImport(scope: Construct, importToId: string, importFromId: string, provider?: TerraformProvider) +``` + +Generates CDKTF code for importing a NullProvider resource upon running "cdktf plan ". + +###### `scope`Required + +- *Type:* constructs.Construct + +The scope in which to define this construct. + +--- + +###### `importToId`Required + +- *Type:* string + +The construct id used in the generated config for the NullProvider to import. + +--- + +###### `importFromId`Required + +- *Type:* string + +The id of the existing NullProvider that should be imported. + +Refer to the {@link https://registry.terraform.io/providers/hashicorp/null/3.2.1/docs#import import section} in the documentation of this resource for the id to use + +--- + +###### `provider`Optional + +- *Type:* cdktf.TerraformProvider + +? Optional instance of the provider where the NullProvider to import is found. + +--- + #### Properties | **Name** | **Type** | **Description** |