From 8b8798c2ae69ed098d92cd8aabf020d5f235eed4 Mon Sep 17 00:00:00 2001 From: Arun Donti Date: Mon, 12 Sep 2022 22:44:50 -0400 Subject: [PATCH 01/15] inital implementation --- packages/@aws-cdk/aws-redshift/lib/cluster.ts | 70 +++++++++++++++++- .../aws-redshift/test/cluster.test.ts | 74 +++++++++++++++++++ 2 files changed, 142 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/aws-redshift/lib/cluster.ts b/packages/@aws-cdk/aws-redshift/lib/cluster.ts index f888bc8cf309c..6f2c9beb6ffe4 100644 --- a/packages/@aws-cdk/aws-redshift/lib/cluster.ts +++ b/packages/@aws-cdk/aws-redshift/lib/cluster.ts @@ -1,16 +1,18 @@ +import * as path from 'path'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; +import * as lambda from '@aws-cdk/aws-lambda'; import * as s3 from '@aws-cdk/aws-s3'; import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; -import { Duration, IResource, RemovalPolicy, Resource, SecretValue, Token } from '@aws-cdk/core'; +import { Duration, IResource, RemovalPolicy, Resource, SecretValue, Token, CustomResource, Stack, ArnFormat } from '@aws-cdk/core'; +import * as cr from '@aws-cdk/custom-resources'; import { Construct } from 'constructs'; import { DatabaseSecret } from './database-secret'; import { Endpoint } from './endpoint'; import { ClusterParameterGroup, IClusterParameterGroup } from './parameter-group'; import { CfnCluster } from './redshift.generated'; import { ClusterSubnetGroup, IClusterSubnetGroup } from './subnet-group'; - /** * Possible Node Types to use in the cluster * used for defining {@link ClusterProps.nodeType}. @@ -354,6 +356,12 @@ export interface ClusterProps { * @default - No Elastic IP */ readonly elasticIp?: string + + /** + * If this flag is set, the cluster will be rebooted when changes to the cluster's parameter group that require a restart to apply. + * @default false + */ + readonly rebootForParameterChanges?: boolean } /** @@ -452,6 +460,11 @@ export class Cluster extends ClusterBase { */ protected parameterGroup?: IClusterParameterGroup; + /** + * Whether the cluster will be rebooted when changes to the cluster's parameter group that require a restart to apply. + */ + protected rebootForParameterChangesEnabled?: boolean; + constructor(scope: Construct, id: string, props: ClusterProps) { super(scope, id); @@ -565,6 +578,9 @@ export class Cluster extends ClusterBase { const defaultPort = ec2.Port.tcp(this.clusterEndpoint.port); this.connections = new ec2.Connections({ securityGroups, defaultPort }); + if (props.rebootForParameterChanges) { + this.enableRebootForParameterChanges(); + } } /** @@ -652,4 +668,54 @@ export class Cluster extends ClusterBase { throw new Error('Cannot add a parameter to an imported parameter group.'); } } + + /** + * Enables automatic cluster rebooting when changes to the cluster's parameter group require a restart to apply. + */ + public enableRebootForParameterChanges(): void { + if (!this.parameterGroup) { + throw new Error('Cannot enable reboot for parameter changes when there is no associated ClusterParameterGroup.'); + } + if (!(this.parameterGroup instanceof ClusterParameterGroup)) { + throw new Error('Cannot enable reboot for parameter changes when using an imported parameter group.'); + } + if (!this.rebootForParameterChangesEnabled) { + this.rebootForParameterChangesEnabled = true; + const rebootFunction = new lambda.SingletonFunction(this, 'RedshiftClusterRebooterFunction', { + uuid: '511e207f-13df-4b8b-b632-c32b30b65ac2', + runtime: lambda.Runtime.NODEJS_16_X, + code: lambda.Code.fromAsset(path.join(__dirname, 'cluster-parameter-change-reboot-handler')), + handler: 'index.handler', + timeout: Duration.seconds(900), + }); + rebootFunction.addToRolePolicy(new iam.PolicyStatement({ + actions: ['redshift:DescribeClusters'], + resources: ['*'], + })); + rebootFunction.addToRolePolicy(new iam.PolicyStatement({ + actions: ['reshift:RebootCluster'], + resources: [ + Stack.of(this).formatArn({ + service: 'redshift', + resource: 'cluster', + resourceName: this.clusterName, + arnFormat: ArnFormat.COLON_RESOURCE_NAME, + }), + ], + })); + const provider = new cr.Provider(this, 'ResourceProvider', { + onEventHandler: rebootFunction, + }); + const customResource = new CustomResource(this, 'RedshiftClusterRebooterCustomResource', { + resourceType: 'Custom::RedshiftClusterRebooter', + serviceToken: provider.serviceToken, + properties: { + ClusterId: this.cluster.getAtt('id'), + ParameterGroupName: this.parameterGroup.clusterParameterGroupName, + ParametersString: JSON.stringify(this.parameterGroup.parameters), + }, + }); + customResource.node.addDependency(this, this.parameterGroup); + } + } } diff --git a/packages/@aws-cdk/aws-redshift/test/cluster.test.ts b/packages/@aws-cdk/aws-redshift/test/cluster.test.ts index 49f52e91dadb3..9d0c13dd23412 100644 --- a/packages/@aws-cdk/aws-redshift/test/cluster.test.ts +++ b/packages/@aws-cdk/aws-redshift/test/cluster.test.ts @@ -613,6 +613,80 @@ test('elastic ip address', () => { }); }); +describe('reboot for Parameter Changes', () => { + test('cluster without parameter group', () => { + // Given + const cluster = new Cluster(stack, 'Redshift', { + masterUser: { + masterUsername: 'admin', + }, + vpc, + }); + + // WHEN + expect(() => cluster.enableRebootForParameterChanges()) + // THEN + .toThrowError(/Cannot enable reboot for parameter changes/); + }); + + test('cluster with imported parameter group', () => { + // Given + const cluster = new Cluster(stack, 'Redshift', { + masterUser: { + masterUsername: 'admin', + }, + vpc, + }); + cluster.addToParameterGroup('foo', 'bar'); + + const cluster2 = new Cluster(stack, 'Redshift2', { + masterUser: { + masterUsername: 'admin', + }, + vpc, + }); + cluster2.addToParameterGroup('foo', 'bar'); + + // WHEN + cluster.enableRebootForParameterChanges(); + cluster2.enableRebootForParameterChanges(); + + //THEN + const template = Template.fromStack(stack); + template.resourceCountIs('Custom::RedshiftClusterRebooter', 2); + template.templateMatches({ + Resources: { + SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5: { + Type: 'AWS::Lambda::Function', + Properties: { + Handler: 'index.handler', + Runtime: 'nodejs16.x', + Timeout: 900, + }, + }, + }, + }); + }); + + + test('cluster with parameter group', () => { + // Given + const cluster = new Cluster(stack, 'Redshift', { + masterUser: { + masterUsername: 'admin', + }, + vpc, + parameterGroup: ClusterParameterGroup.fromClusterParameterGroupName(stack, 'foo', 'bar'), + }); + + // WHEN + expect(() => cluster.enableRebootForParameterChanges()) + // THEN + .toThrowError(/Cannot enable reboot for parameter changes/); + }); + +}); + function testStack() { const newTestStack = new cdk.Stack(undefined, undefined, { env: { account: '12345', region: 'us-test-1' } }); newTestStack.node.setContext('availability-zones:12345:us-test-1', ['us-test-1a', 'us-test-1b']); From 68ebe281149d6c992fef9f850766a3029e14ee0f Mon Sep 17 00:00:00 2001 From: Arun Donti Date: Wed, 14 Sep 2022 13:36:42 -0400 Subject: [PATCH 02/15] add lambda handler --- .../index.ts | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 packages/@aws-cdk/aws-redshift/lib/cluster-parameter-change-reboot-handler/index.ts diff --git a/packages/@aws-cdk/aws-redshift/lib/cluster-parameter-change-reboot-handler/index.ts b/packages/@aws-cdk/aws-redshift/lib/cluster-parameter-change-reboot-handler/index.ts new file mode 100644 index 0000000000000..6e3f772659209 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/lib/cluster-parameter-change-reboot-handler/index.ts @@ -0,0 +1,42 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { Redshift } from 'aws-sdk'; + +const redshift = new Redshift(); + +export async function handler(event: AWSLambda.CloudFormationCustomResourceEvent) { + if (event.RequestType !== 'Delete') { + return rebootClusterIfRequired(event); + } else { + return; + } +} + +async function rebootClusterIfRequired(event: AWSLambda.CloudFormationCustomResourceEvent) { + const clusterId = event.ResourceProperties?.ClusterId; + const parameterGroupName = event.ResourceProperties?.ParameterGroupName; + const clusterDetails = await redshift.describeClusters({ ClusterIdentifier: clusterId }).promise(); + let found = false; + if (clusterDetails.Clusters?.[0].ClusterParameterGroups === undefined) { + throw new Error(`Unable to find any Parameter Groups associated with ClusterId "${clusterId}".`); + } + for (const group of clusterDetails.Clusters?.[0].ClusterParameterGroups) { + if (group.ParameterGroupName === parameterGroupName) { + found = true; + if (group.ParameterApplyStatus === 'pending-reboot') { + await redshift.rebootCluster({ ClusterIdentifier: clusterId }).promise(); + } else if (group.ParameterApplyStatus === 'applying') { + await sleep(60000); + await rebootClusterIfRequired(event); + } + break; + } + } + if (!found) { + throw new Error(`Unable to find Parameter Group named "${parameterGroupName}" associated with ClusterId "${clusterId}".`); + } + return; +} + +function sleep(ms: number) { + return new Promise(resolve => setTimeout(resolve, ms)); +} \ No newline at end of file From f262a52199410d22260659258517918ca3a9cf99 Mon Sep 17 00:00:00 2001 From: Arun Donti Date: Thu, 15 Sep 2022 15:39:39 -0400 Subject: [PATCH 03/15] documentation, tests, and bugfixes --- packages/@aws-cdk/aws-redshift/README.md | 20 +- .../index.ts | 51 +- packages/@aws-cdk/aws-redshift/lib/cluster.ts | 15 +- ...51b7a80c75f3d8733872af7952c3a6d902147e.zip | Bin 0 -> 4767 bytes ...cce9bbdb8e53862bc1ead871c88a235f8ef139.zip | Bin 0 -> 4791 bytes ...019ff95dbf73d5be0dc2b7dc5db48f25f8245f.zip | Bin 0 -> 4696 bytes .../assertion-results.json | 6 + .../index.ts | 53 + .../index.ts | 53 + .../index.ts | 54 + ...ws-cdk-redshift-cluster-create.assets.json | 45 + ...-cdk-redshift-cluster-create.template.json | 564 +++++ ...ws-cdk-redshift-cluster-update.assets.json | 45 + ...-cdk-redshift-cluster-update.template.json | 586 +++++ ...efaultTestDeployAssert1AE11B34.assets.json | 32 + ...aultTestDeployAssert1AE11B34.template.json | 223 ++ .../test/cdk-integ.out.cluster-reboot/cdk.out | 1 + .../cdk-integ.out.cluster-reboot/integ.json | 15 + .../manifest.json | 456 ++++ .../cdk-integ.out.cluster-reboot/tree.json | 2053 +++++++++++++++++ .../aws-redshift/test/cluster.test.ts | 29 +- .../aws-redshift/test/integ.cluster-reboot.ts | 105 + 22 files changed, 4379 insertions(+), 27 deletions(-) create mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/.cache/1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e.zip create mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/.cache/631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139.zip create mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/.cache/8183b462910b51c368ad6760d3019ff95dbf73d5be0dc2b7dc5db48f25f8245f.zip create mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/assertion-results.json create mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/asset.1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e/index.ts create mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/asset.631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139/index.ts create mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/asset.8183b462910b51c368ad6760d3019ff95dbf73d5be0dc2b7dc5db48f25f8245f/index.ts create mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-create.assets.json create mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-create.template.json create mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-update.assets.json create mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-update.template.json create mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets.json create mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.template.json create mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/cdk.out create mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/integ.json create mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/manifest.json create mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/tree.json create mode 100644 packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.ts diff --git a/packages/@aws-cdk/aws-redshift/README.md b/packages/@aws-cdk/aws-redshift/README.md index 66af962185f72..3f2e363675176 100644 --- a/packages/@aws-cdk/aws-redshift/README.md +++ b/packages/@aws-cdk/aws-redshift/README.md @@ -331,6 +331,25 @@ const cluster = new Cluster(this, 'Cluster', { cluster.addToParameterGroup('enable_user_activity_logging', 'true'); ``` +## Rebooting for Parameter Updates + +In most cases, existing clusters [must be manually rebooted](https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-parameter-groups.html) to apply parameter changes. You can automate parameter related reboots by setting the cluster's `rebootForParameterChanges` property to `true` , or by using `Cluster.enableRebootForParameterChanges()`. + +```ts +declare const vpc: ec2.Vpc; + +const cluster = new Cluster(this, 'Cluster', { + masterUser: { + masterUsername: 'admin', + masterPassword: cdk.SecretValue.unsafePlainText('tooshort'), + }, + vpc, +}); + +cluster.addToParameterGroup('enable_user_activity_logging', 'true'); +cluster.enableRebootForParameterChanges() +``` + ## Elastic IP If you configure your cluster to be publicly accessible, you can optionally select an *elastic IP address* to use for the external IP address. An elastic IP address is a static IP address that is associated with your AWS account. You can use an elastic IP address to connect to your cluster from outside the VPC. An elastic IP address gives you the ability to change your underlying configuration without affecting the IP address that clients use to connect to your cluster. This approach can be helpful for situations such as recovery after a failure. @@ -367,4 +386,3 @@ The elastic IP address is an external IP address for accessing the cluster outsi ### Attach Elastic IP after Cluster creation In some cases, you might want to associate the cluster with an elastic IP address or change an elastic IP address that is associated with the cluster. To attach an elastic IP address after the cluster is created, first update the cluster so that it is not publicly accessible, then make it both publicly accessible and add an Elastic IP address in the same operation. - diff --git a/packages/@aws-cdk/aws-redshift/lib/cluster-parameter-change-reboot-handler/index.ts b/packages/@aws-cdk/aws-redshift/lib/cluster-parameter-change-reboot-handler/index.ts index 6e3f772659209..f69314783b600 100644 --- a/packages/@aws-cdk/aws-redshift/lib/cluster-parameter-change-reboot-handler/index.ts +++ b/packages/@aws-cdk/aws-redshift/lib/cluster-parameter-change-reboot-handler/index.ts @@ -3,38 +3,49 @@ import { Redshift } from 'aws-sdk'; const redshift = new Redshift(); -export async function handler(event: AWSLambda.CloudFormationCustomResourceEvent) { +export async function handler(event: AWSLambda.CloudFormationCustomResourceEvent): Promise { if (event.RequestType !== 'Delete') { - return rebootClusterIfRequired(event); + return rebootClusterIfRequired(event.ResourceProperties?.ClusterId, event.ResourceProperties?.ParameterGroupName); } else { return; } } -async function rebootClusterIfRequired(event: AWSLambda.CloudFormationCustomResourceEvent) { - const clusterId = event.ResourceProperties?.ClusterId; - const parameterGroupName = event.ResourceProperties?.ParameterGroupName; - const clusterDetails = await redshift.describeClusters({ ClusterIdentifier: clusterId }).promise(); - let found = false; - if (clusterDetails.Clusters?.[0].ClusterParameterGroups === undefined) { - throw new Error(`Unable to find any Parameter Groups associated with ClusterId "${clusterId}".`); - } - for (const group of clusterDetails.Clusters?.[0].ClusterParameterGroups) { - if (group.ParameterGroupName === parameterGroupName) { - found = true; - if (group.ParameterApplyStatus === 'pending-reboot') { +async function rebootClusterIfRequired(clusterId: string, parameterGroupName: string): Promise { + return executeActionForStatus(await getApplyStatus()); + + // https://docs.aws.amazon.com/redshift/latest/APIReference/API_ClusterParameterStatus.html + async function executeActionForStatus(status: string, retryDurationMs?: number): Promise { + await sleep(retryDurationMs ?? 0); + if (['pending-reboot', 'apply-deferred', 'apply-error', 'unknown-error'].includes(status)) { + try { await redshift.rebootCluster({ ClusterIdentifier: clusterId }).promise(); - } else if (group.ParameterApplyStatus === 'applying') { - await sleep(60000); - await rebootClusterIfRequired(event); + } catch (err) { + if ((err).code === 'InvalidClusterState') { + return await executeActionForStatus(status, 30000); + } else { + throw err; + } } - break; + return; + } else if (['applying', 'retry'].includes(status)) { + return executeActionForStatus(await getApplyStatus(), 30000); } + return; } - if (!found) { + + async function getApplyStatus(): Promise { + const clusterDetails = await redshift.describeClusters({ ClusterIdentifier: clusterId }).promise(); + if (clusterDetails.Clusters?.[0].ClusterParameterGroups === undefined) { + throw new Error(`Unable to find any Parameter Groups associated with ClusterId "${clusterId}".`); + } + for (const group of clusterDetails.Clusters?.[0].ClusterParameterGroups) { + if (group.ParameterGroupName === parameterGroupName) { + return group.ParameterApplyStatus ?? 'retry'; + } + } throw new Error(`Unable to find Parameter Group named "${parameterGroupName}" associated with ClusterId "${clusterId}".`); } - return; } function sleep(ms: number) { diff --git a/packages/@aws-cdk/aws-redshift/lib/cluster.ts b/packages/@aws-cdk/aws-redshift/lib/cluster.ts index 6f2c9beb6ffe4..a4f186606c085 100644 --- a/packages/@aws-cdk/aws-redshift/lib/cluster.ts +++ b/packages/@aws-cdk/aws-redshift/lib/cluster.ts @@ -5,7 +5,7 @@ import * as kms from '@aws-cdk/aws-kms'; import * as lambda from '@aws-cdk/aws-lambda'; import * as s3 from '@aws-cdk/aws-s3'; import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; -import { Duration, IResource, RemovalPolicy, Resource, SecretValue, Token, CustomResource, Stack, ArnFormat } from '@aws-cdk/core'; +import { ArnFormat, CustomResource, Duration, IResource, Lazy, RemovalPolicy, Resource, SecretValue, Stack, Token } from '@aws-cdk/core'; import * as cr from '@aws-cdk/custom-resources'; import { Construct } from 'constructs'; import { DatabaseSecret } from './database-secret'; @@ -693,7 +693,7 @@ export class Cluster extends ClusterBase { resources: ['*'], })); rebootFunction.addToRolePolicy(new iam.PolicyStatement({ - actions: ['reshift:RebootCluster'], + actions: ['redshift:RebootCluster'], resources: [ Stack.of(this).formatArn({ service: 'redshift', @@ -710,9 +710,16 @@ export class Cluster extends ClusterBase { resourceType: 'Custom::RedshiftClusterRebooter', serviceToken: provider.serviceToken, properties: { - ClusterId: this.cluster.getAtt('id'), + ClusterId: this.clusterName, ParameterGroupName: this.parameterGroup.clusterParameterGroupName, - ParametersString: JSON.stringify(this.parameterGroup.parameters), + ParametersString: Lazy.string({ + produce: () => { + if (!(this.parameterGroup instanceof ClusterParameterGroup)) { + throw new Error('Cannot enable reboot for parameter changes when using an imported parameter group.'); + } + return JSON.stringify(this.parameterGroup.parameters); + }, + }), }, }); customResource.node.addDependency(this, this.parameterGroup); diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/.cache/1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e.zip b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/.cache/1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e.zip new file mode 100644 index 0000000000000000000000000000000000000000..53b9773f334a9214310fbeca89c8d257ec0ce753 GIT binary patch literal 4767 zcma)=XD}RG+sBEPAbJTQl3RX%*rx>jjcj z#IR?ixuVl$s~<_fl!FTn*mQ!0jSoCGYLb^_PFw9lNk0Xudj>-`eo_#GA@|M)PLm8) z29}yh`$Uk->uOoe8OXD3I!LT?&PrGqB)DHOZYS!8&Wr*5C`2`SP=plA9&>PI`9dyH z^_hsArf^?sa$Pk#cW z-8`7K=$m4m{M_BGPFcew0Y<>KA{}xpK@+xw4PY?Nx@aez!oDUG28OA&&P~<@en>5V zW*3@6mgX6G7W5E=3_%nOA(NmLlJzkCm?W-;unH0ak&jmL3O?kpwQymc=9AArlETH3 zyWJOVs&Jv07kjJ{i(UX%KoPgQp<e6ymF<7L@@n6 zEKW7pi>exH0Gfm1m$f~LtzUWZTnDZ_5ymd;ka7VR?d@bLb?%KOPz<(~U#vmH!Y8ry zZsBfMe8f!o2Xu2vArqQllDe!6lH6SSJLa=^oIm^{F~^Jh#5ux#oJhlz#`1&4tY3le zIZC5P(mF>R#UWr&H@R@Al*e2TzVPoR$DJEw+r_}jNR zv88p3&qfVPp6ha6_^(9iw)_&9WLp5fd)=c!7W^=zN)vi_L=-Ha)MtO$J6=Pvf^{8= z3tRd5msY<#QGvFptev<;UAwXw%*XaqGe z-f8h8d+>*^KXcA~Wcax}^Bx`P`t^tHUzX>2px&u4`?h|e=YN|hL6qfl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On7b=*XCPw{;CpU9+Qwn@FR)5)X6vOL37mh%Gq57a$DM+V%;q;O zF*P8+0-*Re=J`*|@(1($6Sv8V!~b;uhCctT`_Ga817ZG&KRWpD_FqWmzg7R~Pc6~_ literal 0 HcmV?d00001 diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/.cache/631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139.zip b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/.cache/631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139.zip new file mode 100644 index 0000000000000000000000000000000000000000..aacd4ffa5942e4b89d9969a41e309ab02a78d95e GIT binary patch literal 4791 zcma)=cQ71Y*T=Vf7Zhg($17-j*P&2rI1KTXcyUy?3Io-r3c= zwOGNM%x|7~p7)t~XWnz>%suyy@4erD&Yig*4Iusn`WO$PkZO&GW$#m5QnjJRA)m z(cNRK{RqoH_geiajsMfxU$6f-vv*6^2f5AlJ-E&=%ii@XS<|^>ZR=t+syCvgWF@N% zmBDj#v_2E)+iKsz4UfCMlFWTX?2@*3;Gv60e};C?l!Ex~Rq=r9pGHYaNM4~9L(cZ* zw&T~Oe6p_|DuP7SPTjm}VQWJ5E5j`T9&k;hRg0fzJ7irXKeIlwUTE0(0M*HNn6x@M zPR6txRnND;al#0@MJ=8QZ*sKI{Hk?Y5&{pc(Mk!^b_tI~4=$o1}851yGF26bbQ`tW~o?eD_z@%_H7VA9| z8oUU8HFN4|3l7D)MT~c-9!`OzZN9MR3uFxls8089?t-3G!nt)W2FQLvs7+@zT}-CV z=R~!sQP=}b`bKppvf?`ADtAaF-j{|}!~7t#HgqvY`Y!+TC(VyNqE6LlQ$KO$BI}Ss zU%I>&&n~$I52nq;Gf;B&vUTWrzYbeIV`DA)9^3uW)|*N}UA_X+w)E}t7HNv!YWwQMfeMfjVyo+ImzZN75}W3l#3 zib08WdEi26thBXBy=7`q^PAqTerI5py{d+?sFR7%uX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U(P!tUyE*=2?-}vW0@ylQQ^G`g+$qV}1{Tl}T zx9&ej{x6*QC;sYE{HUF*pPbdFdWlHfcmAjh;kbv;-dH8=a@6URD|L^X909kBH A#{d8T literal 0 HcmV?d00001 diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/.cache/8183b462910b51c368ad6760d3019ff95dbf73d5be0dc2b7dc5db48f25f8245f.zip b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/.cache/8183b462910b51c368ad6760d3019ff95dbf73d5be0dc2b7dc5db48f25f8245f.zip new file mode 100644 index 0000000000000000000000000000000000000000..7df84aa5a0c5d2fad379046c3fdc4ac867679aa4 GIT binary patch literal 4696 zcma)=XHXN`w#TUo3IU}=sRxlJB@_dMek3ZPNe87#?;wOE^iWh31r8uZs?uv9H0dB9 z9YP3AkSa$&N`OFs(4NkjJNLdj^Jd;!vuCgU;lJ1a%lfc>20FBK>{JZDl8Q>;*ZFr` z`Bl1kJ30kOIZFA%bt**rKz9taV0t4k32jp?@nIdQ{vn)kpVp90KTL8=OHyZ89BcH9 ziG>Us($j{G!$jas(u)t&gA=o2)fr5FNk`OX$~$4dQgM zH9u&m40J9t>^g46*#GM5`0E(_pU!@J{l}R*yu!i*KC6{@x@{XVVf`HJTTho*=rr;i zbuT31gO)ZGEWEq>B~U~24`>S~OJc|Kixa0j?vOt6@b)*+PGNj81~V{F?!JEK5wF1T zb=(LhERf{ds)$5tX1aj*d>gFun22e%Ki%21ue&XIlis*8Y* z-@_vc0p!!LG~C1Vns~d@#SRzqvP04jQP^g}VJ`{MnN;;*sdBHxzaqubl&BrzJ)-ZFhXiv*o_CsD)XA9EI|FU%+Q>H8SW za?42%ind_$7V9ya6+X_Qy<2BV}pvSYF?nf1qg)S)(;xSDXKr` zl+uZ*ksafpbV--hv^N&x4~U%!8jG02O-Mhk6KiGgw_YYRB30=fd5HfcN2bUIJ3KTW zPK50#3A-D@1YidA%M3XsG%Kt#hYac&G@)YAGo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JQTo& zNvA`j%FJW4RO+q)jzq~;Ke)JbqC3?djFp>>knKhom5(la^+joFJLayb#_qJ?o%f7=l5=?Jihb!ksX1S^=5$i zF8I8Bbb1!?ddFKf;++16D^|UDEBwQZwhkp-+zAKYiw{a^{6y!3SK6f(Gk867o!f`P0?`@)d+m!mBg>vxVf!ch-T{ zr^D|b$>+!5(#$xEz`Na>u}<}}*DPi1mac8pN{|rKJPk3_w;3hMC5IJZ4cdCT^zn~B zhl$-RD%DE&6M@upBV=3CtsP#bKacX>6?`^Pz0}%!)pBJeROCDDkuG!1@S2b5A){1KFDSxQ&s!`>nwQi1uf9DEioR@Wj$8LE= zB}pgcDjyBRUfC-+l`psd+TdE3jH;J3iVwOJ3ot+%aH(~~WuFyVyVlXr%sM_W(~Dc0 zjV7;t6tr5HKXx~ywzlijsywOWSa}w9Ar_Dt-a8|Z-}8;_r+1});y&;C!)xI=uRm@B zUElXH>mmy@?RDzX9E$S;n}c`)L3wvIV|pg$c0+62XRG+M>0bDo;L~txe2ZCYA@p;n zZT{BRRYQ`tN2toeB_My@_=uqY43v9N5DD$G6WYx6pi&HKXIyj+31(NP;|R)?D_{%` zMX5Bw81Hy+39(Lwqru65mhZV__D`%H&%NoU7*m70s)HN1Vt855x(^hUJ!-!)d~;b= zzxZN(b%1m!@u}}ayjuCzHRe8rgeJt4R&Wia2Q+lU(R4^gH+hr`)3ii>dw0(EIB^<6 zA4N7}-v@TcH*1Q%ZDy)(r~W;OO=8~nOlYa7puaGOfetl|B<;WX%zyHc-+bnu_=74x z;&=6LTJzt!|D5jM^yHuTtxNw^{)?sjx9UHg{BIRI;9n|#xPcD+rQiS2{>uDcclNd4 Gum1s1jtQUu literal 0 HcmV?d00001 diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/assertion-results.json b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/assertion-results.json new file mode 100644 index 0000000000000..ef701a64b8137 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/assertion-results.json @@ -0,0 +1,6 @@ +{ + "aws-cdk-redshift-cluster-reboot-integ": { + "ExportsOutputRefClusterEB0386A796A0E3FE": "clustereb0386a7-dzxalxbye79k", + "ExportsOutputRefParameterGroup5E32DECBB33EA140": "aws-cdk-redshift-cluster-reboot-integ-parametergroup5e32decb-kuykp4syd337" + } +} diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/asset.1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e/index.ts b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/asset.1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e/index.ts new file mode 100644 index 0000000000000..f69314783b600 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/asset.1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e/index.ts @@ -0,0 +1,53 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { Redshift } from 'aws-sdk'; + +const redshift = new Redshift(); + +export async function handler(event: AWSLambda.CloudFormationCustomResourceEvent): Promise { + if (event.RequestType !== 'Delete') { + return rebootClusterIfRequired(event.ResourceProperties?.ClusterId, event.ResourceProperties?.ParameterGroupName); + } else { + return; + } +} + +async function rebootClusterIfRequired(clusterId: string, parameterGroupName: string): Promise { + return executeActionForStatus(await getApplyStatus()); + + // https://docs.aws.amazon.com/redshift/latest/APIReference/API_ClusterParameterStatus.html + async function executeActionForStatus(status: string, retryDurationMs?: number): Promise { + await sleep(retryDurationMs ?? 0); + if (['pending-reboot', 'apply-deferred', 'apply-error', 'unknown-error'].includes(status)) { + try { + await redshift.rebootCluster({ ClusterIdentifier: clusterId }).promise(); + } catch (err) { + if ((err).code === 'InvalidClusterState') { + return await executeActionForStatus(status, 30000); + } else { + throw err; + } + } + return; + } else if (['applying', 'retry'].includes(status)) { + return executeActionForStatus(await getApplyStatus(), 30000); + } + return; + } + + async function getApplyStatus(): Promise { + const clusterDetails = await redshift.describeClusters({ ClusterIdentifier: clusterId }).promise(); + if (clusterDetails.Clusters?.[0].ClusterParameterGroups === undefined) { + throw new Error(`Unable to find any Parameter Groups associated with ClusterId "${clusterId}".`); + } + for (const group of clusterDetails.Clusters?.[0].ClusterParameterGroups) { + if (group.ParameterGroupName === parameterGroupName) { + return group.ParameterApplyStatus ?? 'retry'; + } + } + throw new Error(`Unable to find Parameter Group named "${parameterGroupName}" associated with ClusterId "${clusterId}".`); + } +} + +function sleep(ms: number) { + return new Promise(resolve => setTimeout(resolve, ms)); +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/asset.631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139/index.ts b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/asset.631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139/index.ts new file mode 100644 index 0000000000000..f69314783b600 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/asset.631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139/index.ts @@ -0,0 +1,53 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { Redshift } from 'aws-sdk'; + +const redshift = new Redshift(); + +export async function handler(event: AWSLambda.CloudFormationCustomResourceEvent): Promise { + if (event.RequestType !== 'Delete') { + return rebootClusterIfRequired(event.ResourceProperties?.ClusterId, event.ResourceProperties?.ParameterGroupName); + } else { + return; + } +} + +async function rebootClusterIfRequired(clusterId: string, parameterGroupName: string): Promise { + return executeActionForStatus(await getApplyStatus()); + + // https://docs.aws.amazon.com/redshift/latest/APIReference/API_ClusterParameterStatus.html + async function executeActionForStatus(status: string, retryDurationMs?: number): Promise { + await sleep(retryDurationMs ?? 0); + if (['pending-reboot', 'apply-deferred', 'apply-error', 'unknown-error'].includes(status)) { + try { + await redshift.rebootCluster({ ClusterIdentifier: clusterId }).promise(); + } catch (err) { + if ((err).code === 'InvalidClusterState') { + return await executeActionForStatus(status, 30000); + } else { + throw err; + } + } + return; + } else if (['applying', 'retry'].includes(status)) { + return executeActionForStatus(await getApplyStatus(), 30000); + } + return; + } + + async function getApplyStatus(): Promise { + const clusterDetails = await redshift.describeClusters({ ClusterIdentifier: clusterId }).promise(); + if (clusterDetails.Clusters?.[0].ClusterParameterGroups === undefined) { + throw new Error(`Unable to find any Parameter Groups associated with ClusterId "${clusterId}".`); + } + for (const group of clusterDetails.Clusters?.[0].ClusterParameterGroups) { + if (group.ParameterGroupName === parameterGroupName) { + return group.ParameterApplyStatus ?? 'retry'; + } + } + throw new Error(`Unable to find Parameter Group named "${parameterGroupName}" associated with ClusterId "${clusterId}".`); + } +} + +function sleep(ms: number) { + return new Promise(resolve => setTimeout(resolve, ms)); +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/asset.8183b462910b51c368ad6760d3019ff95dbf73d5be0dc2b7dc5db48f25f8245f/index.ts b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/asset.8183b462910b51c368ad6760d3019ff95dbf73d5be0dc2b7dc5db48f25f8245f/index.ts new file mode 100644 index 0000000000000..0cb4873f138c0 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/asset.8183b462910b51c368ad6760d3019ff95dbf73d5be0dc2b7dc5db48f25f8245f/index.ts @@ -0,0 +1,54 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { Redshift } from 'aws-sdk'; + +const redshift = new Redshift(); + +export async function handler(event: AWSLambda.CloudFormationCustomResourceEvent): Promise { + if (event.RequestType !== 'Delete') { + return rebootClusterIfRequired(event.ResourceProperties?.ClusterId, event.ResourceProperties?.ParameterGroupName); + } else { + return; + } +} + +async function rebootClusterIfRequired(clusterId: string, parameterGroupName: string) { + return executeActionForStatus(await getApplyStatus()); + + // https://docs.aws.amazon.com/redshift/latest/APIReference/API_ClusterParameterStatus.html + async function executeActionForStatus(status: string): Promise { + if (['pending-reboot', 'apply-deferred', 'apply-error', 'unknown-error'].includes(status)) { + try { + await redshift.rebootCluster({ ClusterIdentifier: clusterId }).promise(); + } catch (err) { + if ((err).code === 'InvalidClusterState') { + await sleep(60000); + return await executeActionForStatus(await getApplyStatus()); + } else { + throw err; + } + } + return; + } else if (['applying', 'retry'].includes(status)) { + await sleep(60000); + return executeActionForStatus(await getApplyStatus()); + } + return; + } + + async function getApplyStatus(): Promise { + const clusterDetails = await redshift.describeClusters({ ClusterIdentifier: clusterId }).promise(); + if (clusterDetails.Clusters?.[0].ClusterParameterGroups === undefined) { + throw new Error(`Unable to find any Parameter Groups associated with ClusterId "${clusterId}".`); + } + for (const group of clusterDetails.Clusters?.[0].ClusterParameterGroups) { + if (group.ParameterGroupName === parameterGroupName) { + return group.ParameterApplyStatus ?? 'retry'; + } + } + throw new Error(`Unable to find Parameter Group named "${parameterGroupName}" associated with ClusterId "${clusterId}".`); + } +} + +function sleep(ms: number) { + return new Promise(resolve => setTimeout(resolve, ms)); +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-create.assets.json b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-create.assets.json new file mode 100644 index 0000000000000..20e9342765604 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-create.assets.json @@ -0,0 +1,45 @@ +{ + "version": "21.0.0", + "files": { + "631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139": { + "source": { + "path": "asset.631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671": { + "source": { + "path": "asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "42ff6c40ab2191a9f141b53cff77b4d1a253b7af577e2d0c9a196cdc4316ee2f": { + "source": { + "path": "aws-cdk-redshift-cluster-create.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "42ff6c40ab2191a9f141b53cff77b4d1a253b7af577e2d0c9a196cdc4316ee2f.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-create.template.json b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-create.template.json new file mode 100644 index 0000000000000..ccdc27a353cd3 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-create.template.json @@ -0,0 +1,564 @@ +{ + "Resources": { + "Vpc8378EB38": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-create/Vpc" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet1Subnet77A7FDC6": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "Vpc8378EB38" + }, + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.0.0/17", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "foobar" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Isolated" + }, + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet1RouteTableAF4E5874": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "Vpc8378EB38" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet1RouteTableAssociation502CBE55": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcfoobarSubnet1RouteTableAF4E5874" + }, + "SubnetId": { + "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet2Subnet85B013AD": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "Vpc8378EB38" + }, + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.128.0/17", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "foobar" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Isolated" + }, + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet2RouteTable5127598D": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "Vpc8378EB38" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet2RouteTableAssociation5013D70B": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcfoobarSubnet2RouteTable5127598D" + }, + "SubnetId": { + "Ref": "VpcfoobarSubnet2Subnet85B013AD" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ParameterGroup5E32DECB": { + "Type": "AWS::Redshift::ClusterParameterGroup", + "Properties": { + "Description": "Cluster parameter group for family redshift-1.0", + "ParameterGroupFamily": "redshift-1.0", + "Parameters": [ + { + "ParameterName": "enable_user_activity_logging", + "ParameterValue": "true" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterSubnetsDCFA5CB7": { + "Type": "AWS::Redshift::ClusterSubnetGroup", + "Properties": { + "Description": "Subnets for Cluster Redshift cluster", + "SubnetIds": [ + { + "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" + }, + { + "Ref": "VpcfoobarSubnet2Subnet85B013AD" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterSecurityGroup0921994B": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "Redshift security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterSecret6368BD0F": { + "Type": "AWS::SecretsManager::Secret", + "Properties": { + "GenerateSecretString": { + "ExcludeCharacters": "\"@/\\ '", + "GenerateStringKey": "password", + "PasswordLength": 30, + "SecretStringTemplate": "{\"username\":\"admin\"}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterSecretAttachment769E6258": { + "Type": "AWS::SecretsManager::SecretTargetAttachment", + "Properties": { + "SecretId": { + "Ref": "ClusterSecret6368BD0F" + }, + "TargetId": { + "Ref": "ClusterEB0386A7" + }, + "TargetType": "AWS::Redshift::Cluster" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterEB0386A7": { + "Type": "AWS::Redshift::Cluster", + "Properties": { + "ClusterType": "multi-node", + "DBName": "default_db", + "MasterUsername": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "ClusterSecret6368BD0F" + }, + ":SecretString:username::}}" + ] + ] + }, + "MasterUserPassword": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "ClusterSecret6368BD0F" + }, + ":SecretString:password::}}" + ] + ] + }, + "NodeType": "dc2.large", + "AllowVersionUpgrade": true, + "AutomatedSnapshotRetentionPeriod": 1, + "ClusterParameterGroupName": { + "Ref": "ParameterGroup5E32DECB" + }, + "ClusterSubnetGroupName": { + "Ref": "ClusterSubnetsDCFA5CB7" + }, + "Encrypted": true, + "NumberOfNodes": 2, + "PubliclyAccessible": false, + "VpcSecurityGroupIds": [ + { + "Fn::GetAtt": [ + "ClusterSecurityGroup0921994B", + "GroupId" + ] + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", + "Roles": [ + { + "Ref": "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterResourceProviderframeworkonEvent15BB3722": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671.zip" + }, + "Role": { + "Fn::GetAtt": [ + "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE", + "Arn" + ] + }, + "Description": "AWS CDK resource provider framework - onEvent (aws-cdk-redshift-cluster-create/Cluster/ResourceProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + } + } + }, + "Handler": "framework.onEvent", + "Runtime": "nodejs14.x", + "Timeout": 900 + }, + "DependsOn": [ + "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", + "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterRedshiftClusterRebooterCustomResource773361E1": { + "Type": "Custom::RedshiftClusterRebooter", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "ClusterResourceProviderframeworkonEvent15BB3722", + "Arn" + ] + }, + "ClusterId": { + "Ref": "ClusterEB0386A7" + }, + "ParameterGroupName": { + "Ref": "ParameterGroup5E32DECB" + }, + "ParametersString": "{\"enable_user_activity_logging\":\"true\"}" + }, + "DependsOn": [ + "ClusterEB0386A7", + "ClusterResourceProviderframeworkonEvent15BB3722", + "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", + "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE", + "ClusterSecretAttachment769E6258", + "ClusterSecret6368BD0F", + "ClusterSecurityGroup0921994B", + "ClusterSubnetsDCFA5CB7", + "ParameterGroup5E32DECB" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "redshift:DescribeClusters", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "redshift:RebootCluster", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":redshift:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":cluster:", + { + "Ref": "ClusterEB0386A7" + } + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF", + "Roles": [ + { + "Ref": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139.zip" + }, + "Role": { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525", + "Arn" + ] + }, + "Handler": "index.handler", + "Runtime": "nodejs16.x", + "Timeout": 900 + }, + "DependsOn": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF", + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-update.assets.json b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-update.assets.json new file mode 100644 index 0000000000000..1b7136f7c2e27 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-update.assets.json @@ -0,0 +1,45 @@ +{ + "version": "21.0.0", + "files": { + "631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139": { + "source": { + "path": "asset.631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671": { + "source": { + "path": "asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "4062cab3dd20bc5e69e0a94b9151bea5b695c4d9c7db1766fe1d47cf14eb3a9f": { + "source": { + "path": "aws-cdk-redshift-cluster-update.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "4062cab3dd20bc5e69e0a94b9151bea5b695c4d9c7db1766fe1d47cf14eb3a9f.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-update.template.json b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-update.template.json new file mode 100644 index 0000000000000..3877089639ae5 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-update.template.json @@ -0,0 +1,586 @@ +{ + "Resources": { + "Vpc8378EB38": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-update/Vpc" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet1Subnet77A7FDC6": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "Vpc8378EB38" + }, + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.0.0/17", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "foobar" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Isolated" + }, + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet1RouteTableAF4E5874": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "Vpc8378EB38" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet1RouteTableAssociation502CBE55": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcfoobarSubnet1RouteTableAF4E5874" + }, + "SubnetId": { + "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet2Subnet85B013AD": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "Vpc8378EB38" + }, + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.128.0/17", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "foobar" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Isolated" + }, + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet2RouteTable5127598D": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "Vpc8378EB38" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet2RouteTableAssociation5013D70B": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcfoobarSubnet2RouteTable5127598D" + }, + "SubnetId": { + "Ref": "VpcfoobarSubnet2Subnet85B013AD" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ParameterGroup5E32DECB": { + "Type": "AWS::Redshift::ClusterParameterGroup", + "Properties": { + "Description": "Cluster parameter group for family redshift-1.0", + "ParameterGroupFamily": "redshift-1.0", + "Parameters": [ + { + "ParameterName": "enable_user_activity_logging", + "ParameterValue": "false" + }, + { + "ParameterName": "use_fips_ssl", + "ParameterValue": "true" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterSubnetsDCFA5CB7": { + "Type": "AWS::Redshift::ClusterSubnetGroup", + "Properties": { + "Description": "Subnets for Cluster Redshift cluster", + "SubnetIds": [ + { + "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" + }, + { + "Ref": "VpcfoobarSubnet2Subnet85B013AD" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterSecurityGroup0921994B": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "Redshift security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterSecret6368BD0F": { + "Type": "AWS::SecretsManager::Secret", + "Properties": { + "GenerateSecretString": { + "ExcludeCharacters": "\"@/\\ '", + "GenerateStringKey": "password", + "PasswordLength": 30, + "SecretStringTemplate": "{\"username\":\"admin\"}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterSecretAttachment769E6258": { + "Type": "AWS::SecretsManager::SecretTargetAttachment", + "Properties": { + "SecretId": { + "Ref": "ClusterSecret6368BD0F" + }, + "TargetId": { + "Ref": "ClusterEB0386A7" + }, + "TargetType": "AWS::Redshift::Cluster" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterEB0386A7": { + "Type": "AWS::Redshift::Cluster", + "Properties": { + "ClusterType": "multi-node", + "DBName": "default_db", + "MasterUsername": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "ClusterSecret6368BD0F" + }, + ":SecretString:username::}}" + ] + ] + }, + "MasterUserPassword": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "ClusterSecret6368BD0F" + }, + ":SecretString:password::}}" + ] + ] + }, + "NodeType": "dc2.large", + "AllowVersionUpgrade": true, + "AutomatedSnapshotRetentionPeriod": 1, + "ClusterParameterGroupName": { + "Ref": "ParameterGroup5E32DECB" + }, + "ClusterSubnetGroupName": { + "Ref": "ClusterSubnetsDCFA5CB7" + }, + "Encrypted": true, + "NumberOfNodes": 2, + "PubliclyAccessible": false, + "VpcSecurityGroupIds": [ + { + "Fn::GetAtt": [ + "ClusterSecurityGroup0921994B", + "GroupId" + ] + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", + "Roles": [ + { + "Ref": "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterResourceProviderframeworkonEvent15BB3722": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671.zip" + }, + "Role": { + "Fn::GetAtt": [ + "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE", + "Arn" + ] + }, + "Description": "AWS CDK resource provider framework - onEvent (aws-cdk-redshift-cluster-update/Cluster/ResourceProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + } + } + }, + "Handler": "framework.onEvent", + "Runtime": "nodejs14.x", + "Timeout": 900 + }, + "DependsOn": [ + "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", + "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterRedshiftClusterRebooterCustomResource773361E1": { + "Type": "Custom::RedshiftClusterRebooter", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "ClusterResourceProviderframeworkonEvent15BB3722", + "Arn" + ] + }, + "ClusterId": { + "Ref": "ClusterEB0386A7" + }, + "ParameterGroupName": { + "Ref": "ParameterGroup5E32DECB" + }, + "ParametersString": "{\"enable_user_activity_logging\":\"false\",\"use_fips_ssl\":\"true\"}" + }, + "DependsOn": [ + "ClusterEB0386A7", + "ClusterResourceProviderframeworkonEvent15BB3722", + "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", + "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE", + "ClusterSecretAttachment769E6258", + "ClusterSecret6368BD0F", + "ClusterSecurityGroup0921994B", + "ClusterSubnetsDCFA5CB7", + "ParameterGroup5E32DECB" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "redshift:DescribeClusters", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "redshift:RebootCluster", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":redshift:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":cluster:", + { + "Ref": "ClusterEB0386A7" + } + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF", + "Roles": [ + { + "Ref": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139.zip" + }, + "Role": { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525", + "Arn" + ] + }, + "Handler": "index.handler", + "Runtime": "nodejs16.x", + "Timeout": 900 + }, + "DependsOn": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF", + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Outputs": { + "ExportsOutputRefClusterEB0386A796A0E3FE": { + "Value": { + "Ref": "ClusterEB0386A7" + }, + "Export": { + "Name": "aws-cdk-redshift-cluster-reboot-integ:ExportsOutputRefClusterEB0386A796A0E3FE" + } + }, + "ExportsOutputRefParameterGroup5E32DECBB33EA140": { + "Value": { + "Ref": "ParameterGroup5E32DECB" + }, + "Export": { + "Name": "aws-cdk-redshift-cluster-reboot-integ:ExportsOutputRefParameterGroup5E32DECBB33EA140" + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets.json b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets.json new file mode 100644 index 0000000000000..49b3216944ef6 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets.json @@ -0,0 +1,32 @@ +{ + "version": "21.0.0", + "files": { + "cc285c12352e5d673e6d5211dd6501a7b0ee8bddd523859315e7de7b6f8e1413": { + "source": { + "path": "asset.cc285c12352e5d673e6d5211dd6501a7b0ee8bddd523859315e7de7b6f8e1413.bundle", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "cc285c12352e5d673e6d5211dd6501a7b0ee8bddd523859315e7de7b6f8e1413.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "cc872b6636791e21375ffe5928596992198eeeb20fd5cfc55a9085d340b4cb24": { + "source": { + "path": "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "cc872b6636791e21375ffe5928596992198eeeb20fd5cfc55a9085d340b4cb24.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.template.json b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.template.json new file mode 100644 index 0000000000000..0c780bfaed04f --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.template.json @@ -0,0 +1,223 @@ +{ + "Resources": { + "AwsApiCallRedshiftdescribeClusters1": { + "Type": "Custom::DeployAssertSdkCallRedshiftdescribeClusters", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", + "Arn" + ] + }, + "service": "Redshift", + "api": "describeClusters", + "parameters": { + "ClusterIdentifier": { + "Fn::ImportValue": "aws-cdk-redshift-cluster-reboot-integ:ExportsOutputRefClusterEB0386A796A0E3FE" + } + }, + "flattenResponse": "false", + "salt": "1663270532954" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "AwsApiCallRedshiftdescribeClusters1AssertEqualsRedshiftdescribeClusters7634D4CC": { + "Type": "Custom::DeployAssertAssertEquals", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", + "Arn" + ] + }, + "actual": { + "Fn::GetAtt": [ + "AwsApiCallRedshiftdescribeClusters1", + "apiCallResponse" + ] + }, + "expected": { + "Fn::Join": [ + "", + [ + "{\"$ObjectLike\":{\"ParameterGroupName\":\"", + { + "Fn::ImportValue": "aws-cdk-redshift-cluster-reboot-integ:ExportsOutputRefParameterGroup5E32DECBB33EA140" + }, + "\",\"ParameterApplyStatus\":\"in-sync\"}}" + ] + ] + }, + "salt": "1663270532954" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ] + }, + "ManagedPolicyArns": [ + { + "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + } + ], + "Policies": [ + { + "PolicyName": "Inline", + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "redshift:DescribeClusters" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "redshift:DescribeClusterParameters" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + } + ] + } + } + ] + } + }, + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Runtime": "nodejs14.x", + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "cc285c12352e5d673e6d5211dd6501a7b0ee8bddd523859315e7de7b6f8e1413.zip" + }, + "Timeout": 120, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", + "Arn" + ] + } + } + }, + "AwsApiCallRedshiftdescribeClusterParameters1": { + "Type": "Custom::DeployAssertSdkCallRedshiftdescribeClusterParameters", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", + "Arn" + ] + }, + "service": "Redshift", + "api": "describeClusterParameters", + "parameters": { + "ParameterGroupName": { + "Fn::ImportValue": "aws-cdk-redshift-cluster-reboot-integ:ExportsOutputRefParameterGroup5E32DECBB33EA140" + } + }, + "flattenResponse": "false", + "salt": "1663270532954" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "AwsApiCallRedshiftdescribeClusterParameters1AssertEqualsRedshiftdescribeClusterParameters8AB3F568": { + "Type": "Custom::DeployAssertAssertEquals", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", + "Arn" + ] + }, + "actual": { + "Fn::GetAtt": [ + "AwsApiCallRedshiftdescribeClusterParameters1", + "apiCallResponse" + ] + }, + "expected": "{\"$ArrayWith\":[{\"result\":\"{\\\"$ObjectLike\\\":{\\\"ParameterName\\\":\\\"enable_user_activity_logging\\\",\\\"ParameterValue\\\":\\\"false\\\"}}\"},{\"result\":\"{\\\"$ObjectLike\\\":{\\\"ParameterName\\\":\\\"use_fips_ssl\\\",\\\"ParameterValue\\\":\\\"true\\\"}}\"}]}", + "salt": "1663270532954" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Outputs": { + "AssertionResultsAssertEqualsRedshiftdescribeClusters40c948a44d1ec8afa7d4c9c91028e79b": { + "Value": { + "Fn::GetAtt": [ + "AwsApiCallRedshiftdescribeClusters1AssertEqualsRedshiftdescribeClusters7634D4CC", + "data" + ] + } + }, + "AssertionResultsAssertEqualsRedshiftdescribeClusterParametersbf6470e1bedcd5ee147ac37ef100e38d": { + "Value": { + "Fn::GetAtt": [ + "AwsApiCallRedshiftdescribeClusterParameters1AssertEqualsRedshiftdescribeClusterParameters8AB3F568", + "data" + ] + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/cdk.out b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/cdk.out new file mode 100644 index 0000000000000..8ecc185e9dbee --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/cdk.out @@ -0,0 +1 @@ +{"version":"21.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/integ.json b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/integ.json new file mode 100644 index 0000000000000..ce760b7e44b28 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/integ.json @@ -0,0 +1,15 @@ +{ + "version": "21.0.0", + "testCases": { + "aws-cdk-redshift-reboot-test/DefaultTest": { + "stacks": [ + "aws-cdk-redshift-cluster-create", + "aws-cdk-redshift-cluster-update" + ], + "diffAssets": true, + "stackUpdateWorkflow": true, + "assertionStack": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert", + "assertionStackName": "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/manifest.json b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/manifest.json new file mode 100644 index 0000000000000..c22e6c57d50d8 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/manifest.json @@ -0,0 +1,456 @@ +{ + "version": "21.0.0", + "artifacts": { + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + }, + "aws-cdk-redshift-cluster-create.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "aws-cdk-redshift-cluster-create.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "aws-cdk-redshift-cluster-create": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "aws-cdk-redshift-cluster-create.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/42ff6c40ab2191a9f141b53cff77b4d1a253b7af577e2d0c9a196cdc4316ee2f.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "aws-cdk-redshift-cluster-create.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + }, + "stackName": "aws-cdk-redshift-cluster-reboot-integ" + }, + "dependencies": [ + "aws-cdk-redshift-cluster-create.assets" + ], + "metadata": { + "/aws-cdk-redshift-cluster-create/Vpc/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Vpc8378EB38" + } + ], + "/aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet1Subnet77A7FDC6" + } + ], + "/aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet1RouteTableAF4E5874" + } + ], + "/aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet1RouteTableAssociation502CBE55" + } + ], + "/aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet2Subnet85B013AD" + } + ], + "/aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet2RouteTable5127598D" + } + ], + "/aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet2RouteTableAssociation5013D70B" + } + ], + "/aws-cdk-redshift-cluster-create/ParameterGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ParameterGroup5E32DECB" + } + ], + "/aws-cdk-redshift-cluster-create/Cluster/Subnets/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterSubnetsDCFA5CB7" + } + ], + "/aws-cdk-redshift-cluster-create/Cluster/SecurityGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterSecurityGroup0921994B" + } + ], + "/aws-cdk-redshift-cluster-create/Cluster/Secret/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterSecret6368BD0F" + } + ], + "/aws-cdk-redshift-cluster-create/Cluster/Secret/Attachment/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterSecretAttachment769E6258" + } + ], + "/aws-cdk-redshift-cluster-create/Cluster/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterEB0386A7" + } + ], + "/aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" + } + ], + "/aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86" + } + ], + "/aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterResourceProviderframeworkonEvent15BB3722" + } + ], + "/aws-cdk-redshift-cluster-create/Cluster/RedshiftClusterRebooterCustomResource/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterRedshiftClusterRebooterCustomResource773361E1" + } + ], + "/aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" + } + ], + "/aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF" + } + ], + "/aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5" + } + ], + "/aws-cdk-redshift-cluster-create/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/aws-cdk-redshift-cluster-create/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "aws-cdk-redshift-cluster-create" + }, + "aws-cdk-redshift-cluster-update.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "aws-cdk-redshift-cluster-update.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "aws-cdk-redshift-cluster-update": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "aws-cdk-redshift-cluster-update.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/4062cab3dd20bc5e69e0a94b9151bea5b695c4d9c7db1766fe1d47cf14eb3a9f.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "aws-cdk-redshift-cluster-update.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + }, + "stackName": "aws-cdk-redshift-cluster-reboot-integ" + }, + "dependencies": [ + "aws-cdk-redshift-cluster-create", + "aws-cdk-redshift-cluster-update.assets" + ], + "metadata": { + "/aws-cdk-redshift-cluster-update/Vpc/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Vpc8378EB38" + } + ], + "/aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet1Subnet77A7FDC6" + } + ], + "/aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet1RouteTableAF4E5874" + } + ], + "/aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet1RouteTableAssociation502CBE55" + } + ], + "/aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet2Subnet85B013AD" + } + ], + "/aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet2RouteTable5127598D" + } + ], + "/aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet2RouteTableAssociation5013D70B" + } + ], + "/aws-cdk-redshift-cluster-update/ParameterGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ParameterGroup5E32DECB" + } + ], + "/aws-cdk-redshift-cluster-update/Cluster/Subnets/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterSubnetsDCFA5CB7" + } + ], + "/aws-cdk-redshift-cluster-update/Cluster/SecurityGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterSecurityGroup0921994B" + } + ], + "/aws-cdk-redshift-cluster-update/Cluster/Secret/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterSecret6368BD0F" + } + ], + "/aws-cdk-redshift-cluster-update/Cluster/Secret/Attachment/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterSecretAttachment769E6258" + } + ], + "/aws-cdk-redshift-cluster-update/Cluster/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterEB0386A7" + } + ], + "/aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" + } + ], + "/aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86" + } + ], + "/aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterResourceProviderframeworkonEvent15BB3722" + } + ], + "/aws-cdk-redshift-cluster-update/Cluster/RedshiftClusterRebooterCustomResource/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterRedshiftClusterRebooterCustomResource773361E1" + } + ], + "/aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" + } + ], + "/aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF" + } + ], + "/aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5" + } + ], + "/aws-cdk-redshift-cluster-update/Exports/Output{\"Ref\":\"ClusterEB0386A7\"}": [ + { + "type": "aws:cdk:logicalId", + "data": "ExportsOutputRefClusterEB0386A796A0E3FE" + } + ], + "/aws-cdk-redshift-cluster-update/Exports/Output{\"Ref\":\"ParameterGroup5E32DECB\"}": [ + { + "type": "aws:cdk:logicalId", + "data": "ExportsOutputRefParameterGroup5E32DECBB33EA140" + } + ], + "/aws-cdk-redshift-cluster-update/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/aws-cdk-redshift-cluster-update/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "aws-cdk-redshift-cluster-update" + }, + "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/cc872b6636791e21375ffe5928596992198eeeb20fd5cfc55a9085d340b4cb24.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "aws-cdk-redshift-cluster-update", + "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets" + ], + "metadata": { + "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1/Default/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "AwsApiCallRedshiftdescribeClusters1" + } + ], + "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1/AssertEqualsRedshiftdescribeClusters/Default/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "AwsApiCallRedshiftdescribeClusters1AssertEqualsRedshiftdescribeClusters7634D4CC" + } + ], + "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1/AssertEqualsRedshiftdescribeClusters/AssertionResults": [ + { + "type": "aws:cdk:logicalId", + "data": "AssertionResultsAssertEqualsRedshiftdescribeClusters40c948a44d1ec8afa7d4c9c91028e79b" + } + ], + "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role": [ + { + "type": "aws:cdk:logicalId", + "data": "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73" + } + ], + "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler": [ + { + "type": "aws:cdk:logicalId", + "data": "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F" + } + ], + "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1/Default/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "AwsApiCallRedshiftdescribeClusterParameters1" + } + ], + "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1/AssertEqualsRedshiftdescribeClusterParameters/Default/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "AwsApiCallRedshiftdescribeClusterParameters1AssertEqualsRedshiftdescribeClusterParameters8AB3F568" + } + ], + "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1/AssertEqualsRedshiftdescribeClusterParameters/AssertionResults": [ + { + "type": "aws:cdk:logicalId", + "data": "AssertionResultsAssertEqualsRedshiftdescribeClusterParametersbf6470e1bedcd5ee147ac37ef100e38d" + } + ], + "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/tree.json b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/tree.json new file mode 100644 index 0000000000000..e2e0e4e6ab95a --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/tree.json @@ -0,0 +1,2053 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.92" + } + }, + "aws-cdk-redshift-cluster-create": { + "id": "aws-cdk-redshift-cluster-create", + "path": "aws-cdk-redshift-cluster-create", + "children": { + "Vpc": { + "id": "Vpc", + "path": "aws-cdk-redshift-cluster-create/Vpc", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/Vpc/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPC", + "aws:cdk:cloudformation:props": { + "cidrBlock": "10.0.0.0/16", + "enableDnsHostnames": true, + "enableDnsSupport": true, + "instanceTenancy": "default", + "tags": [ + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-create/Vpc" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnVPC", + "version": "0.0.0" + } + }, + "foobarSubnet1": { + "id": "foobarSubnet1", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "Vpc8378EB38" + }, + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.0.0/17", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "foobar" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Isolated" + }, + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/Acl", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "Vpc8378EB38" + }, + "tags": [ + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VpcfoobarSubnet1RouteTableAF4E5874" + }, + "subnetId": { + "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "foobarSubnet2": { + "id": "foobarSubnet2", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "Vpc8378EB38" + }, + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.128.0/17", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "foobar" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Isolated" + }, + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/Acl", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "Vpc8378EB38" + }, + "tags": [ + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VpcfoobarSubnet2RouteTable5127598D" + }, + "subnetId": { + "Ref": "VpcfoobarSubnet2Subnet85B013AD" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.Vpc", + "version": "0.0.0" + } + }, + "ParameterGroup": { + "id": "ParameterGroup", + "path": "aws-cdk-redshift-cluster-create/ParameterGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/ParameterGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Redshift::ClusterParameterGroup", + "aws:cdk:cloudformation:props": { + "description": "Cluster parameter group for family redshift-1.0", + "parameterGroupFamily": "redshift-1.0", + "parameters": [ + { + "parameterName": "enable_user_activity_logging", + "parameterValue": "true" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.CfnClusterParameterGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.ClusterParameterGroup", + "version": "0.0.0" + } + }, + "Cluster": { + "id": "Cluster", + "path": "aws-cdk-redshift-cluster-create/Cluster", + "children": { + "Subnets": { + "id": "Subnets", + "path": "aws-cdk-redshift-cluster-create/Cluster/Subnets", + "children": { + "Default": { + "id": "Default", + "path": "aws-cdk-redshift-cluster-create/Cluster/Subnets/Default", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Redshift::ClusterSubnetGroup", + "aws:cdk:cloudformation:props": { + "description": "Subnets for Cluster Redshift cluster", + "subnetIds": [ + { + "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" + }, + { + "Ref": "VpcfoobarSubnet2Subnet85B013AD" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.CfnClusterSubnetGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.ClusterSubnetGroup", + "version": "0.0.0" + } + }, + "SecurityGroup": { + "id": "SecurityGroup", + "path": "aws-cdk-redshift-cluster-create/Cluster/SecurityGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/Cluster/SecurityGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "Redshift security group", + "securityGroupEgress": [ + { + "cidrIp": "0.0.0.0/0", + "description": "Allow all outbound traffic by default", + "ipProtocol": "-1" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.SecurityGroup", + "version": "0.0.0" + } + }, + "Secret": { + "id": "Secret", + "path": "aws-cdk-redshift-cluster-create/Cluster/Secret", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/Cluster/Secret/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::Secret", + "aws:cdk:cloudformation:props": { + "generateSecretString": { + "passwordLength": 30, + "secretStringTemplate": "{\"username\":\"admin\"}", + "generateStringKey": "password", + "excludeCharacters": "\"@/\\ '" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.CfnSecret", + "version": "0.0.0" + } + }, + "Attachment": { + "id": "Attachment", + "path": "aws-cdk-redshift-cluster-create/Cluster/Secret/Attachment", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/Cluster/Secret/Attachment/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::SecretTargetAttachment", + "aws:cdk:cloudformation:props": { + "secretId": { + "Ref": "ClusterSecret6368BD0F" + }, + "targetId": { + "Ref": "ClusterEB0386A7" + }, + "targetType": "AWS::Redshift::Cluster" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.CfnSecretTargetAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.SecretTargetAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.DatabaseSecret", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/Cluster/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Redshift::Cluster", + "aws:cdk:cloudformation:props": { + "clusterType": "multi-node", + "dbName": "default_db", + "masterUsername": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "ClusterSecret6368BD0F" + }, + ":SecretString:username::}}" + ] + ] + }, + "masterUserPassword": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "ClusterSecret6368BD0F" + }, + ":SecretString:password::}}" + ] + ] + }, + "nodeType": "dc2.large", + "allowVersionUpgrade": true, + "automatedSnapshotRetentionPeriod": 1, + "clusterParameterGroupName": { + "Ref": "ParameterGroup5E32DECB" + }, + "clusterSubnetGroupName": { + "Ref": "ClusterSubnetsDCFA5CB7" + }, + "encrypted": true, + "numberOfNodes": 2, + "publiclyAccessible": false, + "vpcSecurityGroupIds": [ + { + "Fn::GetAtt": [ + "ClusterSecurityGroup0921994B", + "GroupId" + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.CfnCluster", + "version": "0.0.0" + } + }, + "RedshiftClusterRebooterFunction": { + "id": "RedshiftClusterRebooterFunction", + "path": "aws-cdk-redshift-cluster-create/Cluster/RedshiftClusterRebooterFunction", + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.SingletonFunction", + "version": "0.0.0" + } + }, + "ResourceProvider": { + "id": "ResourceProvider", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider", + "children": { + "framework-onEvent": { + "id": "framework-onEvent", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/ServiceRole", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "policyName": "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", + "roles": [ + { + "Ref": "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3-assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671.zip" + }, + "role": { + "Fn::GetAtt": [ + "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE", + "Arn" + ] + }, + "description": "AWS CDK resource provider framework - onEvent (aws-cdk-redshift-cluster-create/Cluster/ResourceProvider)", + "environment": { + "variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + } + } + }, + "handler": "framework.onEvent", + "runtime": "nodejs14.x", + "timeout": 900 + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.Function", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/custom-resources.Provider", + "version": "0.0.0" + } + }, + "RedshiftClusterRebooterCustomResource": { + "id": "RedshiftClusterRebooterCustomResource", + "path": "aws-cdk-redshift-cluster-create/Cluster/RedshiftClusterRebooterCustomResource", + "children": { + "Default": { + "id": "Default", + "path": "aws-cdk-redshift-cluster-create/Cluster/RedshiftClusterRebooterCustomResource/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.Cluster", + "version": "0.0.0" + } + }, + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2": { + "id": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "redshift:DescribeClusters", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "redshift:RebootCluster", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":redshift:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":cluster:", + { + "Ref": "ClusterEB0386A7" + } + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "policyName": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF", + "roles": [ + { + "Ref": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3-assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139.zip" + }, + "role": { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525", + "Arn" + ] + }, + "handler": "index.handler", + "runtime": "nodejs16.x", + "timeout": 900 + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.Function", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "aws-cdk-redshift-cluster-update": { + "id": "aws-cdk-redshift-cluster-update", + "path": "aws-cdk-redshift-cluster-update", + "children": { + "Vpc": { + "id": "Vpc", + "path": "aws-cdk-redshift-cluster-update/Vpc", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/Vpc/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPC", + "aws:cdk:cloudformation:props": { + "cidrBlock": "10.0.0.0/16", + "enableDnsHostnames": true, + "enableDnsSupport": true, + "instanceTenancy": "default", + "tags": [ + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-update/Vpc" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnVPC", + "version": "0.0.0" + } + }, + "foobarSubnet1": { + "id": "foobarSubnet1", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "Vpc8378EB38" + }, + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.0.0/17", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "foobar" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Isolated" + }, + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/Acl", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "Vpc8378EB38" + }, + "tags": [ + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VpcfoobarSubnet1RouteTableAF4E5874" + }, + "subnetId": { + "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "foobarSubnet2": { + "id": "foobarSubnet2", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "Vpc8378EB38" + }, + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.128.0/17", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "foobar" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Isolated" + }, + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/Acl", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "Vpc8378EB38" + }, + "tags": [ + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VpcfoobarSubnet2RouteTable5127598D" + }, + "subnetId": { + "Ref": "VpcfoobarSubnet2Subnet85B013AD" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.Vpc", + "version": "0.0.0" + } + }, + "ParameterGroup": { + "id": "ParameterGroup", + "path": "aws-cdk-redshift-cluster-update/ParameterGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/ParameterGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Redshift::ClusterParameterGroup", + "aws:cdk:cloudformation:props": { + "description": "Cluster parameter group for family redshift-1.0", + "parameterGroupFamily": "redshift-1.0", + "parameters": [ + { + "parameterName": "enable_user_activity_logging", + "parameterValue": "false" + }, + { + "parameterName": "use_fips_ssl", + "parameterValue": "true" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.CfnClusterParameterGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.ClusterParameterGroup", + "version": "0.0.0" + } + }, + "Cluster": { + "id": "Cluster", + "path": "aws-cdk-redshift-cluster-update/Cluster", + "children": { + "Subnets": { + "id": "Subnets", + "path": "aws-cdk-redshift-cluster-update/Cluster/Subnets", + "children": { + "Default": { + "id": "Default", + "path": "aws-cdk-redshift-cluster-update/Cluster/Subnets/Default", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Redshift::ClusterSubnetGroup", + "aws:cdk:cloudformation:props": { + "description": "Subnets for Cluster Redshift cluster", + "subnetIds": [ + { + "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" + }, + { + "Ref": "VpcfoobarSubnet2Subnet85B013AD" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.CfnClusterSubnetGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.ClusterSubnetGroup", + "version": "0.0.0" + } + }, + "SecurityGroup": { + "id": "SecurityGroup", + "path": "aws-cdk-redshift-cluster-update/Cluster/SecurityGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/Cluster/SecurityGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "Redshift security group", + "securityGroupEgress": [ + { + "cidrIp": "0.0.0.0/0", + "description": "Allow all outbound traffic by default", + "ipProtocol": "-1" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.SecurityGroup", + "version": "0.0.0" + } + }, + "Secret": { + "id": "Secret", + "path": "aws-cdk-redshift-cluster-update/Cluster/Secret", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/Cluster/Secret/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::Secret", + "aws:cdk:cloudformation:props": { + "generateSecretString": { + "passwordLength": 30, + "secretStringTemplate": "{\"username\":\"admin\"}", + "generateStringKey": "password", + "excludeCharacters": "\"@/\\ '" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.CfnSecret", + "version": "0.0.0" + } + }, + "Attachment": { + "id": "Attachment", + "path": "aws-cdk-redshift-cluster-update/Cluster/Secret/Attachment", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/Cluster/Secret/Attachment/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::SecretTargetAttachment", + "aws:cdk:cloudformation:props": { + "secretId": { + "Ref": "ClusterSecret6368BD0F" + }, + "targetId": { + "Ref": "ClusterEB0386A7" + }, + "targetType": "AWS::Redshift::Cluster" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.CfnSecretTargetAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.SecretTargetAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.DatabaseSecret", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/Cluster/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Redshift::Cluster", + "aws:cdk:cloudformation:props": { + "clusterType": "multi-node", + "dbName": "default_db", + "masterUsername": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "ClusterSecret6368BD0F" + }, + ":SecretString:username::}}" + ] + ] + }, + "masterUserPassword": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "ClusterSecret6368BD0F" + }, + ":SecretString:password::}}" + ] + ] + }, + "nodeType": "dc2.large", + "allowVersionUpgrade": true, + "automatedSnapshotRetentionPeriod": 1, + "clusterParameterGroupName": { + "Ref": "ParameterGroup5E32DECB" + }, + "clusterSubnetGroupName": { + "Ref": "ClusterSubnetsDCFA5CB7" + }, + "encrypted": true, + "numberOfNodes": 2, + "publiclyAccessible": false, + "vpcSecurityGroupIds": [ + { + "Fn::GetAtt": [ + "ClusterSecurityGroup0921994B", + "GroupId" + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.CfnCluster", + "version": "0.0.0" + } + }, + "RedshiftClusterRebooterFunction": { + "id": "RedshiftClusterRebooterFunction", + "path": "aws-cdk-redshift-cluster-update/Cluster/RedshiftClusterRebooterFunction", + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.SingletonFunction", + "version": "0.0.0" + } + }, + "ResourceProvider": { + "id": "ResourceProvider", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider", + "children": { + "framework-onEvent": { + "id": "framework-onEvent", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/ServiceRole", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "policyName": "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", + "roles": [ + { + "Ref": "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3-assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671.zip" + }, + "role": { + "Fn::GetAtt": [ + "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE", + "Arn" + ] + }, + "description": "AWS CDK resource provider framework - onEvent (aws-cdk-redshift-cluster-update/Cluster/ResourceProvider)", + "environment": { + "variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + } + } + }, + "handler": "framework.onEvent", + "runtime": "nodejs14.x", + "timeout": 900 + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.Function", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/custom-resources.Provider", + "version": "0.0.0" + } + }, + "RedshiftClusterRebooterCustomResource": { + "id": "RedshiftClusterRebooterCustomResource", + "path": "aws-cdk-redshift-cluster-update/Cluster/RedshiftClusterRebooterCustomResource", + "children": { + "Default": { + "id": "Default", + "path": "aws-cdk-redshift-cluster-update/Cluster/RedshiftClusterRebooterCustomResource/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.Cluster", + "version": "0.0.0" + } + }, + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2": { + "id": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "redshift:DescribeClusters", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "redshift:RebootCluster", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":redshift:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":cluster:", + { + "Ref": "ClusterEB0386A7" + } + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "policyName": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF", + "roles": [ + { + "Ref": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3-assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139.zip" + }, + "role": { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525", + "Arn" + ] + }, + "handler": "index.handler", + "runtime": "nodejs16.x", + "timeout": 900 + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.Function", + "version": "0.0.0" + } + }, + "Exports": { + "id": "Exports", + "path": "aws-cdk-redshift-cluster-update/Exports", + "children": { + "Output{\"Ref\":\"ClusterEB0386A7\"}": { + "id": "Output{\"Ref\":\"ClusterEB0386A7\"}", + "path": "aws-cdk-redshift-cluster-update/Exports/Output{\"Ref\":\"ClusterEB0386A7\"}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "Output{\"Ref\":\"ParameterGroup5E32DECB\"}": { + "id": "Output{\"Ref\":\"ParameterGroup5E32DECB\"}", + "path": "aws-cdk-redshift-cluster-update/Exports/Output{\"Ref\":\"ParameterGroup5E32DECB\"}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.92" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "aws-cdk-redshift-reboot-test": { + "id": "aws-cdk-redshift-reboot-test", + "path": "aws-cdk-redshift-reboot-test", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "aws-cdk-redshift-reboot-test/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.92" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert", + "children": { + "AwsApiCallRedshiftdescribeClusters1": { + "id": "AwsApiCallRedshiftdescribeClusters1", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1", + "children": { + "SdkProvider": { + "id": "SdkProvider", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1/SdkProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1/SdkProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.92" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", + "version": "0.0.0" + } + }, + "Default": { + "id": "Default", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1/Default", + "children": { + "Default": { + "id": "Default", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1/Default/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + }, + "AssertEqualsRedshiftdescribeClusters": { + "id": "AssertEqualsRedshiftdescribeClusters", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1/AssertEqualsRedshiftdescribeClusters", + "children": { + "AssertionProvider": { + "id": "AssertionProvider", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1/AssertEqualsRedshiftdescribeClusters/AssertionProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1/AssertEqualsRedshiftdescribeClusters/AssertionProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.92" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", + "version": "0.0.0" + } + }, + "Default": { + "id": "Default", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1/AssertEqualsRedshiftdescribeClusters/Default", + "children": { + "Default": { + "id": "Default", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1/AssertEqualsRedshiftdescribeClusters/Default/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + }, + "AssertionResults": { + "id": "AssertionResults", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1/AssertEqualsRedshiftdescribeClusters/AssertionResults", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.EqualsAssertion", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AwsApiCall", + "version": "0.0.0" + } + }, + "SingletonFunction1488541a7b23466481b69b4408076b81": { + "id": "SingletonFunction1488541a7b23466481b69b4408076b81", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81", + "children": { + "Staging": { + "id": "Staging", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Staging", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "Role": { + "id": "Role", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + }, + "Handler": { + "id": "Handler", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.92" + } + }, + "AwsApiCallRedshiftdescribeClusterParameters1": { + "id": "AwsApiCallRedshiftdescribeClusterParameters1", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1", + "children": { + "SdkProvider": { + "id": "SdkProvider", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1/SdkProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1/SdkProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.92" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", + "version": "0.0.0" + } + }, + "Default": { + "id": "Default", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1/Default", + "children": { + "Default": { + "id": "Default", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1/Default/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + }, + "AssertEqualsRedshiftdescribeClusterParameters": { + "id": "AssertEqualsRedshiftdescribeClusterParameters", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1/AssertEqualsRedshiftdescribeClusterParameters", + "children": { + "AssertionProvider": { + "id": "AssertionProvider", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1/AssertEqualsRedshiftdescribeClusterParameters/AssertionProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1/AssertEqualsRedshiftdescribeClusterParameters/AssertionProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.92" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", + "version": "0.0.0" + } + }, + "Default": { + "id": "Default", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1/AssertEqualsRedshiftdescribeClusterParameters/Default", + "children": { + "Default": { + "id": "Default", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1/AssertEqualsRedshiftdescribeClusterParameters/Default/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + }, + "AssertionResults": { + "id": "AssertionResults", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1/AssertEqualsRedshiftdescribeClusterParameters/AssertionResults", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.EqualsAssertion", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AwsApiCall", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cluster.test.ts b/packages/@aws-cdk/aws-redshift/test/cluster.test.ts index 9d0c13dd23412..6267ee644cb59 100644 --- a/packages/@aws-cdk/aws-redshift/test/cluster.test.ts +++ b/packages/@aws-cdk/aws-redshift/test/cluster.test.ts @@ -629,7 +629,7 @@ describe('reboot for Parameter Changes', () => { .toThrowError(/Cannot enable reboot for parameter changes/); }); - test('cluster with imported parameter group', () => { + test('cluster with parameter group', () => { // Given const cluster = new Cluster(stack, 'Redshift', { masterUser: { @@ -668,8 +668,33 @@ describe('reboot for Parameter Changes', () => { }); }); + test('Custom resource ParametersString property updates', () => { + // Given + const cluster = new Cluster(stack, 'Redshift', { + masterUser: { + masterUsername: 'admin', + }, + vpc, + }); + cluster.addToParameterGroup('foo', 'bar'); + cluster.enableRebootForParameterChanges(); + + // WHEN + cluster.addToParameterGroup('lorem', 'ipsum'); - test('cluster with parameter group', () => { + //THEN + const template = Template.fromStack(stack); + template.hasResourceProperties('Custom::RedshiftClusterRebooter', { + ParametersString: JSON.stringify( + { + foo: 'bar', + lorem: 'ipsum', + }, + ), + }); + }); + + test('cluster with imported parameter group', () => { // Given const cluster = new Cluster(stack, 'Redshift', { masterUser: { diff --git a/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.ts b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.ts new file mode 100644 index 0000000000000..36558948316a7 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.ts @@ -0,0 +1,105 @@ +import * as ec2 from '@aws-cdk/aws-ec2'; +import * as cdk from '@aws-cdk/core'; +import * as integ from '@aws-cdk/integ-tests'; +import * as constructs from 'constructs'; +import * as redshift from '../lib'; + +const app = new cdk.App(); + + +interface RedshiftRebootStackProps extends cdk.StackProps { + parameterGroupParams: { [name: string]: string }, +} + +const requiredStackName: Partial = { + stackName: 'aws-cdk-redshift-cluster-reboot-integ', +}; + +class RedshiftRebootStack extends cdk.Stack { + + readonly cluster: redshift.Cluster; + readonly parameterGroup: redshift.ClusterParameterGroup; + + constructor(scope: constructs.Construct, id: string, props: RedshiftRebootStackProps) { + props = { ...props, ...requiredStackName }; + super(scope, id, props); + const vpc = new ec2.Vpc(this, 'Vpc', { + subnetConfiguration: [{ + subnetType: ec2.SubnetType.PRIVATE_ISOLATED, + name: 'foobar', + }], + }); + this.parameterGroup = new redshift.ClusterParameterGroup(this, 'ParameterGroup', { + parameters: props.parameterGroupParams, + }); + this.cluster = new redshift.Cluster(this, 'Cluster', { + vpc: vpc, + vpcSubnets: { + subnetType: ec2.SubnetType.PRIVATE_ISOLATED, + }, + masterUser: { + masterUsername: 'admin', + }, + parameterGroup: this.parameterGroup, + rebootForParameterChanges: true, + }); + } +} + +const createStack = new RedshiftRebootStack(app, 'aws-cdk-redshift-cluster-create', { + parameterGroupParams: { enable_user_activity_logging: 'true' }, +}); + +const updateStack = new RedshiftRebootStack(app, 'aws-cdk-redshift-cluster-update', { + parameterGroupParams: { enable_user_activity_logging: 'false', use_fips_ssl: 'true' }, +}); + +updateStack.addDependency(createStack); +const stacks = [createStack, updateStack]; +stacks.forEach(s => { + cdk.Aspects.of(s).add({ + visit(node: constructs.IConstruct) { + if (cdk.CfnResource.isCfnResource(node)) { + node.applyRemovalPolicy(cdk.RemovalPolicy.DESTROY); + } + }, + }); +}); + +const test = new integ.IntegTest(app, 'aws-cdk-redshift-reboot-test', { + testCases: stacks, + stackUpdateWorkflow: true, + diffAssets: true, +}); + +const describeCluster = test.assertions.awsApiCall('Redshift', 'describeClusters', { + ClusterIdentifier: updateStack.cluster.clusterName, +}); + +describeCluster.expect(integ.ExpectedResult.objectLike( + { + ParameterGroupName: updateStack.parameterGroup.clusterParameterGroupName, + ParameterApplyStatus: 'in-sync', + }, +)); + +const describeParams = test.assertions.awsApiCall('Redshift', 'describeClusterParameters', { + ParameterGroupName: updateStack.parameterGroup.clusterParameterGroupName, +}); + +describeParams.expect(integ.ExpectedResult.arrayWith([ + integ.ExpectedResult.objectLike( + { + ParameterName: 'enable_user_activity_logging', + ParameterValue: 'false', + }, + ), + integ.ExpectedResult.objectLike( + { + ParameterName: 'use_fips_ssl', + ParameterValue: 'true', + }, + ), +])); + +app.synth(); From 63400f6507d148e8291a251e51bd17b746cd83c9 Mon Sep 17 00:00:00 2001 From: Arun Donti Date: Mon, 10 Oct 2022 13:45:38 -0400 Subject: [PATCH 04/15] fix: allow for enabling the reboot feature before the parameter group is creted --- packages/@aws-cdk/aws-redshift/lib/cluster.ts | 24 ++++++--- .../aws-redshift/test/cluster.test.ts | 52 ++++++++++++------- 2 files changed, 50 insertions(+), 26 deletions(-) diff --git a/packages/@aws-cdk/aws-redshift/lib/cluster.ts b/packages/@aws-cdk/aws-redshift/lib/cluster.ts index a4f186606c085..912522bb83da7 100644 --- a/packages/@aws-cdk/aws-redshift/lib/cluster.ts +++ b/packages/@aws-cdk/aws-redshift/lib/cluster.ts @@ -673,12 +673,6 @@ export class Cluster extends ClusterBase { * Enables automatic cluster rebooting when changes to the cluster's parameter group require a restart to apply. */ public enableRebootForParameterChanges(): void { - if (!this.parameterGroup) { - throw new Error('Cannot enable reboot for parameter changes when there is no associated ClusterParameterGroup.'); - } - if (!(this.parameterGroup instanceof ClusterParameterGroup)) { - throw new Error('Cannot enable reboot for parameter changes when using an imported parameter group.'); - } if (!this.rebootForParameterChangesEnabled) { this.rebootForParameterChangesEnabled = true; const rebootFunction = new lambda.SingletonFunction(this, 'RedshiftClusterRebooterFunction', { @@ -711,7 +705,14 @@ export class Cluster extends ClusterBase { serviceToken: provider.serviceToken, properties: { ClusterId: this.clusterName, - ParameterGroupName: this.parameterGroup.clusterParameterGroupName, + ParameterGroupName: Lazy.string({ + produce: () => { + if (!this.parameterGroup) { + throw new Error('Cannot enable reboot for parameter changes when there is no associated ClusterParameterGroup.'); + } + return this.parameterGroup.clusterParameterGroupName; + }, + }), ParametersString: Lazy.string({ produce: () => { if (!(this.parameterGroup instanceof ClusterParameterGroup)) { @@ -722,7 +723,14 @@ export class Cluster extends ClusterBase { }), }, }); - customResource.node.addDependency(this, this.parameterGroup); + Lazy.any({ + produce: () => { + if (!this.parameterGroup) { + throw new Error('Cannot enable reboot for parameter changes when there is no associated ClusterParameterGroup.'); + } + customResource.node.addDependency(this, this.parameterGroup); + }, + }); } } } diff --git a/packages/@aws-cdk/aws-redshift/test/cluster.test.ts b/packages/@aws-cdk/aws-redshift/test/cluster.test.ts index 6267ee644cb59..917f3a04645f7 100644 --- a/packages/@aws-cdk/aws-redshift/test/cluster.test.ts +++ b/packages/@aws-cdk/aws-redshift/test/cluster.test.ts @@ -614,7 +614,7 @@ test('elastic ip address', () => { }); describe('reboot for Parameter Changes', () => { - test('cluster without parameter group', () => { + test('throw error for cluster without parameter group', () => { // Given const cluster = new Cluster(stack, 'Redshift', { masterUser: { @@ -622,13 +622,45 @@ describe('reboot for Parameter Changes', () => { }, vpc, }); + cluster.enableRebootForParameterChanges(); + // WHEN + expect(() => Template.fromStack(stack)) + // THEN + .toThrowError(/Cannot enable reboot for parameter changes/); + }); + test('throw error for cluster with imported parameter group', () => { + // Given + const cluster = new Cluster(stack, 'Redshift', { + masterUser: { + masterUsername: 'admin', + }, + vpc, + parameterGroup: ClusterParameterGroup.fromClusterParameterGroupName(stack, 'foo', 'bar'), + }); + cluster.enableRebootForParameterChanges(); // WHEN - expect(() => cluster.enableRebootForParameterChanges()) + expect(() => Template.fromStack(stack)) // THEN .toThrowError(/Cannot enable reboot for parameter changes/); }); + test('not throw error when parameter group is created after enabling reboots', () => { + // Given + const cluster = new Cluster(stack, 'Redshift', { + masterUser: { + masterUsername: 'admin', + }, + vpc, + rebootForParameterChanges: true, + }); + cluster.addToParameterGroup('foo', 'bar'); + // WHEN + expect(() => Template.fromStack(stack)) + // THEN + .not.toThrowError(/Cannot enable reboot for parameter changes/); + }); + test('cluster with parameter group', () => { // Given const cluster = new Cluster(stack, 'Redshift', { @@ -694,22 +726,6 @@ describe('reboot for Parameter Changes', () => { }); }); - test('cluster with imported parameter group', () => { - // Given - const cluster = new Cluster(stack, 'Redshift', { - masterUser: { - masterUsername: 'admin', - }, - vpc, - parameterGroup: ClusterParameterGroup.fromClusterParameterGroupName(stack, 'foo', 'bar'), - }); - - // WHEN - expect(() => cluster.enableRebootForParameterChanges()) - // THEN - .toThrowError(/Cannot enable reboot for parameter changes/); - }); - }); function testStack() { From a5d1ee5680d503f03be55490b399cbffa80cfef5 Mon Sep 17 00:00:00 2001 From: Arun Donti Date: Mon, 10 Oct 2022 14:05:47 -0400 Subject: [PATCH 05/15] test: comment out assertions --- .../index.d.ts | 1 + .../index.js | 56 + .../index.ts | 53 + .../cfn-response.js | 83 + .../consts.js | 10 + .../framework.js | 168 ++ .../outbound.js | 45 + .../util.js | 17 + ...ws-cdk-redshift-cluster-create.assets.json | 45 + ...-cdk-redshift-cluster-create.template.json | 553 +++++ ...ws-cdk-redshift-cluster-update.assets.json | 45 + ...-cdk-redshift-cluster-update.template.json | 557 +++++ ...efaultTestDeployAssert1AE11B34.assets.json | 19 + ...aultTestDeployAssert1AE11B34.template.json | 36 + .../cluster-reboot.integ.snapshot/cdk.out | 1 + .../cluster-reboot.integ.snapshot/integ.json | 15 + .../manifest.json | 395 ++++ .../cluster-reboot.integ.snapshot/tree.json | 1791 +++++++++++++++++ .../aws-redshift/test/integ.cluster-reboot.ts | 61 +- 19 files changed, 3921 insertions(+), 30 deletions(-) create mode 100644 packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e/index.d.ts create mode 100644 packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e/index.js create mode 100644 packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e/index.ts create mode 100644 packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/cfn-response.js create mode 100644 packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/consts.js create mode 100644 packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/framework.js create mode 100644 packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/outbound.js create mode 100644 packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/util.js create mode 100644 packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-create.assets.json create mode 100644 packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-create.template.json create mode 100644 packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-update.assets.json create mode 100644 packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-update.template.json create mode 100644 packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets.json create mode 100644 packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.template.json create mode 100644 packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/cdk.out create mode 100644 packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/integ.json create mode 100644 packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/manifest.json create mode 100644 packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/tree.json diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e/index.d.ts b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e/index.d.ts new file mode 100644 index 0000000000000..3554dc94d4617 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e/index.d.ts @@ -0,0 +1 @@ +export declare function handler(event: AWSLambda.CloudFormationCustomResourceEvent): Promise; diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e/index.js b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e/index.js new file mode 100644 index 0000000000000..1113eac7f709c --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e/index.js @@ -0,0 +1,56 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.handler = void 0; +// eslint-disable-next-line import/no-extraneous-dependencies +const aws_sdk_1 = require("aws-sdk"); +const redshift = new aws_sdk_1.Redshift(); +async function handler(event) { + if (event.RequestType !== 'Delete') { + return rebootClusterIfRequired(event.ResourceProperties?.ClusterId, event.ResourceProperties?.ParameterGroupName); + } + else { + return; + } +} +exports.handler = handler; +async function rebootClusterIfRequired(clusterId, parameterGroupName) { + return executeActionForStatus(await getApplyStatus()); + // https://docs.aws.amazon.com/redshift/latest/APIReference/API_ClusterParameterStatus.html + async function executeActionForStatus(status, retryDurationMs) { + await sleep(retryDurationMs ?? 0); + if (['pending-reboot', 'apply-deferred', 'apply-error', 'unknown-error'].includes(status)) { + try { + await redshift.rebootCluster({ ClusterIdentifier: clusterId }).promise(); + } + catch (err) { + if (err.code === 'InvalidClusterState') { + return await executeActionForStatus(status, 30000); + } + else { + throw err; + } + } + return; + } + else if (['applying', 'retry'].includes(status)) { + return executeActionForStatus(await getApplyStatus(), 30000); + } + return; + } + async function getApplyStatus() { + const clusterDetails = await redshift.describeClusters({ ClusterIdentifier: clusterId }).promise(); + if (clusterDetails.Clusters?.[0].ClusterParameterGroups === undefined) { + throw new Error(`Unable to find any Parameter Groups associated with ClusterId "${clusterId}".`); + } + for (const group of clusterDetails.Clusters?.[0].ClusterParameterGroups) { + if (group.ParameterGroupName === parameterGroupName) { + return group.ParameterApplyStatus ?? 'retry'; + } + } + throw new Error(`Unable to find Parameter Group named "${parameterGroupName}" associated with ClusterId "${clusterId}".`); + } +} +function sleep(ms) { + return new Promise(resolve => setTimeout(resolve, ms)); +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSw2REFBNkQ7QUFDN0QscUNBQW1DO0FBRW5DLE1BQU0sUUFBUSxHQUFHLElBQUksa0JBQVEsRUFBRSxDQUFDO0FBRXpCLEtBQUssVUFBVSxPQUFPLENBQUMsS0FBa0Q7SUFDOUUsSUFBSSxLQUFLLENBQUMsV0FBVyxLQUFLLFFBQVEsRUFBRTtRQUNsQyxPQUFPLHVCQUF1QixDQUFDLEtBQUssQ0FBQyxrQkFBa0IsRUFBRSxTQUFTLEVBQUUsS0FBSyxDQUFDLGtCQUFrQixFQUFFLGtCQUFrQixDQUFDLENBQUM7S0FDbkg7U0FBTTtRQUNMLE9BQU87S0FDUjtBQUNILENBQUM7QUFORCwwQkFNQztBQUVELEtBQUssVUFBVSx1QkFBdUIsQ0FBQyxTQUFpQixFQUFFLGtCQUEwQjtJQUNsRixPQUFPLHNCQUFzQixDQUFDLE1BQU0sY0FBYyxFQUFFLENBQUMsQ0F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XJuIGdyb3VwLlBhcmFtZXRlckFwcGx5U3RhdHVzID8/ICdyZXRyeSc7XG4gICAgICB9XG4gICAgfVxuICAgIHRocm93IG5ldyBFcnJvcihgVW5hYmxlIHRvIGZpbmQgUGFyYW1ldGVyIEdyb3VwIG5hbWVkIFwiJHtwYXJhbWV0ZXJHcm91cE5hbWV9XCIgYXNzb2NpYXRlZCB3aXRoIENsdXN0ZXJJZCBcIiR7Y2x1c3RlcklkfVwiLmApO1xuICB9XG59XG5cbmZ1bmN0aW9uIHNsZWVwKG1zOiBudW1iZXIpIHtcbiAgcmV0dXJuIG5ldyBQcm9taXNlKHJlc29sdmUgPT4gc2V0VGltZW91dChyZXNvbHZlLCBtcykpO1xufSJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e/index.ts b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e/index.ts new file mode 100644 index 0000000000000..f69314783b600 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e/index.ts @@ -0,0 +1,53 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { Redshift } from 'aws-sdk'; + +const redshift = new Redshift(); + +export async function handler(event: AWSLambda.CloudFormationCustomResourceEvent): Promise { + if (event.RequestType !== 'Delete') { + return rebootClusterIfRequired(event.ResourceProperties?.ClusterId, event.ResourceProperties?.ParameterGroupName); + } else { + return; + } +} + +async function rebootClusterIfRequired(clusterId: string, parameterGroupName: string): Promise { + return executeActionForStatus(await getApplyStatus()); + + // https://docs.aws.amazon.com/redshift/latest/APIReference/API_ClusterParameterStatus.html + async function executeActionForStatus(status: string, retryDurationMs?: number): Promise { + await sleep(retryDurationMs ?? 0); + if (['pending-reboot', 'apply-deferred', 'apply-error', 'unknown-error'].includes(status)) { + try { + await redshift.rebootCluster({ ClusterIdentifier: clusterId }).promise(); + } catch (err) { + if ((err).code === 'InvalidClusterState') { + return await executeActionForStatus(status, 30000); + } else { + throw err; + } + } + return; + } else if (['applying', 'retry'].includes(status)) { + return executeActionForStatus(await getApplyStatus(), 30000); + } + return; + } + + async function getApplyStatus(): Promise { + const clusterDetails = await redshift.describeClusters({ ClusterIdentifier: clusterId }).promise(); + if (clusterDetails.Clusters?.[0].ClusterParameterGroups === undefined) { + throw new Error(`Unable to find any Parameter Groups associated with ClusterId "${clusterId}".`); + } + for (const group of clusterDetails.Clusters?.[0].ClusterParameterGroups) { + if (group.ParameterGroupName === parameterGroupName) { + return group.ParameterApplyStatus ?? 'retry'; + } + } + throw new Error(`Unable to find Parameter Group named "${parameterGroupName}" associated with ClusterId "${clusterId}".`); + } +} + +function sleep(ms: number) { + return new Promise(resolve => setTimeout(resolve, ms)); +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/cfn-response.js b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/cfn-response.js new file mode 100644 index 0000000000000..6319e06391def --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/cfn-response.js @@ -0,0 +1,83 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Retry = exports.safeHandler = exports.includeStackTraces = exports.submitResponse = exports.MISSING_PHYSICAL_ID_MARKER = exports.CREATE_FAILED_PHYSICAL_ID_MARKER = void 0; +/* eslint-disable max-len */ +/* eslint-disable no-console */ +const url = require("url"); +const outbound_1 = require("./outbound"); +const util_1 = require("./util"); +exports.CREATE_FAILED_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::CREATE_FAILED'; +exports.MISSING_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::MISSING_PHYSICAL_ID'; +async function submitResponse(status, event, options = {}) { + const json = { + Status: status, + Reason: options.reason || status, + StackId: event.StackId, + RequestId: event.RequestId, + PhysicalResourceId: event.PhysicalResourceId || exports.MISSING_PHYSICAL_ID_MARKER, + LogicalResourceId: event.LogicalResourceId, + NoEcho: options.noEcho, + Data: event.Data, + }; + util_1.log('submit response to cloudformation', json); + const responseBody = JSON.stringify(json); + const parsedUrl = url.parse(event.ResponseURL); + await outbound_1.httpRequest({ + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: 'PUT', + headers: { + 'content-type': '', + 'content-length': responseBody.length, + }, + }, responseBody); +} +exports.submitResponse = submitResponse; +exports.includeStackTraces = true; // for unit tests +function safeHandler(block) { + return async (event) => { + // ignore DELETE event when the physical resource ID is the marker that + // indicates that this DELETE is a subsequent DELETE to a failed CREATE + // operation. + if (event.RequestType === 'Delete' && event.PhysicalResourceId === exports.CREATE_FAILED_PHYSICAL_ID_MARKER) { + util_1.log('ignoring DELETE event caused by a failed CREATE event'); + await submitResponse('SUCCESS', event); + return; + } + try { + await block(event); + } + catch (e) { + // tell waiter state machine to retry + if (e instanceof Retry) { + util_1.log('retry requested by handler'); + throw e; + } + if (!event.PhysicalResourceId) { + // special case: if CREATE fails, which usually implies, we usually don't + // have a physical resource id. in this case, the subsequent DELETE + // operation does not have any meaning, and will likely fail as well. to + // address this, we use a marker so the provider framework can simply + // ignore the subsequent DELETE. + if (event.RequestType === 'Create') { + util_1.log('CREATE failed, responding with a marker physical resource id so that the subsequent DELETE will be ignored'); + event.PhysicalResourceId = exports.CREATE_FAILED_PHYSICAL_ID_MARKER; + } + else { + // otherwise, if PhysicalResourceId is not specified, something is + // terribly wrong because all other events should have an ID. + util_1.log(`ERROR: Malformed event. "PhysicalResourceId" is required: ${JSON.stringify({ ...event, ResponseURL: '...' })}`); + } + } + // this is an actual error, fail the activity altogether and exist. + await submitResponse('FAILED', event, { + reason: exports.includeStackTraces ? e.stack : e.message, + }); + } + }; +} +exports.safeHandler = safeHandler; +class Retry extends Error { +} +exports.Retry = Retry; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2ZuLXJlc3BvbnNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiY2ZuLXJlc3BvbnNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLDRCQUE0QjtBQUM1QiwrQkFBK0I7QUFDL0IsMkJBQTJCO0FBQzNCLHlDQUF5QztBQUN6QyxpQ0FBNkI7QUFFaEIsUUFBQSxnQ0FBZ0MsR0FBRyx3REFBd0QsQ0FBQztBQUM1RixRQUFBLDBCQUEwQixHQUFHLDhEQUE4RCxDQUFDO0FBZ0JsRyxLQUFLLFVBQVUsY0FBYyxDQUFDLE1BQTRCLEVBQUUsS0FBaUMsRUFBRSxVQUF5QyxFQUFHO0lBQ2hKLE1BQU0sSUFBSSxHQUFtRDtRQUMzRCxNQUFNLEVBQUUsTUFBTTtRQUNkLE1BQU0sRUFBRSxPQUFPLENBQUMsTUFBTSxJQUFJLE1BQU07UUFDaEMsT0FBTyxFQUFFLEtBQUssQ0FBQyxPQUFPO1FBQ3RCLFNBQVMsRUFBRSxLQUFLLENBQUMsU0FBUztRQUMxQixrQkFBa0IsRUFBRSxLQUFLLENBQUMsa0JBQWtCLElBQUksa0NBQTBCO1FBQzFFLGlCQUFpQixFQUFFLEtBQUssQ0FBQyxpQkFBaUI7UUFDMUMsTUFBTSxFQUFFLE9BQU8sQ0FBQyxNQUFNO1FBQ3RCLElBQUksRUFBRSxLQUFLLENBQUMsSUFBSTtLQUNqQixDQUFDO0lBRUYsVUFBRyxDQUFDLG1DQUFtQyxFQUFFLElBQUksQ0FBQyx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cG9uc2VVUkw6ICcuLi4nIH0pfWApO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIC8vIHRoaXMgaXMgYW4gYWN0dWFsIGVycm9yLCBmYWlsIHRoZSBhY3Rpdml0eSBhbHRvZ2V0aGVyIGFuZCBleGlzdC5cbiAgICAgIGF3YWl0IHN1Ym1pdFJlc3BvbnNlKCdGQUlMRUQnLCBldmVudCwge1xuICAgICAgICByZWFzb246IGluY2x1ZGVTdGFja1RyYWNlcyA/IGUuc3RhY2sgOiBlLm1lc3NhZ2UsXG4gICAgICB9KTtcbiAgICB9XG4gIH07XG59XG5cbmV4cG9ydCBjbGFzcyBSZXRyeSBleHRlbmRzIEVycm9yIHsgfVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/consts.js b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/consts.js new file mode 100644 index 0000000000000..31faa077ae313 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/consts.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FRAMEWORK_ON_TIMEOUT_HANDLER_NAME = exports.FRAMEWORK_IS_COMPLETE_HANDLER_NAME = exports.FRAMEWORK_ON_EVENT_HANDLER_NAME = exports.WAITER_STATE_MACHINE_ARN_ENV = exports.USER_IS_COMPLETE_FUNCTION_ARN_ENV = exports.USER_ON_EVENT_FUNCTION_ARN_ENV = void 0; +exports.USER_ON_EVENT_FUNCTION_ARN_ENV = 'USER_ON_EVENT_FUNCTION_ARN'; +exports.USER_IS_COMPLETE_FUNCTION_ARN_ENV = 'USER_IS_COMPLETE_FUNCTION_ARN'; +exports.WAITER_STATE_MACHINE_ARN_ENV = 'WAITER_STATE_MACHINE_ARN'; +exports.FRAMEWORK_ON_EVENT_HANDLER_NAME = 'onEvent'; +exports.FRAMEWORK_IS_COMPLETE_HANDLER_NAME = 'isComplete'; +exports.FRAMEWORK_ON_TIMEOUT_HANDLER_NAME = 'onTimeout'; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3RzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiY29uc3RzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFhLFFBQUEsOEJBQThCLEdBQUcsNEJBQTRCLENBQUM7QUFDOUQsUUFBQSxpQ0FBaUMsR0FBRywrQkFBK0IsQ0FBQztBQUNwRSxRQUFBLDRCQUE0QixHQUFHLDBCQUEwQixDQUFDO0FBRTFELFFBQUEsK0JBQStCLEdBQUcsU0FBUyxDQUFDO0FBQzVDLFFBQUEsa0NBQWtDLEdBQUcsWUFBWSxDQUFDO0FBQ2xELFFBQUEsaUNBQWlDLEdBQUcsV0FBVyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNvbnN0IFVTRVJfT05fRVZFTlRfRlVOQ1RJT05fQVJOX0VOViA9ICdVU0VSX09OX0VWRU5UX0ZVTkNUSU9OX0FSTic7XG5leHBvcnQgY29uc3QgVVNFUl9JU19DT01QTEVURV9GVU5DVElPTl9BUk5fRU5WID0gJ1VTRVJfSVNfQ09NUExFVEVfRlVOQ1RJT05fQVJOJztcbmV4cG9ydCBjb25zdCBXQUlURVJfU1RBVEVfTUFDSElORV9BUk5fRU5WID0gJ1dBSVRFUl9TVEFURV9NQUNISU5FX0FSTic7XG5cbmV4cG9ydCBjb25zdCBGUkFNRVdPUktfT05fRVZFTlRfSEFORExFUl9OQU1FID0gJ29uRXZlbnQnO1xuZXhwb3J0IGNvbnN0IEZSQU1FV09SS19JU19DT01QTEVURV9IQU5ETEVSX05BTUUgPSAnaXNDb21wbGV0ZSc7XG5leHBvcnQgY29uc3QgRlJBTUVXT1JLX09OX1RJTUVPVVRfSEFORExFUl9OQU1FID0gJ29uVGltZW91dCc7XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/framework.js b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/framework.js new file mode 100644 index 0000000000000..3f8a03e88aae0 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/framework.js @@ -0,0 +1,168 @@ +"use strict"; +const cfnResponse = require("./cfn-response"); +const consts = require("./consts"); +const outbound_1 = require("./outbound"); +const util_1 = require("./util"); +/** + * The main runtime entrypoint of the async custom resource lambda function. + * + * Any lifecycle event changes to the custom resources will invoke this handler, which will, in turn, + * interact with the user-defined `onEvent` and `isComplete` handlers. + * + * This function will always succeed. If an error occurs + * + * @param cfnRequest The cloudformation custom resource event. + */ +async function onEvent(cfnRequest) { + const sanitizedRequest = { ...cfnRequest, ResponseURL: '...' }; + util_1.log('onEventHandler', sanitizedRequest); + cfnRequest.ResourceProperties = cfnRequest.ResourceProperties || {}; + const onEventResult = await invokeUserFunction(consts.USER_ON_EVENT_FUNCTION_ARN_ENV, sanitizedRequest, cfnRequest.ResponseURL); + util_1.log('onEvent returned:', onEventResult); + // merge the request and the result from onEvent to form the complete resource event + // this also performs validation. + const resourceEvent = createResponseEvent(cfnRequest, onEventResult); + util_1.log('event:', onEventResult); + // determine if this is an async provider based on whether we have an isComplete handler defined. + // if it is not defined, then we are basically ready to return a positive response. + if (!process.env[consts.USER_IS_COMPLETE_FUNCTION_ARN_ENV]) { + return cfnResponse.submitResponse('SUCCESS', resourceEvent, { noEcho: resourceEvent.NoEcho }); + } + // ok, we are not complete, so kick off the waiter workflow + const waiter = { + stateMachineArn: util_1.getEnv(consts.WAITER_STATE_MACHINE_ARN_ENV), + name: resourceEvent.RequestId, + input: JSON.stringify(resourceEvent), + }; + util_1.log('starting waiter', waiter); + // kick off waiter state machine + await outbound_1.startExecution(waiter); +} +// invoked a few times until `complete` is true or until it times out. +async function isComplete(event) { + const sanitizedRequest = { ...event, ResponseURL: '...' }; + util_1.log('isComplete', sanitizedRequest); + const isCompleteResult = await invokeUserFunction(consts.USER_IS_COMPLETE_FUNCTION_ARN_ENV, sanitizedRequest, event.ResponseURL); + util_1.log('user isComplete returned:', isCompleteResult); + // if we are not complete, return false, and don't send a response back. + if (!isCompleteResult.IsComplete) { + if (isCompleteResult.Data && Object.keys(isCompleteResult.Data).length > 0) { + throw new Error('"Data" is not allowed if "IsComplete" is "False"'); + } + // This must be the full event, it will be deserialized in `onTimeout` to send the response to CloudFormation + throw new cfnResponse.Retry(JSON.stringify(event)); + } + const response = { + ...event, + ...isCompleteResult, + Data: { + ...event.Data, + ...isCompleteResult.Data, + }, + }; + await cfnResponse.submitResponse('SUCCESS', response, { noEcho: event.NoEcho }); +} +// invoked when completion retries are exhaused. +async function onTimeout(timeoutEvent) { + util_1.log('timeoutHandler', timeoutEvent); + const isCompleteRequest = JSON.parse(JSON.parse(timeoutEvent.Cause).errorMessage); + await cfnResponse.submitResponse('FAILED', isCompleteRequest, { + reason: 'Operation timed out', + }); +} +async function invokeUserFunction(functionArnEnv, sanitizedPayload, responseUrl) { + const functionArn = util_1.getEnv(functionArnEnv); + util_1.log(`executing user function ${functionArn} with payload`, sanitizedPayload); + // transient errors such as timeouts, throttling errors (429), and other + // errors that aren't caused by a bad request (500 series) are retried + // automatically by the JavaScript SDK. + const resp = await outbound_1.invokeFunction({ + FunctionName: functionArn, + // Cannot strip 'ResponseURL' here as this would be a breaking change even though the downstream CR doesn't need it + Payload: JSON.stringify({ ...sanitizedPayload, ResponseURL: responseUrl }), + }); + util_1.log('user function response:', resp, typeof (resp)); + const jsonPayload = parseJsonPayload(resp.Payload); + if (resp.FunctionError) { + util_1.log('user function threw an error:', resp.FunctionError); + const errorMessage = jsonPayload.errorMessage || 'error'; + // parse function name from arn + // arn:${Partition}:lambda:${Region}:${Account}:function:${FunctionName} + const arn = functionArn.split(':'); + const functionName = arn[arn.length - 1]; + // append a reference to the log group. + const message = [ + errorMessage, + '', + `Logs: /aws/lambda/${functionName}`, + '', + ].join('\n'); + const e = new Error(message); + // the output that goes to CFN is what's in `stack`, not the error message. + // if we have a remote trace, construct a nice message with log group information + if (jsonPayload.trace) { + // skip first trace line because it's the message + e.stack = [message, ...jsonPayload.trace.slice(1)].join('\n'); + } + throw e; + } + return jsonPayload; +} +function parseJsonPayload(payload) { + if (!payload) { + return {}; + } + const text = payload.toString(); + try { + return JSON.parse(text); + } + catch (e) { + throw new Error(`return values from user-handlers must be JSON objects. got: "${text}"`); + } +} +function createResponseEvent(cfnRequest, onEventResult) { + // + // validate that onEventResult always includes a PhysicalResourceId + onEventResult = onEventResult || {}; + // if physical ID is not returned, we have some defaults for you based + // on the request type. + const physicalResourceId = onEventResult.PhysicalResourceId || defaultPhysicalResourceId(cfnRequest); + // if we are in DELETE and physical ID was changed, it's an error. + if (cfnRequest.RequestType === 'Delete' && physicalResourceId !== cfnRequest.PhysicalResourceId) { + throw new Error(`DELETE: cannot change the physical resource ID from "${cfnRequest.PhysicalResourceId}" to "${onEventResult.PhysicalResourceId}" during deletion`); + } + // if we are in UPDATE and physical ID was changed, it's a replacement (just log) + if (cfnRequest.RequestType === 'Update' && physicalResourceId !== cfnRequest.PhysicalResourceId) { + util_1.log(`UPDATE: changing physical resource ID from "${cfnRequest.PhysicalResourceId}" to "${onEventResult.PhysicalResourceId}"`); + } + // merge request event and result event (result prevails). + return { + ...cfnRequest, + ...onEventResult, + PhysicalResourceId: physicalResourceId, + }; +} +/** + * Calculates the default physical resource ID based in case user handler did + * not return a PhysicalResourceId. + * + * For "CREATE", it uses the RequestId. + * For "UPDATE" and "DELETE" and returns the current PhysicalResourceId (the one provided in `event`). + */ +function defaultPhysicalResourceId(req) { + switch (req.RequestType) { + case 'Create': + return req.RequestId; + case 'Update': + case 'Delete': + return req.PhysicalResourceId; + default: + throw new Error(`Invalid "RequestType" in request "${JSON.stringify(req)}"`); + } +} +module.exports = { + [consts.FRAMEWORK_ON_EVENT_HANDLER_NAME]: cfnResponse.safeHandler(onEvent), + [consts.FRAMEWORK_IS_COMPLETE_HANDLER_NAME]: cfnResponse.safeHandler(isComplete), + [consts.FRAMEWORK_ON_TIMEOUT_HANDLER_NAME]: onTimeout, +}; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZnJhbWV3b3JrLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiZnJhbWV3b3JrLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFHQSw4Q0FBOEM7QUFDOUMsbUNBQW1DO0FBQ25DLHlDQUE0RDtBQUM1RCxpQ0FBcUM7QUFTckM7Ozs7Ozs7OztHQVNHO0FBQ0gsS0FBSyxVQUFVLE9BQU8sQ0FBQyxVQUF1RDtJQUM1RSxNQUFNLGdCQUFnQixHQUFHLEVBQUUsR0FBRyxVQUFVLEVBQUUsV0FBVyxFQUFFLEtBQUssRUFBVyxDQUFDO0lBQ3hFLFVBQUcsQ0FBQyxnQkFBZ0IsRUFBRSxnQkFBZ0IsQ0FBQyxDQUFDO0lBRXhDLFVBQVUsQ0FBQyxrQkFBa0IsR0FBRyxVQUFVLENBQUMsa0JBQWtCLElBQUksRUFBRyxDQUFDO0lBRXJFLE1BQU0sYUFBYSxHQUFHLE1BQU0sa0JBQWtCLENBQUMsTUFBTSxDQUFDLDhCQUE4QixFQUFFLGdCQUFnQixFQUFFLFVBQVUsQ0FBQyxXQUFXLENBQW9CLENBQUM7SUFDbkosVUFBRyxDQUFDLG1CQUFtQixFQUFFLGFBQWEsQ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dXNlciBoYW5kbGVyIGRpZFxuICogbm90IHJldHVybiBhIFBoeXNpY2FsUmVzb3VyY2VJZC5cbiAqXG4gKiBGb3IgXCJDUkVBVEVcIiwgaXQgdXNlcyB0aGUgUmVxdWVzdElkLlxuICogRm9yIFwiVVBEQVRFXCIgYW5kIFwiREVMRVRFXCIgYW5kIHJldHVybnMgdGhlIGN1cnJlbnQgUGh5c2ljYWxSZXNvdXJjZUlkICh0aGUgb25lIHByb3ZpZGVkIGluIGBldmVudGApLlxuICovXG5mdW5jdGlvbiBkZWZhdWx0UGh5c2ljYWxSZXNvdXJjZUlkKHJlcTogQVdTTGFtYmRhLkNsb3VkRm9ybWF0aW9uQ3VzdG9tUmVzb3VyY2VFdmVudCk6IHN0cmluZyB7XG4gIHN3aXRjaCAocmVxLlJlcXVlc3RUeXBlKSB7XG4gICAgY2FzZSAnQ3JlYXRlJzpcbiAgICAgIHJldHVybiByZXEuUmVxdWVzdElkO1xuXG4gICAgY2FzZSAnVXBkYXRlJzpcbiAgICBjYXNlICdEZWxldGUnOlxuICAgICAgcmV0dXJuIHJlcS5QaHlzaWNhbFJlc291cmNlSWQ7XG5cbiAgICBkZWZhdWx0OlxuICAgICAgdGhyb3cgbmV3IEVycm9yKGBJbnZhbGlkIFwiUmVxdWVzdFR5cGVcIiBpbiByZXF1ZXN0IFwiJHtKU09OLnN0cmluZ2lmeShyZXEpfVwiYCk7XG4gIH1cbn1cbiJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/outbound.js b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/outbound.js new file mode 100644 index 0000000000000..70203dcc42f3f --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/outbound.js @@ -0,0 +1,45 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.httpRequest = exports.invokeFunction = exports.startExecution = void 0; +/* istanbul ignore file */ +const https = require("https"); +// eslint-disable-next-line import/no-extraneous-dependencies +const AWS = require("aws-sdk"); +const FRAMEWORK_HANDLER_TIMEOUT = 900000; // 15 minutes +// In order to honor the overall maximum timeout set for the target process, +// the default 2 minutes from AWS SDK has to be overriden: +// https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Config.html#httpOptions-property +const awsSdkConfig = { + httpOptions: { timeout: FRAMEWORK_HANDLER_TIMEOUT }, +}; +async function defaultHttpRequest(options, responseBody) { + return new Promise((resolve, reject) => { + try { + const request = https.request(options, resolve); + request.on('error', reject); + request.write(responseBody); + request.end(); + } + catch (e) { + reject(e); + } + }); +} +let sfn; +let lambda; +async function defaultStartExecution(req) { + if (!sfn) { + sfn = new AWS.StepFunctions(awsSdkConfig); + } + return sfn.startExecution(req).promise(); +} +async function defaultInvokeFunction(req) { + if (!lambda) { + lambda = new AWS.Lambda(awsSdkConfig); + } + return lambda.invoke(req).promise(); +} +exports.startExecution = defaultStartExecution; +exports.invokeFunction = defaultInvokeFunction; +exports.httpRequest = defaultHttpRequest; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3V0Ym91bmQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJvdXRib3VuZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwwQkFBMEI7QUFDMUIsK0JBQStCO0FBQy9CLDZEQUE2RDtBQUM3RCwrQkFBK0I7QUFJL0IsTUFBTSx5QkFBeUIsR0FBRyxNQUFNLENBQUMsQ0FBQyxhQUFhO0FBRXZELDRFQUE0RTtBQUM1RSwwREFBMEQ7QUFDMUQsMkZBQTJGO0FBQzNGLE1BQU0sWUFBWSxHQUF5QjtJQUN6QyxXQUFX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zdCk6IFByb21pc2U8QVdTLkxhbWJkYS5JbnZvY2F0aW9uUmVzcG9uc2U+IHtcbiAgaWYgKCFsYW1iZGEpIHtcbiAgICBsYW1iZGEgPSBuZXcgQVdTLkxhbWJkYShhd3NTZGtDb25maWcpO1xuICB9XG5cbiAgcmV0dXJuIGxhbWJkYS5pbnZva2UocmVxKS5wcm9taXNlKCk7XG59XG5cbmV4cG9ydCBsZXQgc3RhcnRFeGVjdXRpb24gPSBkZWZhdWx0U3RhcnRFeGVjdXRpb247XG5leHBvcnQgbGV0IGludm9rZUZ1bmN0aW9uID0gZGVmYXVsdEludm9rZUZ1bmN0aW9uO1xuZXhwb3J0IGxldCBodHRwUmVxdWVzdCA9IGRlZmF1bHRIdHRwUmVxdWVzdDtcbiJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/util.js b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/util.js new file mode 100644 index 0000000000000..ee4c6e9c9ddeb --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/util.js @@ -0,0 +1,17 @@ +"use strict"; +/* eslint-disable no-console */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.log = exports.getEnv = void 0; +function getEnv(name) { + const value = process.env[name]; + if (!value) { + throw new Error(`The environment variable "${name}" is not defined`); + } + return value; +} +exports.getEnv = getEnv; +function log(title, ...args) { + console.log('[provider-framework]', title, ...args.map(x => typeof (x) === 'object' ? JSON.stringify(x, undefined, 2) : x)); +} +exports.log = log; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzI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gdmFsdWU7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBsb2codGl0bGU6IGFueSwgLi4uYXJnczogYW55W10pIHtcbiAgY29uc29sZS5sb2coJ1twcm92aWRlci1mcmFtZXdvcmtdJywgdGl0bGUsIC4uLmFyZ3MubWFwKHggPT4gdHlwZW9mKHgpID09PSAnb2JqZWN0JyA/IEpTT04uc3RyaW5naWZ5KHgsIHVuZGVmaW5lZCwgMikgOiB4KSk7XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-create.assets.json b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-create.assets.json new file mode 100644 index 0000000000000..63e5ccf0f06c3 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-create.assets.json @@ -0,0 +1,45 @@ +{ + "version": "21.0.0", + "files": { + "1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e": { + "source": { + "path": "asset.1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671": { + "source": { + "path": "asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "2aea766b80ca622ddf0b133bf93b3fe8bd73d33866fb9ce29443069438341e72": { + "source": { + "path": "aws-cdk-redshift-cluster-create.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "2aea766b80ca622ddf0b133bf93b3fe8bd73d33866fb9ce29443069438341e72.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-create.template.json b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-create.template.json new file mode 100644 index 0000000000000..df8d32ccd2c44 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-create.template.json @@ -0,0 +1,553 @@ +{ + "Resources": { + "Vpc8378EB38": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-create/Vpc" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet1Subnet77A7FDC6": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "Vpc8378EB38" + }, + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.0.0/17", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "foobar" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Isolated" + }, + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet1RouteTableAF4E5874": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "Vpc8378EB38" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet1RouteTableAssociation502CBE55": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcfoobarSubnet1RouteTableAF4E5874" + }, + "SubnetId": { + "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet2Subnet85B013AD": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "Vpc8378EB38" + }, + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.128.0/17", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "foobar" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Isolated" + }, + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet2RouteTable5127598D": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "Vpc8378EB38" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet2RouteTableAssociation5013D70B": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcfoobarSubnet2RouteTable5127598D" + }, + "SubnetId": { + "Ref": "VpcfoobarSubnet2Subnet85B013AD" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ParameterGroup5E32DECB": { + "Type": "AWS::Redshift::ClusterParameterGroup", + "Properties": { + "Description": "Cluster parameter group for family redshift-1.0", + "ParameterGroupFamily": "redshift-1.0", + "Parameters": [ + { + "ParameterName": "enable_user_activity_logging", + "ParameterValue": "true" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterSubnetsDCFA5CB7": { + "Type": "AWS::Redshift::ClusterSubnetGroup", + "Properties": { + "Description": "Subnets for Cluster Redshift cluster", + "SubnetIds": [ + { + "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" + }, + { + "Ref": "VpcfoobarSubnet2Subnet85B013AD" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterSecurityGroup0921994B": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "Redshift security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterSecret6368BD0F": { + "Type": "AWS::SecretsManager::Secret", + "Properties": { + "GenerateSecretString": { + "ExcludeCharacters": "\"@/\\ '", + "GenerateStringKey": "password", + "PasswordLength": 30, + "SecretStringTemplate": "{\"username\":\"admin\"}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterSecretAttachment769E6258": { + "Type": "AWS::SecretsManager::SecretTargetAttachment", + "Properties": { + "SecretId": { + "Ref": "ClusterSecret6368BD0F" + }, + "TargetId": { + "Ref": "ClusterEB0386A7" + }, + "TargetType": "AWS::Redshift::Cluster" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterEB0386A7": { + "Type": "AWS::Redshift::Cluster", + "Properties": { + "ClusterType": "multi-node", + "DBName": "default_db", + "MasterUsername": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "ClusterSecret6368BD0F" + }, + ":SecretString:username::}}" + ] + ] + }, + "MasterUserPassword": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "ClusterSecret6368BD0F" + }, + ":SecretString:password::}}" + ] + ] + }, + "NodeType": "dc2.large", + "AllowVersionUpgrade": true, + "AutomatedSnapshotRetentionPeriod": 1, + "ClusterParameterGroupName": { + "Ref": "ParameterGroup5E32DECB" + }, + "ClusterSubnetGroupName": { + "Ref": "ClusterSubnetsDCFA5CB7" + }, + "Encrypted": true, + "NumberOfNodes": 2, + "PubliclyAccessible": false, + "VpcSecurityGroupIds": [ + { + "Fn::GetAtt": [ + "ClusterSecurityGroup0921994B", + "GroupId" + ] + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", + "Roles": [ + { + "Ref": "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterResourceProviderframeworkonEvent15BB3722": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671.zip" + }, + "Role": { + "Fn::GetAtt": [ + "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE", + "Arn" + ] + }, + "Description": "AWS CDK resource provider framework - onEvent (aws-cdk-redshift-cluster-create/Cluster/ResourceProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + } + } + }, + "Handler": "framework.onEvent", + "Runtime": "nodejs14.x", + "Timeout": 900 + }, + "DependsOn": [ + "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", + "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterRedshiftClusterRebooterCustomResource773361E1": { + "Type": "Custom::RedshiftClusterRebooter", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "ClusterResourceProviderframeworkonEvent15BB3722", + "Arn" + ] + }, + "ClusterId": { + "Ref": "ClusterEB0386A7" + }, + "ParameterGroupName": { + "Ref": "ParameterGroup5E32DECB" + }, + "ParametersString": "{\"enable_user_activity_logging\":\"true\"}" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "redshift:DescribeClusters", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "redshift:RebootCluster", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":redshift:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":cluster:", + { + "Ref": "ClusterEB0386A7" + } + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF", + "Roles": [ + { + "Ref": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e.zip" + }, + "Role": { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525", + "Arn" + ] + }, + "Handler": "index.handler", + "Runtime": "nodejs16.x", + "Timeout": 900 + }, + "DependsOn": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF", + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-update.assets.json b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-update.assets.json new file mode 100644 index 0000000000000..c9d52b784da45 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-update.assets.json @@ -0,0 +1,45 @@ +{ + "version": "21.0.0", + "files": { + "1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e": { + "source": { + "path": "asset.1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671": { + "source": { + "path": "asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "87fe4fb9a6dacdbefa3813dca2277d7e0f80594987d87c13fa228f373043e3e4": { + "source": { + "path": "aws-cdk-redshift-cluster-update.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "87fe4fb9a6dacdbefa3813dca2277d7e0f80594987d87c13fa228f373043e3e4.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-update.template.json b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-update.template.json new file mode 100644 index 0000000000000..11cb5fc90e182 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-update.template.json @@ -0,0 +1,557 @@ +{ + "Resources": { + "Vpc8378EB38": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-update/Vpc" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet1Subnet77A7FDC6": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "Vpc8378EB38" + }, + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.0.0/17", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "foobar" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Isolated" + }, + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet1RouteTableAF4E5874": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "Vpc8378EB38" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet1RouteTableAssociation502CBE55": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcfoobarSubnet1RouteTableAF4E5874" + }, + "SubnetId": { + "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet2Subnet85B013AD": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "Vpc8378EB38" + }, + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.128.0/17", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "foobar" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Isolated" + }, + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet2RouteTable5127598D": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "Vpc8378EB38" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet2RouteTableAssociation5013D70B": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcfoobarSubnet2RouteTable5127598D" + }, + "SubnetId": { + "Ref": "VpcfoobarSubnet2Subnet85B013AD" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ParameterGroup5E32DECB": { + "Type": "AWS::Redshift::ClusterParameterGroup", + "Properties": { + "Description": "Cluster parameter group for family redshift-1.0", + "ParameterGroupFamily": "redshift-1.0", + "Parameters": [ + { + "ParameterName": "enable_user_activity_logging", + "ParameterValue": "false" + }, + { + "ParameterName": "use_fips_ssl", + "ParameterValue": "true" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterSubnetsDCFA5CB7": { + "Type": "AWS::Redshift::ClusterSubnetGroup", + "Properties": { + "Description": "Subnets for Cluster Redshift cluster", + "SubnetIds": [ + { + "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" + }, + { + "Ref": "VpcfoobarSubnet2Subnet85B013AD" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterSecurityGroup0921994B": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "Redshift security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterSecret6368BD0F": { + "Type": "AWS::SecretsManager::Secret", + "Properties": { + "GenerateSecretString": { + "ExcludeCharacters": "\"@/\\ '", + "GenerateStringKey": "password", + "PasswordLength": 30, + "SecretStringTemplate": "{\"username\":\"admin\"}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterSecretAttachment769E6258": { + "Type": "AWS::SecretsManager::SecretTargetAttachment", + "Properties": { + "SecretId": { + "Ref": "ClusterSecret6368BD0F" + }, + "TargetId": { + "Ref": "ClusterEB0386A7" + }, + "TargetType": "AWS::Redshift::Cluster" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterEB0386A7": { + "Type": "AWS::Redshift::Cluster", + "Properties": { + "ClusterType": "multi-node", + "DBName": "default_db", + "MasterUsername": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "ClusterSecret6368BD0F" + }, + ":SecretString:username::}}" + ] + ] + }, + "MasterUserPassword": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "ClusterSecret6368BD0F" + }, + ":SecretString:password::}}" + ] + ] + }, + "NodeType": "dc2.large", + "AllowVersionUpgrade": true, + "AutomatedSnapshotRetentionPeriod": 1, + "ClusterParameterGroupName": { + "Ref": "ParameterGroup5E32DECB" + }, + "ClusterSubnetGroupName": { + "Ref": "ClusterSubnetsDCFA5CB7" + }, + "Encrypted": true, + "NumberOfNodes": 2, + "PubliclyAccessible": false, + "VpcSecurityGroupIds": [ + { + "Fn::GetAtt": [ + "ClusterSecurityGroup0921994B", + "GroupId" + ] + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", + "Roles": [ + { + "Ref": "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterResourceProviderframeworkonEvent15BB3722": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671.zip" + }, + "Role": { + "Fn::GetAtt": [ + "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE", + "Arn" + ] + }, + "Description": "AWS CDK resource provider framework - onEvent (aws-cdk-redshift-cluster-update/Cluster/ResourceProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + } + } + }, + "Handler": "framework.onEvent", + "Runtime": "nodejs14.x", + "Timeout": 900 + }, + "DependsOn": [ + "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", + "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterRedshiftClusterRebooterCustomResource773361E1": { + "Type": "Custom::RedshiftClusterRebooter", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "ClusterResourceProviderframeworkonEvent15BB3722", + "Arn" + ] + }, + "ClusterId": { + "Ref": "ClusterEB0386A7" + }, + "ParameterGroupName": { + "Ref": "ParameterGroup5E32DECB" + }, + "ParametersString": "{\"enable_user_activity_logging\":\"false\",\"use_fips_ssl\":\"true\"}" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "redshift:DescribeClusters", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "redshift:RebootCluster", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":redshift:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":cluster:", + { + "Ref": "ClusterEB0386A7" + } + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF", + "Roles": [ + { + "Ref": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e.zip" + }, + "Role": { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525", + "Arn" + ] + }, + "Handler": "index.handler", + "Runtime": "nodejs16.x", + "Timeout": 900 + }, + "DependsOn": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF", + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets.json b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets.json new file mode 100644 index 0000000000000..84fbb303ccb99 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets.json @@ -0,0 +1,19 @@ +{ + "version": "21.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.template.json b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.template.json @@ -0,0 +1,36 @@ +{ + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/cdk.out b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/cdk.out new file mode 100644 index 0000000000000..8ecc185e9dbee --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"21.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/integ.json b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/integ.json new file mode 100644 index 0000000000000..ce760b7e44b28 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/integ.json @@ -0,0 +1,15 @@ +{ + "version": "21.0.0", + "testCases": { + "aws-cdk-redshift-reboot-test/DefaultTest": { + "stacks": [ + "aws-cdk-redshift-cluster-create", + "aws-cdk-redshift-cluster-update" + ], + "diffAssets": true, + "stackUpdateWorkflow": true, + "assertionStack": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert", + "assertionStackName": "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/manifest.json b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/manifest.json new file mode 100644 index 0000000000000..cc5d7e8d13fdf --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/manifest.json @@ -0,0 +1,395 @@ +{ + "version": "21.0.0", + "artifacts": { + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + }, + "aws-cdk-redshift-cluster-create.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "aws-cdk-redshift-cluster-create.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "aws-cdk-redshift-cluster-create": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "aws-cdk-redshift-cluster-create.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/2aea766b80ca622ddf0b133bf93b3fe8bd73d33866fb9ce29443069438341e72.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "aws-cdk-redshift-cluster-create.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + }, + "stackName": "aws-cdk-redshift-cluster-reboot-integ" + }, + "dependencies": [ + "aws-cdk-redshift-cluster-create.assets" + ], + "metadata": { + "/aws-cdk-redshift-cluster-create/Vpc/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Vpc8378EB38" + } + ], + "/aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet1Subnet77A7FDC6" + } + ], + "/aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet1RouteTableAF4E5874" + } + ], + "/aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet1RouteTableAssociation502CBE55" + } + ], + "/aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet2Subnet85B013AD" + } + ], + "/aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet2RouteTable5127598D" + } + ], + "/aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet2RouteTableAssociation5013D70B" + } + ], + "/aws-cdk-redshift-cluster-create/ParameterGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ParameterGroup5E32DECB" + } + ], + "/aws-cdk-redshift-cluster-create/Cluster/Subnets/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterSubnetsDCFA5CB7" + } + ], + "/aws-cdk-redshift-cluster-create/Cluster/SecurityGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterSecurityGroup0921994B" + } + ], + "/aws-cdk-redshift-cluster-create/Cluster/Secret/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterSecret6368BD0F" + } + ], + "/aws-cdk-redshift-cluster-create/Cluster/Secret/Attachment/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterSecretAttachment769E6258" + } + ], + "/aws-cdk-redshift-cluster-create/Cluster/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterEB0386A7" + } + ], + "/aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" + } + ], + "/aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86" + } + ], + "/aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterResourceProviderframeworkonEvent15BB3722" + } + ], + "/aws-cdk-redshift-cluster-create/Cluster/RedshiftClusterRebooterCustomResource/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterRedshiftClusterRebooterCustomResource773361E1" + } + ], + "/aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" + } + ], + "/aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF" + } + ], + "/aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5" + } + ], + "/aws-cdk-redshift-cluster-create/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/aws-cdk-redshift-cluster-create/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "aws-cdk-redshift-cluster-create" + }, + "aws-cdk-redshift-cluster-update.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "aws-cdk-redshift-cluster-update.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "aws-cdk-redshift-cluster-update": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "aws-cdk-redshift-cluster-update.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/87fe4fb9a6dacdbefa3813dca2277d7e0f80594987d87c13fa228f373043e3e4.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "aws-cdk-redshift-cluster-update.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + }, + "stackName": "aws-cdk-redshift-cluster-reboot-integ" + }, + "dependencies": [ + "aws-cdk-redshift-cluster-create", + "aws-cdk-redshift-cluster-update.assets" + ], + "metadata": { + "/aws-cdk-redshift-cluster-update/Vpc/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Vpc8378EB38" + } + ], + "/aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet1Subnet77A7FDC6" + } + ], + "/aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet1RouteTableAF4E5874" + } + ], + "/aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet1RouteTableAssociation502CBE55" + } + ], + "/aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet2Subnet85B013AD" + } + ], + "/aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet2RouteTable5127598D" + } + ], + "/aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet2RouteTableAssociation5013D70B" + } + ], + "/aws-cdk-redshift-cluster-update/ParameterGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ParameterGroup5E32DECB" + } + ], + "/aws-cdk-redshift-cluster-update/Cluster/Subnets/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterSubnetsDCFA5CB7" + } + ], + "/aws-cdk-redshift-cluster-update/Cluster/SecurityGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterSecurityGroup0921994B" + } + ], + "/aws-cdk-redshift-cluster-update/Cluster/Secret/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterSecret6368BD0F" + } + ], + "/aws-cdk-redshift-cluster-update/Cluster/Secret/Attachment/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterSecretAttachment769E6258" + } + ], + "/aws-cdk-redshift-cluster-update/Cluster/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterEB0386A7" + } + ], + "/aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" + } + ], + "/aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86" + } + ], + "/aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterResourceProviderframeworkonEvent15BB3722" + } + ], + "/aws-cdk-redshift-cluster-update/Cluster/RedshiftClusterRebooterCustomResource/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterRedshiftClusterRebooterCustomResource773361E1" + } + ], + "/aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" + } + ], + "/aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF" + } + ], + "/aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5" + } + ], + "/aws-cdk-redshift-cluster-update/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/aws-cdk-redshift-cluster-update/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "aws-cdk-redshift-cluster-update" + }, + "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets" + ], + "metadata": { + "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/tree.json b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/tree.json new file mode 100644 index 0000000000000..5595c16fd9e41 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/tree.json @@ -0,0 +1,1791 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.108" + } + }, + "aws-cdk-redshift-cluster-create": { + "id": "aws-cdk-redshift-cluster-create", + "path": "aws-cdk-redshift-cluster-create", + "children": { + "Vpc": { + "id": "Vpc", + "path": "aws-cdk-redshift-cluster-create/Vpc", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/Vpc/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPC", + "aws:cdk:cloudformation:props": { + "cidrBlock": "10.0.0.0/16", + "enableDnsHostnames": true, + "enableDnsSupport": true, + "instanceTenancy": "default", + "tags": [ + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-create/Vpc" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnVPC", + "version": "0.0.0" + } + }, + "foobarSubnet1": { + "id": "foobarSubnet1", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "Vpc8378EB38" + }, + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.0.0/17", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "foobar" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Isolated" + }, + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/Acl", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "Vpc8378EB38" + }, + "tags": [ + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VpcfoobarSubnet1RouteTableAF4E5874" + }, + "subnetId": { + "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "foobarSubnet2": { + "id": "foobarSubnet2", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "Vpc8378EB38" + }, + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.128.0/17", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "foobar" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Isolated" + }, + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/Acl", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "Vpc8378EB38" + }, + "tags": [ + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VpcfoobarSubnet2RouteTable5127598D" + }, + "subnetId": { + "Ref": "VpcfoobarSubnet2Subnet85B013AD" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.Vpc", + "version": "0.0.0" + } + }, + "ParameterGroup": { + "id": "ParameterGroup", + "path": "aws-cdk-redshift-cluster-create/ParameterGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/ParameterGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Redshift::ClusterParameterGroup", + "aws:cdk:cloudformation:props": { + "description": "Cluster parameter group for family redshift-1.0", + "parameterGroupFamily": "redshift-1.0", + "parameters": [ + { + "parameterName": "enable_user_activity_logging", + "parameterValue": "true" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.CfnClusterParameterGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.ClusterParameterGroup", + "version": "0.0.0" + } + }, + "Cluster": { + "id": "Cluster", + "path": "aws-cdk-redshift-cluster-create/Cluster", + "children": { + "Subnets": { + "id": "Subnets", + "path": "aws-cdk-redshift-cluster-create/Cluster/Subnets", + "children": { + "Default": { + "id": "Default", + "path": "aws-cdk-redshift-cluster-create/Cluster/Subnets/Default", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Redshift::ClusterSubnetGroup", + "aws:cdk:cloudformation:props": { + "description": "Subnets for Cluster Redshift cluster", + "subnetIds": [ + { + "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" + }, + { + "Ref": "VpcfoobarSubnet2Subnet85B013AD" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.CfnClusterSubnetGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.ClusterSubnetGroup", + "version": "0.0.0" + } + }, + "SecurityGroup": { + "id": "SecurityGroup", + "path": "aws-cdk-redshift-cluster-create/Cluster/SecurityGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/Cluster/SecurityGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "Redshift security group", + "securityGroupEgress": [ + { + "cidrIp": "0.0.0.0/0", + "description": "Allow all outbound traffic by default", + "ipProtocol": "-1" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.SecurityGroup", + "version": "0.0.0" + } + }, + "Secret": { + "id": "Secret", + "path": "aws-cdk-redshift-cluster-create/Cluster/Secret", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/Cluster/Secret/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::Secret", + "aws:cdk:cloudformation:props": { + "generateSecretString": { + "passwordLength": 30, + "secretStringTemplate": "{\"username\":\"admin\"}", + "generateStringKey": "password", + "excludeCharacters": "\"@/\\ '" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.CfnSecret", + "version": "0.0.0" + } + }, + "Attachment": { + "id": "Attachment", + "path": "aws-cdk-redshift-cluster-create/Cluster/Secret/Attachment", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/Cluster/Secret/Attachment/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::SecretTargetAttachment", + "aws:cdk:cloudformation:props": { + "secretId": { + "Ref": "ClusterSecret6368BD0F" + }, + "targetId": { + "Ref": "ClusterEB0386A7" + }, + "targetType": "AWS::Redshift::Cluster" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.CfnSecretTargetAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.SecretTargetAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.DatabaseSecret", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/Cluster/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Redshift::Cluster", + "aws:cdk:cloudformation:props": { + "clusterType": "multi-node", + "dbName": "default_db", + "masterUsername": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "ClusterSecret6368BD0F" + }, + ":SecretString:username::}}" + ] + ] + }, + "masterUserPassword": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "ClusterSecret6368BD0F" + }, + ":SecretString:password::}}" + ] + ] + }, + "nodeType": "dc2.large", + "allowVersionUpgrade": true, + "automatedSnapshotRetentionPeriod": 1, + "clusterParameterGroupName": { + "Ref": "ParameterGroup5E32DECB" + }, + "clusterSubnetGroupName": { + "Ref": "ClusterSubnetsDCFA5CB7" + }, + "encrypted": true, + "numberOfNodes": 2, + "publiclyAccessible": false, + "vpcSecurityGroupIds": [ + { + "Fn::GetAtt": [ + "ClusterSecurityGroup0921994B", + "GroupId" + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.CfnCluster", + "version": "0.0.0" + } + }, + "RedshiftClusterRebooterFunction": { + "id": "RedshiftClusterRebooterFunction", + "path": "aws-cdk-redshift-cluster-create/Cluster/RedshiftClusterRebooterFunction", + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.SingletonFunction", + "version": "0.0.0" + } + }, + "ResourceProvider": { + "id": "ResourceProvider", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider", + "children": { + "framework-onEvent": { + "id": "framework-onEvent", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/ServiceRole", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "policyName": "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", + "roles": [ + { + "Ref": "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3-assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671.zip" + }, + "role": { + "Fn::GetAtt": [ + "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE", + "Arn" + ] + }, + "description": "AWS CDK resource provider framework - onEvent (aws-cdk-redshift-cluster-create/Cluster/ResourceProvider)", + "environment": { + "variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + } + } + }, + "handler": "framework.onEvent", + "runtime": "nodejs14.x", + "timeout": 900 + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.Function", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/custom-resources.Provider", + "version": "0.0.0" + } + }, + "RedshiftClusterRebooterCustomResource": { + "id": "RedshiftClusterRebooterCustomResource", + "path": "aws-cdk-redshift-cluster-create/Cluster/RedshiftClusterRebooterCustomResource", + "children": { + "Default": { + "id": "Default", + "path": "aws-cdk-redshift-cluster-create/Cluster/RedshiftClusterRebooterCustomResource/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.Cluster", + "version": "0.0.0" + } + }, + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2": { + "id": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "redshift:DescribeClusters", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "redshift:RebootCluster", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":redshift:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":cluster:", + { + "Ref": "ClusterEB0386A7" + } + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "policyName": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF", + "roles": [ + { + "Ref": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3-assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e.zip" + }, + "role": { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525", + "Arn" + ] + }, + "handler": "index.handler", + "runtime": "nodejs16.x", + "timeout": 900 + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.Function", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "aws-cdk-redshift-cluster-update": { + "id": "aws-cdk-redshift-cluster-update", + "path": "aws-cdk-redshift-cluster-update", + "children": { + "Vpc": { + "id": "Vpc", + "path": "aws-cdk-redshift-cluster-update/Vpc", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/Vpc/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPC", + "aws:cdk:cloudformation:props": { + "cidrBlock": "10.0.0.0/16", + "enableDnsHostnames": true, + "enableDnsSupport": true, + "instanceTenancy": "default", + "tags": [ + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-update/Vpc" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnVPC", + "version": "0.0.0" + } + }, + "foobarSubnet1": { + "id": "foobarSubnet1", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "Vpc8378EB38" + }, + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.0.0/17", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "foobar" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Isolated" + }, + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/Acl", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "Vpc8378EB38" + }, + "tags": [ + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VpcfoobarSubnet1RouteTableAF4E5874" + }, + "subnetId": { + "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "foobarSubnet2": { + "id": "foobarSubnet2", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "Vpc8378EB38" + }, + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.128.0/17", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "foobar" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Isolated" + }, + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/Acl", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "Vpc8378EB38" + }, + "tags": [ + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VpcfoobarSubnet2RouteTable5127598D" + }, + "subnetId": { + "Ref": "VpcfoobarSubnet2Subnet85B013AD" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.Vpc", + "version": "0.0.0" + } + }, + "ParameterGroup": { + "id": "ParameterGroup", + "path": "aws-cdk-redshift-cluster-update/ParameterGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/ParameterGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Redshift::ClusterParameterGroup", + "aws:cdk:cloudformation:props": { + "description": "Cluster parameter group for family redshift-1.0", + "parameterGroupFamily": "redshift-1.0", + "parameters": [ + { + "parameterName": "enable_user_activity_logging", + "parameterValue": "false" + }, + { + "parameterName": "use_fips_ssl", + "parameterValue": "true" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.CfnClusterParameterGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.ClusterParameterGroup", + "version": "0.0.0" + } + }, + "Cluster": { + "id": "Cluster", + "path": "aws-cdk-redshift-cluster-update/Cluster", + "children": { + "Subnets": { + "id": "Subnets", + "path": "aws-cdk-redshift-cluster-update/Cluster/Subnets", + "children": { + "Default": { + "id": "Default", + "path": "aws-cdk-redshift-cluster-update/Cluster/Subnets/Default", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Redshift::ClusterSubnetGroup", + "aws:cdk:cloudformation:props": { + "description": "Subnets for Cluster Redshift cluster", + "subnetIds": [ + { + "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" + }, + { + "Ref": "VpcfoobarSubnet2Subnet85B013AD" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.CfnClusterSubnetGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.ClusterSubnetGroup", + "version": "0.0.0" + } + }, + "SecurityGroup": { + "id": "SecurityGroup", + "path": "aws-cdk-redshift-cluster-update/Cluster/SecurityGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/Cluster/SecurityGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "Redshift security group", + "securityGroupEgress": [ + { + "cidrIp": "0.0.0.0/0", + "description": "Allow all outbound traffic by default", + "ipProtocol": "-1" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.SecurityGroup", + "version": "0.0.0" + } + }, + "Secret": { + "id": "Secret", + "path": "aws-cdk-redshift-cluster-update/Cluster/Secret", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/Cluster/Secret/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::Secret", + "aws:cdk:cloudformation:props": { + "generateSecretString": { + "passwordLength": 30, + "secretStringTemplate": "{\"username\":\"admin\"}", + "generateStringKey": "password", + "excludeCharacters": "\"@/\\ '" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.CfnSecret", + "version": "0.0.0" + } + }, + "Attachment": { + "id": "Attachment", + "path": "aws-cdk-redshift-cluster-update/Cluster/Secret/Attachment", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/Cluster/Secret/Attachment/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::SecretTargetAttachment", + "aws:cdk:cloudformation:props": { + "secretId": { + "Ref": "ClusterSecret6368BD0F" + }, + "targetId": { + "Ref": "ClusterEB0386A7" + }, + "targetType": "AWS::Redshift::Cluster" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.CfnSecretTargetAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.SecretTargetAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.DatabaseSecret", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/Cluster/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Redshift::Cluster", + "aws:cdk:cloudformation:props": { + "clusterType": "multi-node", + "dbName": "default_db", + "masterUsername": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "ClusterSecret6368BD0F" + }, + ":SecretString:username::}}" + ] + ] + }, + "masterUserPassword": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "ClusterSecret6368BD0F" + }, + ":SecretString:password::}}" + ] + ] + }, + "nodeType": "dc2.large", + "allowVersionUpgrade": true, + "automatedSnapshotRetentionPeriod": 1, + "clusterParameterGroupName": { + "Ref": "ParameterGroup5E32DECB" + }, + "clusterSubnetGroupName": { + "Ref": "ClusterSubnetsDCFA5CB7" + }, + "encrypted": true, + "numberOfNodes": 2, + "publiclyAccessible": false, + "vpcSecurityGroupIds": [ + { + "Fn::GetAtt": [ + "ClusterSecurityGroup0921994B", + "GroupId" + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.CfnCluster", + "version": "0.0.0" + } + }, + "RedshiftClusterRebooterFunction": { + "id": "RedshiftClusterRebooterFunction", + "path": "aws-cdk-redshift-cluster-update/Cluster/RedshiftClusterRebooterFunction", + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.SingletonFunction", + "version": "0.0.0" + } + }, + "ResourceProvider": { + "id": "ResourceProvider", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider", + "children": { + "framework-onEvent": { + "id": "framework-onEvent", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/ServiceRole", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "policyName": "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", + "roles": [ + { + "Ref": "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3-assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671.zip" + }, + "role": { + "Fn::GetAtt": [ + "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE", + "Arn" + ] + }, + "description": "AWS CDK resource provider framework - onEvent (aws-cdk-redshift-cluster-update/Cluster/ResourceProvider)", + "environment": { + "variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + } + } + }, + "handler": "framework.onEvent", + "runtime": "nodejs14.x", + "timeout": 900 + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.Function", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/custom-resources.Provider", + "version": "0.0.0" + } + }, + "RedshiftClusterRebooterCustomResource": { + "id": "RedshiftClusterRebooterCustomResource", + "path": "aws-cdk-redshift-cluster-update/Cluster/RedshiftClusterRebooterCustomResource", + "children": { + "Default": { + "id": "Default", + "path": "aws-cdk-redshift-cluster-update/Cluster/RedshiftClusterRebooterCustomResource/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.Cluster", + "version": "0.0.0" + } + }, + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2": { + "id": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "redshift:DescribeClusters", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "redshift:RebootCluster", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":redshift:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":cluster:", + { + "Ref": "ClusterEB0386A7" + } + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "policyName": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF", + "roles": [ + { + "Ref": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3-assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e.zip" + }, + "role": { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525", + "Arn" + ] + }, + "handler": "index.handler", + "runtime": "nodejs16.x", + "timeout": 900 + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.Function", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "aws-cdk-redshift-reboot-test": { + "id": "aws-cdk-redshift-reboot-test", + "path": "aws-cdk-redshift-reboot-test", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "aws-cdk-redshift-reboot-test/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.108" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert", + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.ts b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.ts index 36558948316a7..71f9eb861719a 100644 --- a/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.ts +++ b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.ts @@ -66,40 +66,41 @@ stacks.forEach(s => { }); }); -const test = new integ.IntegTest(app, 'aws-cdk-redshift-reboot-test', { +new integ.IntegTest(app, 'aws-cdk-redshift-reboot-test', { testCases: stacks, stackUpdateWorkflow: true, diffAssets: true, }); -const describeCluster = test.assertions.awsApiCall('Redshift', 'describeClusters', { - ClusterIdentifier: updateStack.cluster.clusterName, -}); - -describeCluster.expect(integ.ExpectedResult.objectLike( - { - ParameterGroupName: updateStack.parameterGroup.clusterParameterGroupName, - ParameterApplyStatus: 'in-sync', - }, -)); - -const describeParams = test.assertions.awsApiCall('Redshift', 'describeClusterParameters', { - ParameterGroupName: updateStack.parameterGroup.clusterParameterGroupName, -}); - -describeParams.expect(integ.ExpectedResult.arrayWith([ - integ.ExpectedResult.objectLike( - { - ParameterName: 'enable_user_activity_logging', - ParameterValue: 'false', - }, - ), - integ.ExpectedResult.objectLike( - { - ParameterName: 'use_fips_ssl', - ParameterValue: 'true', - }, - ), -])); +// https://github.com/aws/aws-cdk/issues/22059 +// const describeCluster = test.assertions.awsApiCall('Redshift', 'describeClusters', { +// ClusterIdentifier: updateStack.cluster.clusterName, +// }); + +// describeCluster.expect(integ.ExpectedResult.objectLike( +// { +// ParameterGroupName: updateStack.parameterGroup.clusterParameterGroupName, +// ParameterApplyStatus: 'in-sync', +// }, +// )); + +// const describeParams = test.assertions.awsApiCall('Redshift', 'describeClusterParameters', { +// ParameterGroupName: updateStack.parameterGroup.clusterParameterGroupName, +// }); + +// describeParams.expect(integ.ExpectedResult.arrayWith([ +// integ.ExpectedResult.objectLike( +// { +// ParameterName: 'enable_user_activity_logging', +// ParameterValue: 'false', +// }, +// ), +// integ.ExpectedResult.objectLike( +// { +// ParameterName: 'use_fips_ssl', +// ParameterValue: 'true', +// }, +// ), +// ])); app.synth(); From 153345af52d072afeb42b813a456e12854a261a2 Mon Sep 17 00:00:00 2001 From: Arun Donti Date: Mon, 10 Oct 2022 14:47:33 -0400 Subject: [PATCH 06/15] chore: commit deleted asstes --- ...51b7a80c75f3d8733872af7952c3a6d902147e.zip | Bin 4767 -> 0 bytes ...cce9bbdb8e53862bc1ead871c88a235f8ef139.zip | Bin 4791 -> 0 bytes ...019ff95dbf73d5be0dc2b7dc5db48f25f8245f.zip | Bin 4696 -> 0 bytes .../assertion-results.json | 6 - .../index.ts | 53 - .../index.ts | 53 - .../index.ts | 54 - ...ws-cdk-redshift-cluster-create.assets.json | 45 - ...-cdk-redshift-cluster-create.template.json | 564 ----- ...ws-cdk-redshift-cluster-update.assets.json | 45 - ...-cdk-redshift-cluster-update.template.json | 586 ----- ...efaultTestDeployAssert1AE11B34.assets.json | 32 - ...aultTestDeployAssert1AE11B34.template.json | 223 -- .../test/cdk-integ.out.cluster-reboot/cdk.out | 1 - .../cdk-integ.out.cluster-reboot/integ.json | 15 - .../manifest.json | 456 ---- .../cdk-integ.out.cluster-reboot/tree.json | 2053 ----------------- 17 files changed, 4186 deletions(-) delete mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/.cache/1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e.zip delete mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/.cache/631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139.zip delete mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/.cache/8183b462910b51c368ad6760d3019ff95dbf73d5be0dc2b7dc5db48f25f8245f.zip delete mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/assertion-results.json delete mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/asset.1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e/index.ts delete mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/asset.631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139/index.ts delete mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/asset.8183b462910b51c368ad6760d3019ff95dbf73d5be0dc2b7dc5db48f25f8245f/index.ts delete mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-create.assets.json delete mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-create.template.json delete mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-update.assets.json delete mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-update.template.json delete mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets.json delete mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.template.json delete mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/cdk.out delete mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/integ.json delete mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/manifest.json delete mode 100644 packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/tree.json diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/.cache/1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e.zip b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/.cache/1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e.zip deleted file mode 100644 index 53b9773f334a9214310fbeca89c8d257ec0ce753..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4767 zcma)=XD}RG+sBEPAbJTQl3RX%*rx>jjcj z#IR?ixuVl$s~<_fl!FTn*mQ!0jSoCGYLb^_PFw9lNk0Xudj>-`eo_#GA@|M)PLm8) z29}yh`$Uk->uOoe8OXD3I!LT?&PrGqB)DHOZYS!8&Wr*5C`2`SP=plA9&>PI`9dyH z^_hsArf^?sa$Pk#cW z-8`7K=$m4m{M_BGPFcew0Y<>KA{}xpK@+xw4PY?Nx@aez!oDUG28OA&&P~<@en>5V zW*3@6mgX6G7W5E=3_%nOA(NmLlJzkCm?W-;unH0ak&jmL3O?kpwQymc=9AArlETH3 zyWJOVs&Jv07kjJ{i(UX%KoPgQp<e6ymF<7L@@n6 zEKW7pi>exH0Gfm1m$f~LtzUWZTnDZ_5ymd;ka7VR?d@bLb?%KOPz<(~U#vmH!Y8ry zZsBfMe8f!o2Xu2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v@yoG|$03nzE-YYMT6B^2*lP z!zECgEIeU7H}hVOc-hSwZ}3@rkgK8h;2cG25`Usy@W5)kb41L2zC=qH1jsy{c9i2G7f@vmN0(8*Q}^&(kQHH;igQ_B%L1p)uYcd z(Jo)J5R#MIr3pl)^jV%*GT7nUGuHm3fGsj=+| z`xBm|Z^vuvpA=$uhu-)V@!voNRDbRWyGX`Rr*B*rXj_IAI$2>@;b}g9`EM}1TW>l_ z1IpvFKDn4~GL?EOn7b=*XCPw{;CpU9+Qwn@FR)5)X6vOL37mh%Gq57a$DM+V%;q;O zF*P8+0-*Re=J`*|@(1($6Sv8V!~b;uhCctT`_Ga817ZG&KRWpD_FqWmzg7R~Pc6~_ diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/.cache/631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139.zip b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/.cache/631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139.zip deleted file mode 100644 index aacd4ffa5942e4b89d9969a41e309ab02a78d95e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4791 zcma)=cQ71Y*T=Vf7Zhg($17-j*P&2rI1KTXcyUy?3Io-r3c= zwOGNM%x|7~p7)t~XWnz>%suyy@4erD&Yig*4Iusn`WO$PkZO&GW$#m5QnjJRA)m z(cNRK{RqoH_geiajsMfxU$6f-vv*6^2f5AlJ-E&=%ii@XS<|^>ZR=t+syCvgWF@N% zmBDj#v_2E)+iKsz4UfCMlFWTX?2@*3;Gv60e};C?l!Ex~Rq=r9pGHYaNM4~9L(cZ* zw&T~Oe6p_|DuP7SPTjm}VQWJ5E5j`T9&k;hRg0fzJ7irXKeIlwUTE0(0M*HNn6x@M zPR6txRnND;al#0@MJ=8QZ*sKI{Hk?Y5&{pc(Mk!^b_tI~4=$o1}851yGF26bbQ`tW~o?eD_z@%_H7VA9| z8oUU8HFN4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p9g=mFOCSd94irw2Bz-T|s*2?@-MIysL6N^i*^2}P}@Bx4- zIp{bWw@=_REh(9AQmtPbe@*5$W)q>V1GU55#(ahnO?izza(43DI5nar!`?wuJ~sZ; z_i(k*{TZ=7K{XuTfFwoZo+bZ#ohNy7X&R_|`AbS~AI5-QZ# zkh+GQTR4H)hCmx#=i5pF4a6ZwYq|y%>TlWf_#I)_i=;O=6)7@U!I?JmC zk~uWL{J2mjXmL*WcRYPce4Xv^ac~U(P!tUyE*=2?-}vW0@ylQQ^G`g+$qV}1{Tl}T zx9&ej{x6*QC;sYE{HUF*pPbdFdWlHfcmAjh;kbv;-dH8=a@6URD|L^X909kBH A#{d8T diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/.cache/8183b462910b51c368ad6760d3019ff95dbf73d5be0dc2b7dc5db48f25f8245f.zip b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/.cache/8183b462910b51c368ad6760d3019ff95dbf73d5be0dc2b7dc5db48f25f8245f.zip deleted file mode 100644 index 7df84aa5a0c5d2fad379046c3fdc4ac867679aa4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4696 zcma)=XHXN`w#TUo3IU}=sRxlJB@_dMek3ZPNe87#?;wOE^iWh31r8uZs?uv9H0dB9 z9YP3AkSa$&N`OFs(4NkjJNLdj^Jd;!vuCgU;lJ1a%lfc>20FBK>{JZDl8Q>;*ZFr` z`Bl1kJ30kOIZFA%bt**rKz9taV0t4k32jp?@nIdQ{vn)kpVp90KTL8=OHyZ89BcH9 ziG>Us($j{G!$jas(u)t&gA=o2)fr5FNk`OX$~$4dQgM zH9u&m40J9t>^g46*#GM5`0E(_pU!@J{l}R*yu!i*KC6{@x@{XVVf`HJTTho*=rr;i zbuT31gO)ZGEWEq>B~U~24`>S~OJc|Kixa0j?vOt6@b)*+PGNj81~V{F?!JEK5wF1T zb=(LhERf{ds)$5tX1aj*d>gFun22e%Ki%21ue&XIlis*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X%zyHc-+bnu_=74x z;&=6LTJzt!|D5jM^yHuTtxNw^{)?sjx9UHg{BIRI;9n|#xPcD+rQiS2{>uDcclNd4 Gum1s1jtQUu diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/assertion-results.json b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/assertion-results.json deleted file mode 100644 index ef701a64b8137..0000000000000 --- a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/assertion-results.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "aws-cdk-redshift-cluster-reboot-integ": { - "ExportsOutputRefClusterEB0386A796A0E3FE": "clustereb0386a7-dzxalxbye79k", - "ExportsOutputRefParameterGroup5E32DECBB33EA140": "aws-cdk-redshift-cluster-reboot-integ-parametergroup5e32decb-kuykp4syd337" - } -} diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/asset.1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e/index.ts b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/asset.1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e/index.ts deleted file mode 100644 index f69314783b600..0000000000000 --- a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/asset.1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e/index.ts +++ /dev/null @@ -1,53 +0,0 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { Redshift } from 'aws-sdk'; - -const redshift = new Redshift(); - -export async function handler(event: AWSLambda.CloudFormationCustomResourceEvent): Promise { - if (event.RequestType !== 'Delete') { - return rebootClusterIfRequired(event.ResourceProperties?.ClusterId, event.ResourceProperties?.ParameterGroupName); - } else { - return; - } -} - -async function rebootClusterIfRequired(clusterId: string, parameterGroupName: string): Promise { - return executeActionForStatus(await getApplyStatus()); - - // https://docs.aws.amazon.com/redshift/latest/APIReference/API_ClusterParameterStatus.html - async function executeActionForStatus(status: string, retryDurationMs?: number): Promise { - await sleep(retryDurationMs ?? 0); - if (['pending-reboot', 'apply-deferred', 'apply-error', 'unknown-error'].includes(status)) { - try { - await redshift.rebootCluster({ ClusterIdentifier: clusterId }).promise(); - } catch (err) { - if ((err).code === 'InvalidClusterState') { - return await executeActionForStatus(status, 30000); - } else { - throw err; - } - } - return; - } else if (['applying', 'retry'].includes(status)) { - return executeActionForStatus(await getApplyStatus(), 30000); - } - return; - } - - async function getApplyStatus(): Promise { - const clusterDetails = await redshift.describeClusters({ ClusterIdentifier: clusterId }).promise(); - if (clusterDetails.Clusters?.[0].ClusterParameterGroups === undefined) { - throw new Error(`Unable to find any Parameter Groups associated with ClusterId "${clusterId}".`); - } - for (const group of clusterDetails.Clusters?.[0].ClusterParameterGroups) { - if (group.ParameterGroupName === parameterGroupName) { - return group.ParameterApplyStatus ?? 'retry'; - } - } - throw new Error(`Unable to find Parameter Group named "${parameterGroupName}" associated with ClusterId "${clusterId}".`); - } -} - -function sleep(ms: number) { - return new Promise(resolve => setTimeout(resolve, ms)); -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/asset.631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139/index.ts b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/asset.631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139/index.ts deleted file mode 100644 index f69314783b600..0000000000000 --- a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/asset.631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139/index.ts +++ /dev/null @@ -1,53 +0,0 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { Redshift } from 'aws-sdk'; - -const redshift = new Redshift(); - -export async function handler(event: AWSLambda.CloudFormationCustomResourceEvent): Promise { - if (event.RequestType !== 'Delete') { - return rebootClusterIfRequired(event.ResourceProperties?.ClusterId, event.ResourceProperties?.ParameterGroupName); - } else { - return; - } -} - -async function rebootClusterIfRequired(clusterId: string, parameterGroupName: string): Promise { - return executeActionForStatus(await getApplyStatus()); - - // https://docs.aws.amazon.com/redshift/latest/APIReference/API_ClusterParameterStatus.html - async function executeActionForStatus(status: string, retryDurationMs?: number): Promise { - await sleep(retryDurationMs ?? 0); - if (['pending-reboot', 'apply-deferred', 'apply-error', 'unknown-error'].includes(status)) { - try { - await redshift.rebootCluster({ ClusterIdentifier: clusterId }).promise(); - } catch (err) { - if ((err).code === 'InvalidClusterState') { - return await executeActionForStatus(status, 30000); - } else { - throw err; - } - } - return; - } else if (['applying', 'retry'].includes(status)) { - return executeActionForStatus(await getApplyStatus(), 30000); - } - return; - } - - async function getApplyStatus(): Promise { - const clusterDetails = await redshift.describeClusters({ ClusterIdentifier: clusterId }).promise(); - if (clusterDetails.Clusters?.[0].ClusterParameterGroups === undefined) { - throw new Error(`Unable to find any Parameter Groups associated with ClusterId "${clusterId}".`); - } - for (const group of clusterDetails.Clusters?.[0].ClusterParameterGroups) { - if (group.ParameterGroupName === parameterGroupName) { - return group.ParameterApplyStatus ?? 'retry'; - } - } - throw new Error(`Unable to find Parameter Group named "${parameterGroupName}" associated with ClusterId "${clusterId}".`); - } -} - -function sleep(ms: number) { - return new Promise(resolve => setTimeout(resolve, ms)); -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/asset.8183b462910b51c368ad6760d3019ff95dbf73d5be0dc2b7dc5db48f25f8245f/index.ts b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/asset.8183b462910b51c368ad6760d3019ff95dbf73d5be0dc2b7dc5db48f25f8245f/index.ts deleted file mode 100644 index 0cb4873f138c0..0000000000000 --- a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/asset.8183b462910b51c368ad6760d3019ff95dbf73d5be0dc2b7dc5db48f25f8245f/index.ts +++ /dev/null @@ -1,54 +0,0 @@ -// eslint-disable-next-line import/no-extraneous-dependencies -import { Redshift } from 'aws-sdk'; - -const redshift = new Redshift(); - -export async function handler(event: AWSLambda.CloudFormationCustomResourceEvent): Promise { - if (event.RequestType !== 'Delete') { - return rebootClusterIfRequired(event.ResourceProperties?.ClusterId, event.ResourceProperties?.ParameterGroupName); - } else { - return; - } -} - -async function rebootClusterIfRequired(clusterId: string, parameterGroupName: string) { - return executeActionForStatus(await getApplyStatus()); - - // https://docs.aws.amazon.com/redshift/latest/APIReference/API_ClusterParameterStatus.html - async function executeActionForStatus(status: string): Promise { - if (['pending-reboot', 'apply-deferred', 'apply-error', 'unknown-error'].includes(status)) { - try { - await redshift.rebootCluster({ ClusterIdentifier: clusterId }).promise(); - } catch (err) { - if ((err).code === 'InvalidClusterState') { - await sleep(60000); - return await executeActionForStatus(await getApplyStatus()); - } else { - throw err; - } - } - return; - } else if (['applying', 'retry'].includes(status)) { - await sleep(60000); - return executeActionForStatus(await getApplyStatus()); - } - return; - } - - async function getApplyStatus(): Promise { - const clusterDetails = await redshift.describeClusters({ ClusterIdentifier: clusterId }).promise(); - if (clusterDetails.Clusters?.[0].ClusterParameterGroups === undefined) { - throw new Error(`Unable to find any Parameter Groups associated with ClusterId "${clusterId}".`); - } - for (const group of clusterDetails.Clusters?.[0].ClusterParameterGroups) { - if (group.ParameterGroupName === parameterGroupName) { - return group.ParameterApplyStatus ?? 'retry'; - } - } - throw new Error(`Unable to find Parameter Group named "${parameterGroupName}" associated with ClusterId "${clusterId}".`); - } -} - -function sleep(ms: number) { - return new Promise(resolve => setTimeout(resolve, ms)); -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-create.assets.json b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-create.assets.json deleted file mode 100644 index 20e9342765604..0000000000000 --- a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-create.assets.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "version": "21.0.0", - "files": { - "631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139": { - "source": { - "path": "asset.631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671": { - "source": { - "path": "asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "42ff6c40ab2191a9f141b53cff77b4d1a253b7af577e2d0c9a196cdc4316ee2f": { - "source": { - "path": "aws-cdk-redshift-cluster-create.template.json", - "packaging": "file" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "42ff6c40ab2191a9f141b53cff77b4d1a253b7af577e2d0c9a196cdc4316ee2f.json", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - } - }, - "dockerImages": {} -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-create.template.json b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-create.template.json deleted file mode 100644 index ccdc27a353cd3..0000000000000 --- a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-create.template.json +++ /dev/null @@ -1,564 +0,0 @@ -{ - "Resources": { - "Vpc8378EB38": { - "Type": "AWS::EC2::VPC", - "Properties": { - "CidrBlock": "10.0.0.0/16", - "EnableDnsHostnames": true, - "EnableDnsSupport": true, - "InstanceTenancy": "default", - "Tags": [ - { - "Key": "Name", - "Value": "aws-cdk-redshift-cluster-create/Vpc" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "VpcfoobarSubnet1Subnet77A7FDC6": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "Vpc8378EB38" - }, - "AvailabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.0.0/17", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "foobar" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Isolated" - }, - { - "Key": "Name", - "Value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "VpcfoobarSubnet1RouteTableAF4E5874": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "Vpc8378EB38" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "VpcfoobarSubnet1RouteTableAssociation502CBE55": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "VpcfoobarSubnet1RouteTableAF4E5874" - }, - "SubnetId": { - "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "VpcfoobarSubnet2Subnet85B013AD": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "Vpc8378EB38" - }, - "AvailabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.128.0/17", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "foobar" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Isolated" - }, - { - "Key": "Name", - "Value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "VpcfoobarSubnet2RouteTable5127598D": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "Vpc8378EB38" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "VpcfoobarSubnet2RouteTableAssociation5013D70B": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "VpcfoobarSubnet2RouteTable5127598D" - }, - "SubnetId": { - "Ref": "VpcfoobarSubnet2Subnet85B013AD" - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ParameterGroup5E32DECB": { - "Type": "AWS::Redshift::ClusterParameterGroup", - "Properties": { - "Description": "Cluster parameter group for family redshift-1.0", - "ParameterGroupFamily": "redshift-1.0", - "Parameters": [ - { - "ParameterName": "enable_user_activity_logging", - "ParameterValue": "true" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ClusterSubnetsDCFA5CB7": { - "Type": "AWS::Redshift::ClusterSubnetGroup", - "Properties": { - "Description": "Subnets for Cluster Redshift cluster", - "SubnetIds": [ - { - "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" - }, - { - "Ref": "VpcfoobarSubnet2Subnet85B013AD" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ClusterSecurityGroup0921994B": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "Redshift security group", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ClusterSecret6368BD0F": { - "Type": "AWS::SecretsManager::Secret", - "Properties": { - "GenerateSecretString": { - "ExcludeCharacters": "\"@/\\ '", - "GenerateStringKey": "password", - "PasswordLength": 30, - "SecretStringTemplate": "{\"username\":\"admin\"}" - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ClusterSecretAttachment769E6258": { - "Type": "AWS::SecretsManager::SecretTargetAttachment", - "Properties": { - "SecretId": { - "Ref": "ClusterSecret6368BD0F" - }, - "TargetId": { - "Ref": "ClusterEB0386A7" - }, - "TargetType": "AWS::Redshift::Cluster" - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ClusterEB0386A7": { - "Type": "AWS::Redshift::Cluster", - "Properties": { - "ClusterType": "multi-node", - "DBName": "default_db", - "MasterUsername": { - "Fn::Join": [ - "", - [ - "{{resolve:secretsmanager:", - { - "Ref": "ClusterSecret6368BD0F" - }, - ":SecretString:username::}}" - ] - ] - }, - "MasterUserPassword": { - "Fn::Join": [ - "", - [ - "{{resolve:secretsmanager:", - { - "Ref": "ClusterSecret6368BD0F" - }, - ":SecretString:password::}}" - ] - ] - }, - "NodeType": "dc2.large", - "AllowVersionUpgrade": true, - "AutomatedSnapshotRetentionPeriod": 1, - "ClusterParameterGroupName": { - "Ref": "ParameterGroup5E32DECB" - }, - "ClusterSubnetGroupName": { - "Ref": "ClusterSubnetsDCFA5CB7" - }, - "Encrypted": true, - "NumberOfNodes": 2, - "PubliclyAccessible": false, - "VpcSecurityGroupIds": [ - { - "Fn::GetAtt": [ - "ClusterSecurityGroup0921994B", - "GroupId" - ] - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "lambda:InvokeFunction", - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", - "Arn" - ] - }, - { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", - "Arn" - ] - }, - ":*" - ] - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", - "Roles": [ - { - "Ref": "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ClusterResourceProviderframeworkonEvent15BB3722": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671.zip" - }, - "Role": { - "Fn::GetAtt": [ - "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE", - "Arn" - ] - }, - "Description": "AWS CDK resource provider framework - onEvent (aws-cdk-redshift-cluster-create/Cluster/ResourceProvider)", - "Environment": { - "Variables": { - "USER_ON_EVENT_FUNCTION_ARN": { - "Fn::GetAtt": [ - "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", - "Arn" - ] - } - } - }, - "Handler": "framework.onEvent", - "Runtime": "nodejs14.x", - "Timeout": 900 - }, - "DependsOn": [ - "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", - "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" - ], - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ClusterRedshiftClusterRebooterCustomResource773361E1": { - "Type": "Custom::RedshiftClusterRebooter", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "ClusterResourceProviderframeworkonEvent15BB3722", - "Arn" - ] - }, - "ClusterId": { - "Ref": "ClusterEB0386A7" - }, - "ParameterGroupName": { - "Ref": "ParameterGroup5E32DECB" - }, - "ParametersString": "{\"enable_user_activity_logging\":\"true\"}" - }, - "DependsOn": [ - "ClusterEB0386A7", - "ClusterResourceProviderframeworkonEvent15BB3722", - "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", - "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE", - "ClusterSecretAttachment769E6258", - "ClusterSecret6368BD0F", - "ClusterSecurityGroup0921994B", - "ClusterSubnetsDCFA5CB7", - "ParameterGroup5E32DECB" - ], - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "redshift:DescribeClusters", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": "redshift:RebootCluster", - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":redshift:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":cluster:", - { - "Ref": "ClusterEB0386A7" - } - ] - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF", - "Roles": [ - { - "Ref": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139.zip" - }, - "Role": { - "Fn::GetAtt": [ - "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525", - "Arn" - ] - }, - "Handler": "index.handler", - "Runtime": "nodejs16.x", - "Timeout": 900 - }, - "DependsOn": [ - "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF", - "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" - ], - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - } - }, - "Parameters": { - "BootstrapVersion": { - "Type": "AWS::SSM::Parameter::Value", - "Default": "/cdk-bootstrap/hnb659fds/version", - "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" - } - }, - "Rules": { - "CheckBootstrapVersion": { - "Assertions": [ - { - "Assert": { - "Fn::Not": [ - { - "Fn::Contains": [ - [ - "1", - "2", - "3", - "4", - "5" - ], - { - "Ref": "BootstrapVersion" - } - ] - } - ] - }, - "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." - } - ] - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-update.assets.json b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-update.assets.json deleted file mode 100644 index 1b7136f7c2e27..0000000000000 --- a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-update.assets.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "version": "21.0.0", - "files": { - "631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139": { - "source": { - "path": "asset.631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671": { - "source": { - "path": "asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "4062cab3dd20bc5e69e0a94b9151bea5b695c4d9c7db1766fe1d47cf14eb3a9f": { - "source": { - "path": "aws-cdk-redshift-cluster-update.template.json", - "packaging": "file" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "4062cab3dd20bc5e69e0a94b9151bea5b695c4d9c7db1766fe1d47cf14eb3a9f.json", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - } - }, - "dockerImages": {} -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-update.template.json b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-update.template.json deleted file mode 100644 index 3877089639ae5..0000000000000 --- a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/aws-cdk-redshift-cluster-update.template.json +++ /dev/null @@ -1,586 +0,0 @@ -{ - "Resources": { - "Vpc8378EB38": { - "Type": "AWS::EC2::VPC", - "Properties": { - "CidrBlock": "10.0.0.0/16", - "EnableDnsHostnames": true, - "EnableDnsSupport": true, - "InstanceTenancy": "default", - "Tags": [ - { - "Key": "Name", - "Value": "aws-cdk-redshift-cluster-update/Vpc" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "VpcfoobarSubnet1Subnet77A7FDC6": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "Vpc8378EB38" - }, - "AvailabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.0.0/17", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "foobar" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Isolated" - }, - { - "Key": "Name", - "Value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "VpcfoobarSubnet1RouteTableAF4E5874": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "Vpc8378EB38" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "VpcfoobarSubnet1RouteTableAssociation502CBE55": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "VpcfoobarSubnet1RouteTableAF4E5874" - }, - "SubnetId": { - "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "VpcfoobarSubnet2Subnet85B013AD": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "Vpc8378EB38" - }, - "AvailabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.128.0/17", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "foobar" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Isolated" - }, - { - "Key": "Name", - "Value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "VpcfoobarSubnet2RouteTable5127598D": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "Vpc8378EB38" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "VpcfoobarSubnet2RouteTableAssociation5013D70B": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "VpcfoobarSubnet2RouteTable5127598D" - }, - "SubnetId": { - "Ref": "VpcfoobarSubnet2Subnet85B013AD" - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ParameterGroup5E32DECB": { - "Type": "AWS::Redshift::ClusterParameterGroup", - "Properties": { - "Description": "Cluster parameter group for family redshift-1.0", - "ParameterGroupFamily": "redshift-1.0", - "Parameters": [ - { - "ParameterName": "enable_user_activity_logging", - "ParameterValue": "false" - }, - { - "ParameterName": "use_fips_ssl", - "ParameterValue": "true" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ClusterSubnetsDCFA5CB7": { - "Type": "AWS::Redshift::ClusterSubnetGroup", - "Properties": { - "Description": "Subnets for Cluster Redshift cluster", - "SubnetIds": [ - { - "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" - }, - { - "Ref": "VpcfoobarSubnet2Subnet85B013AD" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ClusterSecurityGroup0921994B": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "Redshift security group", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ClusterSecret6368BD0F": { - "Type": "AWS::SecretsManager::Secret", - "Properties": { - "GenerateSecretString": { - "ExcludeCharacters": "\"@/\\ '", - "GenerateStringKey": "password", - "PasswordLength": 30, - "SecretStringTemplate": "{\"username\":\"admin\"}" - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ClusterSecretAttachment769E6258": { - "Type": "AWS::SecretsManager::SecretTargetAttachment", - "Properties": { - "SecretId": { - "Ref": "ClusterSecret6368BD0F" - }, - "TargetId": { - "Ref": "ClusterEB0386A7" - }, - "TargetType": "AWS::Redshift::Cluster" - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ClusterEB0386A7": { - "Type": "AWS::Redshift::Cluster", - "Properties": { - "ClusterType": "multi-node", - "DBName": "default_db", - "MasterUsername": { - "Fn::Join": [ - "", - [ - "{{resolve:secretsmanager:", - { - "Ref": "ClusterSecret6368BD0F" - }, - ":SecretString:username::}}" - ] - ] - }, - "MasterUserPassword": { - "Fn::Join": [ - "", - [ - "{{resolve:secretsmanager:", - { - "Ref": "ClusterSecret6368BD0F" - }, - ":SecretString:password::}}" - ] - ] - }, - "NodeType": "dc2.large", - "AllowVersionUpgrade": true, - "AutomatedSnapshotRetentionPeriod": 1, - "ClusterParameterGroupName": { - "Ref": "ParameterGroup5E32DECB" - }, - "ClusterSubnetGroupName": { - "Ref": "ClusterSubnetsDCFA5CB7" - }, - "Encrypted": true, - "NumberOfNodes": 2, - "PubliclyAccessible": false, - "VpcSecurityGroupIds": [ - { - "Fn::GetAtt": [ - "ClusterSecurityGroup0921994B", - "GroupId" - ] - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "lambda:InvokeFunction", - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", - "Arn" - ] - }, - { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", - "Arn" - ] - }, - ":*" - ] - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", - "Roles": [ - { - "Ref": "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ClusterResourceProviderframeworkonEvent15BB3722": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671.zip" - }, - "Role": { - "Fn::GetAtt": [ - "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE", - "Arn" - ] - }, - "Description": "AWS CDK resource provider framework - onEvent (aws-cdk-redshift-cluster-update/Cluster/ResourceProvider)", - "Environment": { - "Variables": { - "USER_ON_EVENT_FUNCTION_ARN": { - "Fn::GetAtt": [ - "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", - "Arn" - ] - } - } - }, - "Handler": "framework.onEvent", - "Runtime": "nodejs14.x", - "Timeout": 900 - }, - "DependsOn": [ - "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", - "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" - ], - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "ClusterRedshiftClusterRebooterCustomResource773361E1": { - "Type": "Custom::RedshiftClusterRebooter", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "ClusterResourceProviderframeworkonEvent15BB3722", - "Arn" - ] - }, - "ClusterId": { - "Ref": "ClusterEB0386A7" - }, - "ParameterGroupName": { - "Ref": "ParameterGroup5E32DECB" - }, - "ParametersString": "{\"enable_user_activity_logging\":\"false\",\"use_fips_ssl\":\"true\"}" - }, - "DependsOn": [ - "ClusterEB0386A7", - "ClusterResourceProviderframeworkonEvent15BB3722", - "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", - "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE", - "ClusterSecretAttachment769E6258", - "ClusterSecret6368BD0F", - "ClusterSecurityGroup0921994B", - "ClusterSubnetsDCFA5CB7", - "ParameterGroup5E32DECB" - ], - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "redshift:DescribeClusters", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": "redshift:RebootCluster", - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":redshift:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":cluster:", - { - "Ref": "ClusterEB0386A7" - } - ] - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF", - "Roles": [ - { - "Ref": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" - } - ] - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139.zip" - }, - "Role": { - "Fn::GetAtt": [ - "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525", - "Arn" - ] - }, - "Handler": "index.handler", - "Runtime": "nodejs16.x", - "Timeout": 900 - }, - "DependsOn": [ - "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF", - "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" - ], - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - } - }, - "Outputs": { - "ExportsOutputRefClusterEB0386A796A0E3FE": { - "Value": { - "Ref": "ClusterEB0386A7" - }, - "Export": { - "Name": "aws-cdk-redshift-cluster-reboot-integ:ExportsOutputRefClusterEB0386A796A0E3FE" - } - }, - "ExportsOutputRefParameterGroup5E32DECBB33EA140": { - "Value": { - "Ref": "ParameterGroup5E32DECB" - }, - "Export": { - "Name": "aws-cdk-redshift-cluster-reboot-integ:ExportsOutputRefParameterGroup5E32DECBB33EA140" - } - } - }, - "Parameters": { - "BootstrapVersion": { - "Type": "AWS::SSM::Parameter::Value", - "Default": "/cdk-bootstrap/hnb659fds/version", - "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" - } - }, - "Rules": { - "CheckBootstrapVersion": { - "Assertions": [ - { - "Assert": { - "Fn::Not": [ - { - "Fn::Contains": [ - [ - "1", - "2", - "3", - "4", - "5" - ], - { - "Ref": "BootstrapVersion" - } - ] - } - ] - }, - "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." - } - ] - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets.json b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets.json deleted file mode 100644 index 49b3216944ef6..0000000000000 --- a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "version": "21.0.0", - "files": { - "cc285c12352e5d673e6d5211dd6501a7b0ee8bddd523859315e7de7b6f8e1413": { - "source": { - "path": "asset.cc285c12352e5d673e6d5211dd6501a7b0ee8bddd523859315e7de7b6f8e1413.bundle", - "packaging": "zip" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "cc285c12352e5d673e6d5211dd6501a7b0ee8bddd523859315e7de7b6f8e1413.zip", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - }, - "cc872b6636791e21375ffe5928596992198eeeb20fd5cfc55a9085d340b4cb24": { - "source": { - "path": "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.template.json", - "packaging": "file" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "cc872b6636791e21375ffe5928596992198eeeb20fd5cfc55a9085d340b4cb24.json", - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" - } - } - } - }, - "dockerImages": {} -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.template.json b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.template.json deleted file mode 100644 index 0c780bfaed04f..0000000000000 --- a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.template.json +++ /dev/null @@ -1,223 +0,0 @@ -{ - "Resources": { - "AwsApiCallRedshiftdescribeClusters1": { - "Type": "Custom::DeployAssertSdkCallRedshiftdescribeClusters", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", - "Arn" - ] - }, - "service": "Redshift", - "api": "describeClusters", - "parameters": { - "ClusterIdentifier": { - "Fn::ImportValue": "aws-cdk-redshift-cluster-reboot-integ:ExportsOutputRefClusterEB0386A796A0E3FE" - } - }, - "flattenResponse": "false", - "salt": "1663270532954" - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "AwsApiCallRedshiftdescribeClusters1AssertEqualsRedshiftdescribeClusters7634D4CC": { - "Type": "Custom::DeployAssertAssertEquals", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", - "Arn" - ] - }, - "actual": { - "Fn::GetAtt": [ - "AwsApiCallRedshiftdescribeClusters1", - "apiCallResponse" - ] - }, - "expected": { - "Fn::Join": [ - "", - [ - "{\"$ObjectLike\":{\"ParameterGroupName\":\"", - { - "Fn::ImportValue": "aws-cdk-redshift-cluster-reboot-integ:ExportsOutputRefParameterGroup5E32DECBB33EA140" - }, - "\",\"ParameterApplyStatus\":\"in-sync\"}}" - ] - ] - }, - "salt": "1663270532954" - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Version": "2012-10-17", - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ] - }, - "ManagedPolicyArns": [ - { - "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - } - ], - "Policies": [ - { - "PolicyName": "Inline", - "PolicyDocument": { - "Version": "2012-10-17", - "Statement": [ - { - "Action": [ - "redshift:DescribeClusters" - ], - "Effect": "Allow", - "Resource": [ - "*" - ] - }, - { - "Action": [ - "redshift:DescribeClusterParameters" - ], - "Effect": "Allow", - "Resource": [ - "*" - ] - } - ] - } - } - ] - } - }, - "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Runtime": "nodejs14.x", - "Code": { - "S3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "S3Key": "cc285c12352e5d673e6d5211dd6501a7b0ee8bddd523859315e7de7b6f8e1413.zip" - }, - "Timeout": 120, - "Handler": "index.handler", - "Role": { - "Fn::GetAtt": [ - "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", - "Arn" - ] - } - } - }, - "AwsApiCallRedshiftdescribeClusterParameters1": { - "Type": "Custom::DeployAssertSdkCallRedshiftdescribeClusterParameters", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", - "Arn" - ] - }, - "service": "Redshift", - "api": "describeClusterParameters", - "parameters": { - "ParameterGroupName": { - "Fn::ImportValue": "aws-cdk-redshift-cluster-reboot-integ:ExportsOutputRefParameterGroup5E32DECBB33EA140" - } - }, - "flattenResponse": "false", - "salt": "1663270532954" - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "AwsApiCallRedshiftdescribeClusterParameters1AssertEqualsRedshiftdescribeClusterParameters8AB3F568": { - "Type": "Custom::DeployAssertAssertEquals", - "Properties": { - "ServiceToken": { - "Fn::GetAtt": [ - "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", - "Arn" - ] - }, - "actual": { - "Fn::GetAtt": [ - "AwsApiCallRedshiftdescribeClusterParameters1", - "apiCallResponse" - ] - }, - "expected": "{\"$ArrayWith\":[{\"result\":\"{\\\"$ObjectLike\\\":{\\\"ParameterName\\\":\\\"enable_user_activity_logging\\\",\\\"ParameterValue\\\":\\\"false\\\"}}\"},{\"result\":\"{\\\"$ObjectLike\\\":{\\\"ParameterName\\\":\\\"use_fips_ssl\\\",\\\"ParameterValue\\\":\\\"true\\\"}}\"}]}", - "salt": "1663270532954" - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - } - }, - "Outputs": { - "AssertionResultsAssertEqualsRedshiftdescribeClusters40c948a44d1ec8afa7d4c9c91028e79b": { - "Value": { - "Fn::GetAtt": [ - "AwsApiCallRedshiftdescribeClusters1AssertEqualsRedshiftdescribeClusters7634D4CC", - "data" - ] - } - }, - "AssertionResultsAssertEqualsRedshiftdescribeClusterParametersbf6470e1bedcd5ee147ac37ef100e38d": { - "Value": { - "Fn::GetAtt": [ - "AwsApiCallRedshiftdescribeClusterParameters1AssertEqualsRedshiftdescribeClusterParameters8AB3F568", - "data" - ] - } - } - }, - "Parameters": { - "BootstrapVersion": { - "Type": "AWS::SSM::Parameter::Value", - "Default": "/cdk-bootstrap/hnb659fds/version", - "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" - } - }, - "Rules": { - "CheckBootstrapVersion": { - "Assertions": [ - { - "Assert": { - "Fn::Not": [ - { - "Fn::Contains": [ - [ - "1", - "2", - "3", - "4", - "5" - ], - { - "Ref": "BootstrapVersion" - } - ] - } - ] - }, - "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." - } - ] - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/cdk.out b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/cdk.out deleted file mode 100644 index 8ecc185e9dbee..0000000000000 --- a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/cdk.out +++ /dev/null @@ -1 +0,0 @@ -{"version":"21.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/integ.json b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/integ.json deleted file mode 100644 index ce760b7e44b28..0000000000000 --- a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/integ.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "version": "21.0.0", - "testCases": { - "aws-cdk-redshift-reboot-test/DefaultTest": { - "stacks": [ - "aws-cdk-redshift-cluster-create", - "aws-cdk-redshift-cluster-update" - ], - "diffAssets": true, - "stackUpdateWorkflow": true, - "assertionStack": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert", - "assertionStackName": "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/manifest.json b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/manifest.json deleted file mode 100644 index c22e6c57d50d8..0000000000000 --- a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/manifest.json +++ /dev/null @@ -1,456 +0,0 @@ -{ - "version": "21.0.0", - "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, - "aws-cdk-redshift-cluster-create.assets": { - "type": "cdk:asset-manifest", - "properties": { - "file": "aws-cdk-redshift-cluster-create.assets.json", - "requiresBootstrapStackVersion": 6, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" - } - }, - "aws-cdk-redshift-cluster-create": { - "type": "aws:cloudformation:stack", - "environment": "aws://unknown-account/unknown-region", - "properties": { - "templateFile": "aws-cdk-redshift-cluster-create.template.json", - "validateOnSynth": false, - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", - "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/42ff6c40ab2191a9f141b53cff77b4d1a253b7af577e2d0c9a196cdc4316ee2f.json", - "requiresBootstrapStackVersion": 6, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", - "additionalDependencies": [ - "aws-cdk-redshift-cluster-create.assets" - ], - "lookupRole": { - "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", - "requiresBootstrapStackVersion": 8, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" - }, - "stackName": "aws-cdk-redshift-cluster-reboot-integ" - }, - "dependencies": [ - "aws-cdk-redshift-cluster-create.assets" - ], - "metadata": { - "/aws-cdk-redshift-cluster-create/Vpc/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "Vpc8378EB38" - } - ], - "/aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcfoobarSubnet1Subnet77A7FDC6" - } - ], - "/aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcfoobarSubnet1RouteTableAF4E5874" - } - ], - "/aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcfoobarSubnet1RouteTableAssociation502CBE55" - } - ], - "/aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcfoobarSubnet2Subnet85B013AD" - } - ], - "/aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcfoobarSubnet2RouteTable5127598D" - } - ], - "/aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcfoobarSubnet2RouteTableAssociation5013D70B" - } - ], - "/aws-cdk-redshift-cluster-create/ParameterGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ParameterGroup5E32DECB" - } - ], - "/aws-cdk-redshift-cluster-create/Cluster/Subnets/Default": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterSubnetsDCFA5CB7" - } - ], - "/aws-cdk-redshift-cluster-create/Cluster/SecurityGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterSecurityGroup0921994B" - } - ], - "/aws-cdk-redshift-cluster-create/Cluster/Secret/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterSecret6368BD0F" - } - ], - "/aws-cdk-redshift-cluster-create/Cluster/Secret/Attachment/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterSecretAttachment769E6258" - } - ], - "/aws-cdk-redshift-cluster-create/Cluster/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterEB0386A7" - } - ], - "/aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/ServiceRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" - } - ], - "/aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86" - } - ], - "/aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterResourceProviderframeworkonEvent15BB3722" - } - ], - "/aws-cdk-redshift-cluster-create/Cluster/RedshiftClusterRebooterCustomResource/Default": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterRedshiftClusterRebooterCustomResource773361E1" - } - ], - "/aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" - } - ], - "/aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/DefaultPolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF" - } - ], - "/aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5" - } - ], - "/aws-cdk-redshift-cluster-create/BootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "BootstrapVersion" - } - ], - "/aws-cdk-redshift-cluster-create/CheckBootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "CheckBootstrapVersion" - } - ] - }, - "displayName": "aws-cdk-redshift-cluster-create" - }, - "aws-cdk-redshift-cluster-update.assets": { - "type": "cdk:asset-manifest", - "properties": { - "file": "aws-cdk-redshift-cluster-update.assets.json", - "requiresBootstrapStackVersion": 6, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" - } - }, - "aws-cdk-redshift-cluster-update": { - "type": "aws:cloudformation:stack", - "environment": "aws://unknown-account/unknown-region", - "properties": { - "templateFile": "aws-cdk-redshift-cluster-update.template.json", - "validateOnSynth": false, - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", - "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/4062cab3dd20bc5e69e0a94b9151bea5b695c4d9c7db1766fe1d47cf14eb3a9f.json", - "requiresBootstrapStackVersion": 6, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", - "additionalDependencies": [ - "aws-cdk-redshift-cluster-update.assets" - ], - "lookupRole": { - "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", - "requiresBootstrapStackVersion": 8, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" - }, - "stackName": "aws-cdk-redshift-cluster-reboot-integ" - }, - "dependencies": [ - "aws-cdk-redshift-cluster-create", - "aws-cdk-redshift-cluster-update.assets" - ], - "metadata": { - "/aws-cdk-redshift-cluster-update/Vpc/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "Vpc8378EB38" - } - ], - "/aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcfoobarSubnet1Subnet77A7FDC6" - } - ], - "/aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcfoobarSubnet1RouteTableAF4E5874" - } - ], - "/aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcfoobarSubnet1RouteTableAssociation502CBE55" - } - ], - "/aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcfoobarSubnet2Subnet85B013AD" - } - ], - "/aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcfoobarSubnet2RouteTable5127598D" - } - ], - "/aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcfoobarSubnet2RouteTableAssociation5013D70B" - } - ], - "/aws-cdk-redshift-cluster-update/ParameterGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ParameterGroup5E32DECB" - } - ], - "/aws-cdk-redshift-cluster-update/Cluster/Subnets/Default": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterSubnetsDCFA5CB7" - } - ], - "/aws-cdk-redshift-cluster-update/Cluster/SecurityGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterSecurityGroup0921994B" - } - ], - "/aws-cdk-redshift-cluster-update/Cluster/Secret/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterSecret6368BD0F" - } - ], - "/aws-cdk-redshift-cluster-update/Cluster/Secret/Attachment/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterSecretAttachment769E6258" - } - ], - "/aws-cdk-redshift-cluster-update/Cluster/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterEB0386A7" - } - ], - "/aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/ServiceRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" - } - ], - "/aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86" - } - ], - "/aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterResourceProviderframeworkonEvent15BB3722" - } - ], - "/aws-cdk-redshift-cluster-update/Cluster/RedshiftClusterRebooterCustomResource/Default": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterRedshiftClusterRebooterCustomResource773361E1" - } - ], - "/aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" - } - ], - "/aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/DefaultPolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF" - } - ], - "/aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5" - } - ], - "/aws-cdk-redshift-cluster-update/Exports/Output{\"Ref\":\"ClusterEB0386A7\"}": [ - { - "type": "aws:cdk:logicalId", - "data": "ExportsOutputRefClusterEB0386A796A0E3FE" - } - ], - "/aws-cdk-redshift-cluster-update/Exports/Output{\"Ref\":\"ParameterGroup5E32DECB\"}": [ - { - "type": "aws:cdk:logicalId", - "data": "ExportsOutputRefParameterGroup5E32DECBB33EA140" - } - ], - "/aws-cdk-redshift-cluster-update/BootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "BootstrapVersion" - } - ], - "/aws-cdk-redshift-cluster-update/CheckBootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "CheckBootstrapVersion" - } - ] - }, - "displayName": "aws-cdk-redshift-cluster-update" - }, - "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets": { - "type": "cdk:asset-manifest", - "properties": { - "file": "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets.json", - "requiresBootstrapStackVersion": 6, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" - } - }, - "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34": { - "type": "aws:cloudformation:stack", - "environment": "aws://unknown-account/unknown-region", - "properties": { - "templateFile": "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.template.json", - "validateOnSynth": false, - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", - "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/cc872b6636791e21375ffe5928596992198eeeb20fd5cfc55a9085d340b4cb24.json", - "requiresBootstrapStackVersion": 6, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", - "additionalDependencies": [ - "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets" - ], - "lookupRole": { - "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", - "requiresBootstrapStackVersion": 8, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" - } - }, - "dependencies": [ - "aws-cdk-redshift-cluster-update", - "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets" - ], - "metadata": { - "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1/Default/Default": [ - { - "type": "aws:cdk:logicalId", - "data": "AwsApiCallRedshiftdescribeClusters1" - } - ], - "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1/AssertEqualsRedshiftdescribeClusters/Default/Default": [ - { - "type": "aws:cdk:logicalId", - "data": "AwsApiCallRedshiftdescribeClusters1AssertEqualsRedshiftdescribeClusters7634D4CC" - } - ], - "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1/AssertEqualsRedshiftdescribeClusters/AssertionResults": [ - { - "type": "aws:cdk:logicalId", - "data": "AssertionResultsAssertEqualsRedshiftdescribeClusters40c948a44d1ec8afa7d4c9c91028e79b" - } - ], - "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role": [ - { - "type": "aws:cdk:logicalId", - "data": "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73" - } - ], - "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler": [ - { - "type": "aws:cdk:logicalId", - "data": "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F" - } - ], - "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1/Default/Default": [ - { - "type": "aws:cdk:logicalId", - "data": "AwsApiCallRedshiftdescribeClusterParameters1" - } - ], - "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1/AssertEqualsRedshiftdescribeClusterParameters/Default/Default": [ - { - "type": "aws:cdk:logicalId", - "data": "AwsApiCallRedshiftdescribeClusterParameters1AssertEqualsRedshiftdescribeClusterParameters8AB3F568" - } - ], - "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1/AssertEqualsRedshiftdescribeClusterParameters/AssertionResults": [ - { - "type": "aws:cdk:logicalId", - "data": "AssertionResultsAssertEqualsRedshiftdescribeClusterParametersbf6470e1bedcd5ee147ac37ef100e38d" - } - ], - "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/BootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "BootstrapVersion" - } - ], - "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/CheckBootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "CheckBootstrapVersion" - } - ] - }, - "displayName": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/tree.json b/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/tree.json deleted file mode 100644 index e2e0e4e6ab95a..0000000000000 --- a/packages/@aws-cdk/aws-redshift/test/cdk-integ.out.cluster-reboot/tree.json +++ /dev/null @@ -1,2053 +0,0 @@ -{ - "version": "tree-0.1", - "tree": { - "id": "App", - "path": "", - "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.92" - } - }, - "aws-cdk-redshift-cluster-create": { - "id": "aws-cdk-redshift-cluster-create", - "path": "aws-cdk-redshift-cluster-create", - "children": { - "Vpc": { - "id": "Vpc", - "path": "aws-cdk-redshift-cluster-create/Vpc", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-cdk-redshift-cluster-create/Vpc/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::VPC", - "aws:cdk:cloudformation:props": { - "cidrBlock": "10.0.0.0/16", - "enableDnsHostnames": true, - "enableDnsSupport": true, - "instanceTenancy": "default", - "tags": [ - { - "key": "Name", - "value": "aws-cdk-redshift-cluster-create/Vpc" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnVPC", - "version": "0.0.0" - } - }, - "foobarSubnet1": { - "id": "foobarSubnet1", - "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "Vpc8378EB38" - }, - "availabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.0.0/17", - "mapPublicIpOnLaunch": false, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "foobar" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Isolated" - }, - { - "key": "Name", - "value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "Vpc8378EB38" - }, - "tags": [ - { - "key": "Name", - "value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "VpcfoobarSubnet1RouteTableAF4E5874" - }, - "subnetId": { - "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", - "version": "0.0.0" - } - }, - "foobarSubnet2": { - "id": "foobarSubnet2", - "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "Vpc8378EB38" - }, - "availabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.128.0/17", - "mapPublicIpOnLaunch": false, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "foobar" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Isolated" - }, - { - "key": "Name", - "value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "Vpc8378EB38" - }, - "tags": [ - { - "key": "Name", - "value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "VpcfoobarSubnet2RouteTable5127598D" - }, - "subnetId": { - "Ref": "VpcfoobarSubnet2Subnet85B013AD" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.Vpc", - "version": "0.0.0" - } - }, - "ParameterGroup": { - "id": "ParameterGroup", - "path": "aws-cdk-redshift-cluster-create/ParameterGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-cdk-redshift-cluster-create/ParameterGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Redshift::ClusterParameterGroup", - "aws:cdk:cloudformation:props": { - "description": "Cluster parameter group for family redshift-1.0", - "parameterGroupFamily": "redshift-1.0", - "parameters": [ - { - "parameterName": "enable_user_activity_logging", - "parameterValue": "true" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-redshift.CfnClusterParameterGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-redshift.ClusterParameterGroup", - "version": "0.0.0" - } - }, - "Cluster": { - "id": "Cluster", - "path": "aws-cdk-redshift-cluster-create/Cluster", - "children": { - "Subnets": { - "id": "Subnets", - "path": "aws-cdk-redshift-cluster-create/Cluster/Subnets", - "children": { - "Default": { - "id": "Default", - "path": "aws-cdk-redshift-cluster-create/Cluster/Subnets/Default", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Redshift::ClusterSubnetGroup", - "aws:cdk:cloudformation:props": { - "description": "Subnets for Cluster Redshift cluster", - "subnetIds": [ - { - "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" - }, - { - "Ref": "VpcfoobarSubnet2Subnet85B013AD" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-redshift.CfnClusterSubnetGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-redshift.ClusterSubnetGroup", - "version": "0.0.0" - } - }, - "SecurityGroup": { - "id": "SecurityGroup", - "path": "aws-cdk-redshift-cluster-create/Cluster/SecurityGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-cdk-redshift-cluster-create/Cluster/SecurityGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", - "aws:cdk:cloudformation:props": { - "groupDescription": "Redshift security group", - "securityGroupEgress": [ - { - "cidrIp": "0.0.0.0/0", - "description": "Allow all outbound traffic by default", - "ipProtocol": "-1" - } - ], - "vpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.SecurityGroup", - "version": "0.0.0" - } - }, - "Secret": { - "id": "Secret", - "path": "aws-cdk-redshift-cluster-create/Cluster/Secret", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-cdk-redshift-cluster-create/Cluster/Secret/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::SecretsManager::Secret", - "aws:cdk:cloudformation:props": { - "generateSecretString": { - "passwordLength": 30, - "secretStringTemplate": "{\"username\":\"admin\"}", - "generateStringKey": "password", - "excludeCharacters": "\"@/\\ '" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-secretsmanager.CfnSecret", - "version": "0.0.0" - } - }, - "Attachment": { - "id": "Attachment", - "path": "aws-cdk-redshift-cluster-create/Cluster/Secret/Attachment", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-cdk-redshift-cluster-create/Cluster/Secret/Attachment/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::SecretsManager::SecretTargetAttachment", - "aws:cdk:cloudformation:props": { - "secretId": { - "Ref": "ClusterSecret6368BD0F" - }, - "targetId": { - "Ref": "ClusterEB0386A7" - }, - "targetType": "AWS::Redshift::Cluster" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-secretsmanager.CfnSecretTargetAttachment", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-secretsmanager.SecretTargetAttachment", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-redshift.DatabaseSecret", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "aws-cdk-redshift-cluster-create/Cluster/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Redshift::Cluster", - "aws:cdk:cloudformation:props": { - "clusterType": "multi-node", - "dbName": "default_db", - "masterUsername": { - "Fn::Join": [ - "", - [ - "{{resolve:secretsmanager:", - { - "Ref": "ClusterSecret6368BD0F" - }, - ":SecretString:username::}}" - ] - ] - }, - "masterUserPassword": { - "Fn::Join": [ - "", - [ - "{{resolve:secretsmanager:", - { - "Ref": "ClusterSecret6368BD0F" - }, - ":SecretString:password::}}" - ] - ] - }, - "nodeType": "dc2.large", - "allowVersionUpgrade": true, - "automatedSnapshotRetentionPeriod": 1, - "clusterParameterGroupName": { - "Ref": "ParameterGroup5E32DECB" - }, - "clusterSubnetGroupName": { - "Ref": "ClusterSubnetsDCFA5CB7" - }, - "encrypted": true, - "numberOfNodes": 2, - "publiclyAccessible": false, - "vpcSecurityGroupIds": [ - { - "Fn::GetAtt": [ - "ClusterSecurityGroup0921994B", - "GroupId" - ] - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-redshift.CfnCluster", - "version": "0.0.0" - } - }, - "RedshiftClusterRebooterFunction": { - "id": "RedshiftClusterRebooterFunction", - "path": "aws-cdk-redshift-cluster-create/Cluster/RedshiftClusterRebooterFunction", - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.SingletonFunction", - "version": "0.0.0" - } - }, - "ResourceProvider": { - "id": "ResourceProvider", - "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider", - "children": { - "framework-onEvent": { - "id": "framework-onEvent", - "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent", - "children": { - "ServiceRole": { - "id": "ServiceRole", - "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/ServiceRole", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/ServiceRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "managedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - }, - "DefaultPolicy": { - "id": "DefaultPolicy", - "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": "lambda:InvokeFunction", - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", - "Arn" - ] - }, - { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", - "Arn" - ] - }, - ":*" - ] - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "policyName": "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", - "roles": [ - { - "Ref": "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "Code": { - "id": "Code", - "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/Code", - "children": { - "Stage": { - "id": "Stage", - "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/Code/Stage", - "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" - } - }, - "AssetBucket": { - "id": "AssetBucket", - "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/Code/AssetBucket", - "constructInfo": { - "fqn": "@aws-cdk/aws-s3.BucketBase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-s3-assets.Asset", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Function", - "aws:cdk:cloudformation:props": { - "code": { - "s3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "s3Key": "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671.zip" - }, - "role": { - "Fn::GetAtt": [ - "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE", - "Arn" - ] - }, - "description": "AWS CDK resource provider framework - onEvent (aws-cdk-redshift-cluster-create/Cluster/ResourceProvider)", - "environment": { - "variables": { - "USER_ON_EVENT_FUNCTION_ARN": { - "Fn::GetAtt": [ - "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", - "Arn" - ] - } - } - }, - "handler": "framework.onEvent", - "runtime": "nodejs14.x", - "timeout": 900 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnFunction", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.Function", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/custom-resources.Provider", - "version": "0.0.0" - } - }, - "RedshiftClusterRebooterCustomResource": { - "id": "RedshiftClusterRebooterCustomResource", - "path": "aws-cdk-redshift-cluster-create/Cluster/RedshiftClusterRebooterCustomResource", - "children": { - "Default": { - "id": "Default", - "path": "aws-cdk-redshift-cluster-create/Cluster/RedshiftClusterRebooterCustomResource/Default", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-redshift.Cluster", - "version": "0.0.0" - } - }, - "SingletonLambda511e207f13df4b8bb632c32b30b65ac2": { - "id": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2", - "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2", - "children": { - "ServiceRole": { - "id": "ServiceRole", - "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "managedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - }, - "DefaultPolicy": { - "id": "DefaultPolicy", - "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/DefaultPolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/DefaultPolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": "redshift:DescribeClusters", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": "redshift:RebootCluster", - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":redshift:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":cluster:", - { - "Ref": "ClusterEB0386A7" - } - ] - ] - } - } - ], - "Version": "2012-10-17" - }, - "policyName": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF", - "roles": [ - { - "Ref": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "Code": { - "id": "Code", - "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Code", - "children": { - "Stage": { - "id": "Stage", - "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Code/Stage", - "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" - } - }, - "AssetBucket": { - "id": "AssetBucket", - "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Code/AssetBucket", - "constructInfo": { - "fqn": "@aws-cdk/aws-s3.BucketBase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-s3-assets.Asset", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Function", - "aws:cdk:cloudformation:props": { - "code": { - "s3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "s3Key": "631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139.zip" - }, - "role": { - "Fn::GetAtt": [ - "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525", - "Arn" - ] - }, - "handler": "index.handler", - "runtime": "nodejs16.x", - "timeout": 900 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnFunction", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.Function", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" - } - }, - "aws-cdk-redshift-cluster-update": { - "id": "aws-cdk-redshift-cluster-update", - "path": "aws-cdk-redshift-cluster-update", - "children": { - "Vpc": { - "id": "Vpc", - "path": "aws-cdk-redshift-cluster-update/Vpc", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-cdk-redshift-cluster-update/Vpc/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::VPC", - "aws:cdk:cloudformation:props": { - "cidrBlock": "10.0.0.0/16", - "enableDnsHostnames": true, - "enableDnsSupport": true, - "instanceTenancy": "default", - "tags": [ - { - "key": "Name", - "value": "aws-cdk-redshift-cluster-update/Vpc" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnVPC", - "version": "0.0.0" - } - }, - "foobarSubnet1": { - "id": "foobarSubnet1", - "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "Vpc8378EB38" - }, - "availabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.0.0/17", - "mapPublicIpOnLaunch": false, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "foobar" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Isolated" - }, - { - "key": "Name", - "value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "Vpc8378EB38" - }, - "tags": [ - { - "key": "Name", - "value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "VpcfoobarSubnet1RouteTableAF4E5874" - }, - "subnetId": { - "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", - "version": "0.0.0" - } - }, - "foobarSubnet2": { - "id": "foobarSubnet2", - "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "Vpc8378EB38" - }, - "availabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.128.0/17", - "mapPublicIpOnLaunch": false, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "foobar" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Isolated" - }, - { - "key": "Name", - "value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "Vpc8378EB38" - }, - "tags": [ - { - "key": "Name", - "value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "VpcfoobarSubnet2RouteTable5127598D" - }, - "subnetId": { - "Ref": "VpcfoobarSubnet2Subnet85B013AD" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.Vpc", - "version": "0.0.0" - } - }, - "ParameterGroup": { - "id": "ParameterGroup", - "path": "aws-cdk-redshift-cluster-update/ParameterGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-cdk-redshift-cluster-update/ParameterGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Redshift::ClusterParameterGroup", - "aws:cdk:cloudformation:props": { - "description": "Cluster parameter group for family redshift-1.0", - "parameterGroupFamily": "redshift-1.0", - "parameters": [ - { - "parameterName": "enable_user_activity_logging", - "parameterValue": "false" - }, - { - "parameterName": "use_fips_ssl", - "parameterValue": "true" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-redshift.CfnClusterParameterGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-redshift.ClusterParameterGroup", - "version": "0.0.0" - } - }, - "Cluster": { - "id": "Cluster", - "path": "aws-cdk-redshift-cluster-update/Cluster", - "children": { - "Subnets": { - "id": "Subnets", - "path": "aws-cdk-redshift-cluster-update/Cluster/Subnets", - "children": { - "Default": { - "id": "Default", - "path": "aws-cdk-redshift-cluster-update/Cluster/Subnets/Default", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Redshift::ClusterSubnetGroup", - "aws:cdk:cloudformation:props": { - "description": "Subnets for Cluster Redshift cluster", - "subnetIds": [ - { - "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" - }, - { - "Ref": "VpcfoobarSubnet2Subnet85B013AD" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-redshift.CfnClusterSubnetGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-redshift.ClusterSubnetGroup", - "version": "0.0.0" - } - }, - "SecurityGroup": { - "id": "SecurityGroup", - "path": "aws-cdk-redshift-cluster-update/Cluster/SecurityGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-cdk-redshift-cluster-update/Cluster/SecurityGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", - "aws:cdk:cloudformation:props": { - "groupDescription": "Redshift security group", - "securityGroupEgress": [ - { - "cidrIp": "0.0.0.0/0", - "description": "Allow all outbound traffic by default", - "ipProtocol": "-1" - } - ], - "vpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.SecurityGroup", - "version": "0.0.0" - } - }, - "Secret": { - "id": "Secret", - "path": "aws-cdk-redshift-cluster-update/Cluster/Secret", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-cdk-redshift-cluster-update/Cluster/Secret/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::SecretsManager::Secret", - "aws:cdk:cloudformation:props": { - "generateSecretString": { - "passwordLength": 30, - "secretStringTemplate": "{\"username\":\"admin\"}", - "generateStringKey": "password", - "excludeCharacters": "\"@/\\ '" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-secretsmanager.CfnSecret", - "version": "0.0.0" - } - }, - "Attachment": { - "id": "Attachment", - "path": "aws-cdk-redshift-cluster-update/Cluster/Secret/Attachment", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-cdk-redshift-cluster-update/Cluster/Secret/Attachment/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::SecretsManager::SecretTargetAttachment", - "aws:cdk:cloudformation:props": { - "secretId": { - "Ref": "ClusterSecret6368BD0F" - }, - "targetId": { - "Ref": "ClusterEB0386A7" - }, - "targetType": "AWS::Redshift::Cluster" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-secretsmanager.CfnSecretTargetAttachment", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-secretsmanager.SecretTargetAttachment", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-redshift.DatabaseSecret", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "aws-cdk-redshift-cluster-update/Cluster/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Redshift::Cluster", - "aws:cdk:cloudformation:props": { - "clusterType": "multi-node", - "dbName": "default_db", - "masterUsername": { - "Fn::Join": [ - "", - [ - "{{resolve:secretsmanager:", - { - "Ref": "ClusterSecret6368BD0F" - }, - ":SecretString:username::}}" - ] - ] - }, - "masterUserPassword": { - "Fn::Join": [ - "", - [ - "{{resolve:secretsmanager:", - { - "Ref": "ClusterSecret6368BD0F" - }, - ":SecretString:password::}}" - ] - ] - }, - "nodeType": "dc2.large", - "allowVersionUpgrade": true, - "automatedSnapshotRetentionPeriod": 1, - "clusterParameterGroupName": { - "Ref": "ParameterGroup5E32DECB" - }, - "clusterSubnetGroupName": { - "Ref": "ClusterSubnetsDCFA5CB7" - }, - "encrypted": true, - "numberOfNodes": 2, - "publiclyAccessible": false, - "vpcSecurityGroupIds": [ - { - "Fn::GetAtt": [ - "ClusterSecurityGroup0921994B", - "GroupId" - ] - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-redshift.CfnCluster", - "version": "0.0.0" - } - }, - "RedshiftClusterRebooterFunction": { - "id": "RedshiftClusterRebooterFunction", - "path": "aws-cdk-redshift-cluster-update/Cluster/RedshiftClusterRebooterFunction", - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.SingletonFunction", - "version": "0.0.0" - } - }, - "ResourceProvider": { - "id": "ResourceProvider", - "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider", - "children": { - "framework-onEvent": { - "id": "framework-onEvent", - "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent", - "children": { - "ServiceRole": { - "id": "ServiceRole", - "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/ServiceRole", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/ServiceRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "managedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - }, - "DefaultPolicy": { - "id": "DefaultPolicy", - "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": "lambda:InvokeFunction", - "Effect": "Allow", - "Resource": [ - { - "Fn::GetAtt": [ - "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", - "Arn" - ] - }, - { - "Fn::Join": [ - "", - [ - { - "Fn::GetAtt": [ - "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", - "Arn" - ] - }, - ":*" - ] - ] - } - ] - } - ], - "Version": "2012-10-17" - }, - "policyName": "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", - "roles": [ - { - "Ref": "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "Code": { - "id": "Code", - "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/Code", - "children": { - "Stage": { - "id": "Stage", - "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/Code/Stage", - "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" - } - }, - "AssetBucket": { - "id": "AssetBucket", - "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/Code/AssetBucket", - "constructInfo": { - "fqn": "@aws-cdk/aws-s3.BucketBase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-s3-assets.Asset", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Function", - "aws:cdk:cloudformation:props": { - "code": { - "s3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "s3Key": "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671.zip" - }, - "role": { - "Fn::GetAtt": [ - "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE", - "Arn" - ] - }, - "description": "AWS CDK resource provider framework - onEvent (aws-cdk-redshift-cluster-update/Cluster/ResourceProvider)", - "environment": { - "variables": { - "USER_ON_EVENT_FUNCTION_ARN": { - "Fn::GetAtt": [ - "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", - "Arn" - ] - } - } - }, - "handler": "framework.onEvent", - "runtime": "nodejs14.x", - "timeout": 900 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnFunction", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.Function", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/custom-resources.Provider", - "version": "0.0.0" - } - }, - "RedshiftClusterRebooterCustomResource": { - "id": "RedshiftClusterRebooterCustomResource", - "path": "aws-cdk-redshift-cluster-update/Cluster/RedshiftClusterRebooterCustomResource", - "children": { - "Default": { - "id": "Default", - "path": "aws-cdk-redshift-cluster-update/Cluster/RedshiftClusterRebooterCustomResource/Default", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-redshift.Cluster", - "version": "0.0.0" - } - }, - "SingletonLambda511e207f13df4b8bb632c32b30b65ac2": { - "id": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2", - "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2", - "children": { - "ServiceRole": { - "id": "ServiceRole", - "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "managedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnRole", - "version": "0.0.0" - } - }, - "DefaultPolicy": { - "id": "DefaultPolicy", - "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/DefaultPolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/DefaultPolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": "redshift:DescribeClusters", - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": "redshift:RebootCluster", - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":redshift:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":cluster:", - { - "Ref": "ClusterEB0386A7" - } - ] - ] - } - } - ], - "Version": "2012-10-17" - }, - "policyName": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF", - "roles": [ - { - "Ref": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Policy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-iam.Role", - "version": "0.0.0" - } - }, - "Code": { - "id": "Code", - "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Code", - "children": { - "Stage": { - "id": "Stage", - "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Code/Stage", - "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" - } - }, - "AssetBucket": { - "id": "AssetBucket", - "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Code/AssetBucket", - "constructInfo": { - "fqn": "@aws-cdk/aws-s3.BucketBase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-s3-assets.Asset", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Function", - "aws:cdk:cloudformation:props": { - "code": { - "s3Bucket": { - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" - }, - "s3Key": "631d177ea8a37a639d61917693cce9bbdb8e53862bc1ead871c88a235f8ef139.zip" - }, - "role": { - "Fn::GetAtt": [ - "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525", - "Arn" - ] - }, - "handler": "index.handler", - "runtime": "nodejs16.x", - "timeout": 900 - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.CfnFunction", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-lambda.Function", - "version": "0.0.0" - } - }, - "Exports": { - "id": "Exports", - "path": "aws-cdk-redshift-cluster-update/Exports", - "children": { - "Output{\"Ref\":\"ClusterEB0386A7\"}": { - "id": "Output{\"Ref\":\"ClusterEB0386A7\"}", - "path": "aws-cdk-redshift-cluster-update/Exports/Output{\"Ref\":\"ClusterEB0386A7\"}", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - }, - "Output{\"Ref\":\"ParameterGroup5E32DECB\"}": { - "id": "Output{\"Ref\":\"ParameterGroup5E32DECB\"}", - "path": "aws-cdk-redshift-cluster-update/Exports/Output{\"Ref\":\"ParameterGroup5E32DECB\"}", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.92" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" - } - }, - "aws-cdk-redshift-reboot-test": { - "id": "aws-cdk-redshift-reboot-test", - "path": "aws-cdk-redshift-reboot-test", - "children": { - "DefaultTest": { - "id": "DefaultTest", - "path": "aws-cdk-redshift-reboot-test/DefaultTest", - "children": { - "Default": { - "id": "Default", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/Default", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.92" - } - }, - "DeployAssert": { - "id": "DeployAssert", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert", - "children": { - "AwsApiCallRedshiftdescribeClusters1": { - "id": "AwsApiCallRedshiftdescribeClusters1", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1", - "children": { - "SdkProvider": { - "id": "SdkProvider", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1/SdkProvider", - "children": { - "AssertionsProvider": { - "id": "AssertionsProvider", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1/SdkProvider/AssertionsProvider", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.92" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.AssertionsProvider", - "version": "0.0.0" - } - }, - "Default": { - "id": "Default", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1/Default", - "children": { - "Default": { - "id": "Default", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1/Default/Default", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" - } - }, - "AssertEqualsRedshiftdescribeClusters": { - "id": "AssertEqualsRedshiftdescribeClusters", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1/AssertEqualsRedshiftdescribeClusters", - "children": { - "AssertionProvider": { - "id": "AssertionProvider", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1/AssertEqualsRedshiftdescribeClusters/AssertionProvider", - "children": { - "AssertionsProvider": { - "id": "AssertionsProvider", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1/AssertEqualsRedshiftdescribeClusters/AssertionProvider/AssertionsProvider", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.92" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.AssertionsProvider", - "version": "0.0.0" - } - }, - "Default": { - "id": "Default", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1/AssertEqualsRedshiftdescribeClusters/Default", - "children": { - "Default": { - "id": "Default", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1/AssertEqualsRedshiftdescribeClusters/Default/Default", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" - } - }, - "AssertionResults": { - "id": "AssertionResults", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters1/AssertEqualsRedshiftdescribeClusters/AssertionResults", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.EqualsAssertion", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.AwsApiCall", - "version": "0.0.0" - } - }, - "SingletonFunction1488541a7b23466481b69b4408076b81": { - "id": "SingletonFunction1488541a7b23466481b69b4408076b81", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81", - "children": { - "Staging": { - "id": "Staging", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Staging", - "constructInfo": { - "fqn": "@aws-cdk/core.AssetStaging", - "version": "0.0.0" - } - }, - "Role": { - "id": "Role", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "Handler": { - "id": "Handler", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.92" - } - }, - "AwsApiCallRedshiftdescribeClusterParameters1": { - "id": "AwsApiCallRedshiftdescribeClusterParameters1", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1", - "children": { - "SdkProvider": { - "id": "SdkProvider", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1/SdkProvider", - "children": { - "AssertionsProvider": { - "id": "AssertionsProvider", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1/SdkProvider/AssertionsProvider", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.92" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.AssertionsProvider", - "version": "0.0.0" - } - }, - "Default": { - "id": "Default", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1/Default", - "children": { - "Default": { - "id": "Default", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1/Default/Default", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" - } - }, - "AssertEqualsRedshiftdescribeClusterParameters": { - "id": "AssertEqualsRedshiftdescribeClusterParameters", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1/AssertEqualsRedshiftdescribeClusterParameters", - "children": { - "AssertionProvider": { - "id": "AssertionProvider", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1/AssertEqualsRedshiftdescribeClusterParameters/AssertionProvider", - "children": { - "AssertionsProvider": { - "id": "AssertionsProvider", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1/AssertEqualsRedshiftdescribeClusterParameters/AssertionProvider/AssertionsProvider", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.92" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.AssertionsProvider", - "version": "0.0.0" - } - }, - "Default": { - "id": "Default", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1/AssertEqualsRedshiftdescribeClusterParameters/Default", - "children": { - "Default": { - "id": "Default", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1/AssertEqualsRedshiftdescribeClusterParameters/Default/Default", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.CustomResource", - "version": "0.0.0" - } - }, - "AssertionResults": { - "id": "AssertionResults", - "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters1/AssertEqualsRedshiftdescribeClusterParameters/AssertionResults", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnOutput", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.EqualsAssertion", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.AwsApiCall", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.IntegTestCase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.IntegTest", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.App", - "version": "0.0.0" - } - } -} \ No newline at end of file From f31b6ddc7cbc87a920a03aa52e18292dda14df50 Mon Sep 17 00:00:00 2001 From: Arun Donti Date: Mon, 10 Oct 2022 20:38:14 -0400 Subject: [PATCH 07/15] chore: update snapshot --- .../cfn-response.js | 83 ------------------ .../util.js | 17 ---- .../cfn-response.js | 87 +++++++++++++++++++ .../consts.js | 0 .../framework.js | 0 .../outbound.js | 0 .../util.js | 39 +++++++++ ...ws-cdk-redshift-cluster-create.assets.json | 10 +-- ...-cdk-redshift-cluster-create.template.json | 2 +- ...ws-cdk-redshift-cluster-update.assets.json | 10 +-- ...-cdk-redshift-cluster-update.template.json | 2 +- .../manifest.json | 4 +- .../cluster-reboot.integ.snapshot/tree.json | 8 +- 13 files changed, 144 insertions(+), 118 deletions(-) delete mode 100644 packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/cfn-response.js delete mode 100644 packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/util.js create mode 100644 packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037/cfn-response.js rename packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/{asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671 => asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037}/consts.js (100%) rename packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/{asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671 => asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037}/framework.js (100%) rename packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/{asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671 => asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037}/outbound.js (100%) create mode 100644 packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037/util.js diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/cfn-response.js b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/cfn-response.js deleted file mode 100644 index 6319e06391def..0000000000000 --- a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/cfn-response.js +++ /dev/null @@ -1,83 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Retry = exports.safeHandler = exports.includeStackTraces = exports.submitResponse = exports.MISSING_PHYSICAL_ID_MARKER = exports.CREATE_FAILED_PHYSICAL_ID_MARKER = void 0; -/* eslint-disable max-len */ -/* eslint-disable no-console */ -const url = require("url"); -const outbound_1 = require("./outbound"); -const util_1 = require("./util"); -exports.CREATE_FAILED_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::CREATE_FAILED'; -exports.MISSING_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::MISSING_PHYSICAL_ID'; -async function submitResponse(status, event, options = {}) { - const json = { - Status: status, - Reason: options.reason || status, - StackId: event.StackId, - RequestId: event.RequestId, - PhysicalResourceId: event.PhysicalResourceId || exports.MISSING_PHYSICAL_ID_MARKER, - LogicalResourceId: event.LogicalResourceId, - NoEcho: options.noEcho, - Data: event.Data, - }; - util_1.log('submit response to cloudformation', json); - const responseBody = JSON.stringify(json); - const parsedUrl = url.parse(event.ResponseURL); - await outbound_1.httpRequest({ - hostname: parsedUrl.hostname, - path: parsedUrl.path, - method: 'PUT', - headers: { - 'content-type': '', - 'content-length': responseBody.length, - }, - }, responseBody); -} -exports.submitResponse = submitResponse; -exports.includeStackTraces = true; // for unit tests -function safeHandler(block) { - return async (event) => { - // ignore DELETE event when the physical resource ID is the marker that - // indicates that this DELETE is a subsequent DELETE to a failed CREATE - // operation. - if (event.RequestType === 'Delete' && event.PhysicalResourceId === exports.CREATE_FAILED_PHYSICAL_ID_MARKER) { - util_1.log('ignoring DELETE event caused by a failed CREATE event'); - await submitResponse('SUCCESS', event); - return; - } - try { - await block(event); - } - catch (e) { - // tell waiter state machine to retry - if (e instanceof Retry) { - util_1.log('retry requested by handler'); - throw e; - } - if (!event.PhysicalResourceId) { - // special case: if CREATE fails, which usually implies, we usually don't - // have a physical resource id. in this case, the subsequent DELETE - // operation does not have any meaning, and will likely fail as well. to - // address this, we use a marker so the provider framework can simply - // ignore the subsequent DELETE. - if (event.RequestType === 'Create') { - util_1.log('CREATE failed, responding with a marker physical resource id so that the subsequent DELETE will be ignored'); - event.PhysicalResourceId = exports.CREATE_FAILED_PHYSICAL_ID_MARKER; - } - else { - // otherwise, if PhysicalResourceId is not specified, something is - // terribly wrong because all other events should have an ID. - util_1.log(`ERROR: Malformed event. "PhysicalResourceId" is required: ${JSON.stringify({ ...event, ResponseURL: '...' })}`); - } - } - // this is an actual error, fail the activity altogether and exist. - await submitResponse('FAILED', event, { - reason: exports.includeStackTraces ? e.stack : e.message, - }); - } - }; -} -exports.safeHandler = safeHandler; -class Retry extends Error { -} -exports.Retry = Retry; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2ZuLXJlc3BvbnNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiY2ZuLX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3NhZ2UsXG4gICAgICB9KTtcbiAgICB9XG4gIH07XG59XG5cbmV4cG9ydCBjbGFzcyBSZXRyeSBleHRlbmRzIEVycm9yIHsgfVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/util.js b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/util.js deleted file mode 100644 index ee4c6e9c9ddeb..0000000000000 --- a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/util.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -/* eslint-disable no-console */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.log = exports.getEnv = void 0; -function getEnv(name) { - const value = process.env[name]; - if (!value) { - throw new Error(`The environment variable "${name}" is not defined`); - } - return value; -} -exports.getEnv = getEnv; -function log(title, ...args) { - console.log('[provider-framework]', title, ...args.map(x => typeof (x) === 'object' ? JSON.stringify(x, undefined, 2) : x)); -} -exports.log = log; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInV0aWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtCQUErQjs7O0FBRS9CLFNBQWdCLE1BQU0sQ0FBQyxJQUFZO0lBQ2pDLE1BQU0sS0FBSyxHQUFHLE9BQU8sQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLENBQUM7SUFDaEMsSUFBSSxDQUFDLEtBQUssRUFBRTtRQUNWLE1BQU0sSUFBSSxLQUFLLENBQUMsNkJBQTZCLElBQUksa0JBQWtCLENBQUMsQ0FBQztLQUN0RTtJQUNELE9BQU8sS0FBSyxDQUFDO0FBQ2YsQ0FBQztBQU5ELHdCQU1DO0FBRUQsU0FBZ0IsR0FBRyxDQUFDLEtBQVUsRUFBRSxHQUFHLElBQVc7SUFDNUMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxzQkFBc0IsRUFBRSxLQUFLLEVBQUUsR0FBRyxJQUFJLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxFQUFFLENBQUMsT0FBTSxDQUFDLENBQUMsQ0FBQyxLQUFLLFFBQVEsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxDQUFDLEVBQUUsU0FBUyxFQUFFLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQzdILENBQUM7QUFGRCxrQkFFQyIsInNvdXJjZXNDb250ZW50IjpbIi8qIGVzbGludC1kaXNhYmxlIG5vLWNvbnNvbGUgKi9cblxuZXhwb3J0IGZ1bmN0aW9uIGdldEVudihuYW1lOiBzdHJpbmcpOiBzdHJpbmcge1xuICBjb25zdCB2YWx1ZSA9IHByb2Nlc3MuZW52W25hbWVdO1xuICBpZiAoIXZhbHVlKSB7XG4gICAgdGhyb3cgbmV3IEVycm9yKGBUaGUgZW52aXJvbm1lbnQgdmFyaWFibGUgXCIke25hbWV9XCIgaXMgbm90IGRlZmluZWRgKTtcbiAgfVxuICByZXR1cm4gdmFsdWU7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBsb2codGl0bGU6IGFueSwgLi4uYXJnczogYW55W10pIHtcbiAgY29uc29sZS5sb2coJ1twcm92aWRlci1mcmFtZXdvcmtdJywgdGl0bGUsIC4uLmFyZ3MubWFwKHggPT4gdHlwZW9mKHgpID09PSAnb2JqZWN0JyA/IEpTT04uc3RyaW5naWZ5KHgsIHVuZGVmaW5lZCwgMikgOiB4KSk7XG59XG4iXX0= \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037/cfn-response.js b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037/cfn-response.js new file mode 100644 index 0000000000000..1966567b21646 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037/cfn-response.js @@ -0,0 +1,87 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Retry = exports.safeHandler = exports.includeStackTraces = exports.submitResponse = exports.MISSING_PHYSICAL_ID_MARKER = exports.CREATE_FAILED_PHYSICAL_ID_MARKER = void 0; +/* eslint-disable max-len */ +/* eslint-disable no-console */ +const url = require("url"); +const outbound_1 = require("./outbound"); +const util_1 = require("./util"); +exports.CREATE_FAILED_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::CREATE_FAILED'; +exports.MISSING_PHYSICAL_ID_MARKER = 'AWSCDK::CustomResourceProviderFramework::MISSING_PHYSICAL_ID'; +async function submitResponse(status, event, options = {}) { + const json = { + Status: status, + Reason: options.reason || status, + StackId: event.StackId, + RequestId: event.RequestId, + PhysicalResourceId: event.PhysicalResourceId || exports.MISSING_PHYSICAL_ID_MARKER, + LogicalResourceId: event.LogicalResourceId, + NoEcho: options.noEcho, + Data: event.Data, + }; + util_1.log('submit response to cloudformation', json); + const responseBody = JSON.stringify(json); + const parsedUrl = url.parse(event.ResponseURL); + const retryOptions = { + attempts: 5, + sleep: 1000, + }; + await util_1.withRetries(retryOptions, outbound_1.httpRequest)({ + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: 'PUT', + headers: { + 'content-type': '', + 'content-length': responseBody.length, + }, + }, responseBody); +} +exports.submitResponse = submitResponse; +exports.includeStackTraces = true; // for unit tests +function safeHandler(block) { + return async (event) => { + // ignore DELETE event when the physical resource ID is the marker that + // indicates that this DELETE is a subsequent DELETE to a failed CREATE + // operation. + if (event.RequestType === 'Delete' && event.PhysicalResourceId === exports.CREATE_FAILED_PHYSICAL_ID_MARKER) { + util_1.log('ignoring DELETE event caused by a failed CREATE event'); + await submitResponse('SUCCESS', event); + return; + } + try { + await block(event); + } + catch (e) { + // tell waiter state machine to retry + if (e instanceof Retry) { + util_1.log('retry requested by handler'); + throw e; + } + if (!event.PhysicalResourceId) { + // special case: if CREATE fails, which usually implies, we usually don't + // have a physical resource id. in this case, the subsequent DELETE + // operation does not have any meaning, and will likely fail as well. to + // address this, we use a marker so the provider framework can simply + // ignore the subsequent DELETE. + if (event.RequestType === 'Create') { + util_1.log('CREATE failed, responding with a marker physical resource id so that the subsequent DELETE will be ignored'); + event.PhysicalResourceId = exports.CREATE_FAILED_PHYSICAL_ID_MARKER; + } + else { + // otherwise, if PhysicalResourceId is not specified, something is + // terribly wrong because all other events should have an ID. + util_1.log(`ERROR: Malformed event. "PhysicalResourceId" is required: ${JSON.stringify({ ...event, ResponseURL: '...' })}`); + } + } + // this is an actual error, fail the activity altogether and exist. + await submitResponse('FAILED', event, { + reason: exports.includeStackTraces ? e.stack : e.message, + }); + } + }; +} +exports.safeHandler = safeHandler; +class Retry extends Error { +} +exports.Retry = Retry; +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2ZuLXJlc3BvbnNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiY2ZuLXJlc3BvbnNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLDRCQUE0QjtBQUM1QiwrQkFBK0I7QUFDL0IsMkJBQTJCO0FBQzNCLHlDQUF5QztBQUN6QyxpQ0FBMEM7QUFFN0IsUUFBQSxnQ0FBZ0MsR0FBRyx3REFBd0QsQ0FBQztBQUM1RixRQUFBLDBCQUEwQixHQUFHLDhEQUE4RCxDQUFDO0FBZ0JsRyxLQUFLLFVBQVUsY0FB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2UsXG4gICAgICB9KTtcbiAgICB9XG4gIH07XG59XG5cbmV4cG9ydCBjbGFzcyBSZXRyeSBleHRlbmRzIEVycm9yIHsgfVxuIl19 \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/consts.js b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037/consts.js similarity index 100% rename from packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/consts.js rename to packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037/consts.js diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/framework.js b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037/framework.js similarity index 100% rename from packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/framework.js rename to packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037/framework.js diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/outbound.js b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037/outbound.js similarity index 100% rename from packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671/outbound.js rename to packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037/outbound.js diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037/util.js b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037/util.js new file mode 100644 index 0000000000000..f09276d40ac91 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037/util.js @@ -0,0 +1,39 @@ +"use strict"; +/* eslint-disable no-console */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.withRetries = exports.log = exports.getEnv = void 0; +function getEnv(name) { + const value = process.env[name]; + if (!value) { + throw new Error(`The environment variable "${name}" is not defined`); + } + return value; +} +exports.getEnv = getEnv; +function log(title, ...args) { + console.log('[provider-framework]', title, ...args.map(x => typeof (x) === 'object' ? JSON.stringify(x, undefined, 2) : x)); +} +exports.log = log; +function withRetries(options, fn) { + return async (...xs) => { + let attempts = options.attempts; + let ms = options.sleep; + while (true) { + try { + return await fn(...xs); + } + catch (e) { + if (attempts-- <= 0) { + throw e; + } + await sleep(Math.floor(Math.random() * ms)); + ms *= 2; + } + } + }; +} +exports.withRetries = withRetries; +async function sleep(ms) { + return new Promise((ok) => setTimeout(ok, ms)); +} +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInV0aWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLCtCQUErQjs7O0FBRS9CLFNBQWdCLE1BQU0sQ0FBQyxJQ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B7XG4gIC8qKiBIb3cgbWFueSByZXRyaWVzICh3aWxsIGF0IGxlYXN0IHRyeSBvbmNlKSAqL1xuICByZWFkb25seSBhdHRlbXB0czogbnVtYmVyO1xuICAvKiogU2xlZXAgYmFzZSwgaW4gbXMgKi9cbiAgcmVhZG9ubHkgc2xlZXA6IG51bWJlcjtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIHdpdGhSZXRyaWVzPEEgZXh0ZW5kcyBBcnJheTxhbnk+LCBCPihvcHRpb25zOiBSZXRyeU9wdGlvbnMsIGZuOiAoLi4ueHM6IEEpID0+IFByb21pc2U8Qj4pOiAoLi4ueHM6IEEpID0+IFByb21pc2U8Qj4ge1xuICByZXR1cm4gYXN5bmMgKC4uLnhzOiBBKSA9PiB7XG4gICAgbGV0IGF0dGVtcHRzID0gb3B0aW9ucy5hdHRlbXB0cztcbiAgICBsZXQgbXMgPSBvcHRpb25zLnNsZWVwO1xuICAgIHdoaWxlICh0cnVlKSB7XG4gICAgICB0cnkge1xuICAgICAgICByZXR1cm4gYXdhaXQgZm4oLi4ueHMpO1xuICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICBpZiAoYXR0ZW1wdHMtLSA8PSAwKSB7XG4gICAgICAgICAgdGhyb3cgZTtcbiAgICAgICAgfVxuICAgICAgICBhd2FpdCBzbGVlcChNYXRoLmZsb29yKE1hdGgucmFuZG9tKCkgKiBtcykpO1xuICAgICAgICBtcyAqPSAyO1xuICAgICAgfVxuICAgIH1cbiAgfTtcbn1cblxuYXN5bmMgZnVuY3Rpb24gc2xlZXAobXM6IG51bWJlcik6IFByb21pc2U8dm9pZD4ge1xuICByZXR1cm4gbmV3IFByb21pc2UoKG9rKSA9PiBzZXRUaW1lb3V0KG9rLCBtcykpO1xufSJdfQ== \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-create.assets.json b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-create.assets.json index 63e5ccf0f06c3..32f731309e1e8 100644 --- a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-create.assets.json +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-create.assets.json @@ -14,20 +14,20 @@ } } }, - "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671": { + "7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037": { "source": { - "path": "asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671", + "path": "asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671.zip", + "objectKey": "7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "2aea766b80ca622ddf0b133bf93b3fe8bd73d33866fb9ce29443069438341e72": { + "0615d9633720df23ed3ec04f24f592c61f3b60ed92abd110e96e5ed52be73605": { "source": { "path": "aws-cdk-redshift-cluster-create.template.json", "packaging": "file" @@ -35,7 +35,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "2aea766b80ca622ddf0b133bf93b3fe8bd73d33866fb9ce29443069438341e72.json", + "objectKey": "0615d9633720df23ed3ec04f24f592c61f3b60ed92abd110e96e5ed52be73605.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-create.template.json b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-create.template.json index df8d32ccd2c44..2dbd05dfbd459 100644 --- a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-create.template.json +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-create.template.json @@ -356,7 +356,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671.zip" + "S3Key": "7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037.zip" }, "Role": { "Fn::GetAtt": [ diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-update.assets.json b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-update.assets.json index c9d52b784da45..cb546e95f709b 100644 --- a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-update.assets.json +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-update.assets.json @@ -14,20 +14,20 @@ } } }, - "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671": { + "7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037": { "source": { - "path": "asset.3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671", + "path": "asset.7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037", "packaging": "zip" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671.zip", + "objectKey": "7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037.zip", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } }, - "87fe4fb9a6dacdbefa3813dca2277d7e0f80594987d87c13fa228f373043e3e4": { + "d2c10b460302950fe5b01e119da8d706f03cced8872d296f6721d3f607defc94": { "source": { "path": "aws-cdk-redshift-cluster-update.template.json", "packaging": "file" @@ -35,7 +35,7 @@ "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "87fe4fb9a6dacdbefa3813dca2277d7e0f80594987d87c13fa228f373043e3e4.json", + "objectKey": "d2c10b460302950fe5b01e119da8d706f03cced8872d296f6721d3f607defc94.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-update.template.json b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-update.template.json index 11cb5fc90e182..1e653b14c0a28 100644 --- a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-update.template.json +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/aws-cdk-redshift-cluster-update.template.json @@ -360,7 +360,7 @@ "S3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "S3Key": "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671.zip" + "S3Key": "7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037.zip" }, "Role": { "Fn::GetAtt": [ diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/manifest.json b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/manifest.json index cc5d7e8d13fdf..b5212572f6de6 100644 --- a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/manifest.json @@ -23,7 +23,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/2aea766b80ca622ddf0b133bf93b3fe8bd73d33866fb9ce29443069438341e72.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/0615d9633720df23ed3ec04f24f592c61f3b60ed92abd110e96e5ed52be73605.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -191,7 +191,7 @@ "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/87fe4fb9a6dacdbefa3813dca2277d7e0f80594987d87c13fa228f373043e3e4.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/d2c10b460302950fe5b01e119da8d706f03cced8872d296f6721d3f607defc94.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/tree.json b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/tree.json index 5595c16fd9e41..422c726d9c410 100644 --- a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/tree.json +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/tree.json @@ -9,7 +9,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.108" + "version": "10.1.123" } }, "aws-cdk-redshift-cluster-create": { @@ -627,7 +627,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671.zip" + "s3Key": "7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037.zip" }, "role": { "Fn::GetAtt": [ @@ -1496,7 +1496,7 @@ "s3Bucket": { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "s3Key": "3b263c2ad043fd069ef446753788c36e595c82b51a70478e58258c8ef7471671.zip" + "s3Key": "7215c88dd3e638d28329d4538b36cdbfb54233a4d972181795814f8b904d1037.zip" }, "role": { "Fn::GetAtt": [ @@ -1759,7 +1759,7 @@ "path": "aws-cdk-redshift-reboot-test/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.108" + "version": "10.1.123" } }, "DeployAssert": { From 52916e6a706c782e5abd384ff89a9ce637f1f8ac Mon Sep 17 00:00:00 2001 From: Arun Donti Date: Wed, 19 Oct 2022 12:40:38 -0400 Subject: [PATCH 08/15] tests: regenerate snapshot --- .../aws-redshift/test/cluster-reboot.integ.snapshot/tree.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/tree.json b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/tree.json index 422c726d9c410..09d0274a71891 100644 --- a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/tree.json +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/tree.json @@ -9,7 +9,7 @@ "path": "Tree", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.123" + "version": "10.1.129" } }, "aws-cdk-redshift-cluster-create": { @@ -1759,7 +1759,7 @@ "path": "aws-cdk-redshift-reboot-test/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", - "version": "10.1.123" + "version": "10.1.129" } }, "DeployAssert": { From c445b0faa06ede6e809cb93d22b57b8caddc810e Mon Sep 17 00:00:00 2001 From: Arun Donti Date: Wed, 16 Nov 2022 11:52:13 -0500 Subject: [PATCH 09/15] chore: commenting out diff assets in integ test --- packages/@aws-cdk/aws-redshift/lib/cluster.ts | 2 +- .../aws-redshift/test/cluster-reboot.integ.snapshot/integ.json | 1 - packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.ts | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/@aws-cdk/aws-redshift/lib/cluster.ts b/packages/@aws-cdk/aws-redshift/lib/cluster.ts index 0627a99c376d1..bd1fb488e2067 100644 --- a/packages/@aws-cdk/aws-redshift/lib/cluster.ts +++ b/packages/@aws-cdk/aws-redshift/lib/cluster.ts @@ -1,3 +1,4 @@ +import * as path from 'path'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; @@ -7,7 +8,6 @@ import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; import { ArnFormat, CustomResource, Duration, IResource, Lazy, RemovalPolicy, Resource, SecretValue, Stack, Token } from '@aws-cdk/core'; import * as cr from '@aws-cdk/custom-resources'; import { Construct } from 'constructs'; -import * as path from 'path'; import { DatabaseSecret } from './database-secret'; import { Endpoint } from './endpoint'; import { ClusterParameterGroup, IClusterParameterGroup } from './parameter-group'; diff --git a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/integ.json b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/integ.json index ce760b7e44b28..8323a65d93e55 100644 --- a/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/integ.json +++ b/packages/@aws-cdk/aws-redshift/test/cluster-reboot.integ.snapshot/integ.json @@ -6,7 +6,6 @@ "aws-cdk-redshift-cluster-create", "aws-cdk-redshift-cluster-update" ], - "diffAssets": true, "stackUpdateWorkflow": true, "assertionStack": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert", "assertionStackName": "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34" diff --git a/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.ts b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.ts index 71f9eb861719a..b0ab7d8516261 100644 --- a/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.ts +++ b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.ts @@ -69,7 +69,7 @@ stacks.forEach(s => { new integ.IntegTest(app, 'aws-cdk-redshift-reboot-test', { testCases: stacks, stackUpdateWorkflow: true, - diffAssets: true, + // diffAssets: true, }); // https://github.com/aws/aws-cdk/issues/22059 From 26fbbaa9db350b6870fbcc05e990f222765240d0 Mon Sep 17 00:00:00 2001 From: Arun Donti Date: Wed, 16 Nov 2022 12:01:12 -0500 Subject: [PATCH 10/15] docs: add testing procedure to integ test --- .../@aws-cdk/aws-redshift/test/integ.cluster-reboot.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.ts b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.ts index b0ab7d8516261..d8cd1eef3e50b 100644 --- a/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.ts +++ b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.ts @@ -4,6 +4,16 @@ import * as integ from '@aws-cdk/integ-tests'; import * as constructs from 'constructs'; import * as redshift from '../lib'; +/** + * This test does the following + * + * 1. Creates a stack with a Redshift cluster. + * 2. Creates a second stack with the same name to update the parameter group and cause the custom resource to run. + * + * The diff assets flag and assertions have been commented out due to some current issues with integ-tests. + * This test was manually verified by manually checking the sync status and reboot history of the redshift cluster. + */ + const app = new cdk.App(); From 762f2bfb4893ab47fa791000216ca58c33fbfd6d Mon Sep 17 00:00:00 2001 From: Arun Donti Date: Wed, 14 Dec 2022 18:00:04 -0500 Subject: [PATCH 11/15] test: update assertions on integ test --- .../index.js | 783 +++++++ ...ws-cdk-redshift-cluster-create.assets.json | 45 + ...-cdk-redshift-cluster-create.template.json | 553 +++++ ...ws-cdk-redshift-cluster-update.assets.json | 45 + ...-cdk-redshift-cluster-update.template.json | 575 +++++ ...efaultTestDeployAssert1AE11B34.assets.json | 32 + ...aultTestDeployAssert1AE11B34.template.json | 177 ++ .../integ.cluster-reboot.js.snapshot/cdk.out | 1 + .../integ.json | 14 + .../manifest.json | 444 ++++ .../tree.json | 2041 +++++++++++++++++ .../aws-redshift/test/integ.cluster-reboot.ts | 55 +- 12 files changed, 4730 insertions(+), 35 deletions(-) create mode 100644 packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/asset.382ba2a8fd0a13f6782aec5543e465f988f5c100f35ed20f90cd96b8ee53f674.bundle/index.js create mode 100644 packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/aws-cdk-redshift-cluster-create.assets.json create mode 100644 packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/aws-cdk-redshift-cluster-create.template.json create mode 100644 packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/aws-cdk-redshift-cluster-update.assets.json create mode 100644 packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/aws-cdk-redshift-cluster-update.template.json create mode 100644 packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets.json create mode 100644 packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.template.json create mode 100644 packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/cdk.out create mode 100644 packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/integ.json create mode 100644 packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/manifest.json create mode 100644 packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/tree.json diff --git a/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/asset.382ba2a8fd0a13f6782aec5543e465f988f5c100f35ed20f90cd96b8ee53f674.bundle/index.js b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/asset.382ba2a8fd0a13f6782aec5543e465f988f5c100f35ed20f90cd96b8ee53f674.bundle/index.js new file mode 100644 index 0000000000000..ffbf23bc9533f --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/asset.382ba2a8fd0a13f6782aec5543e465f988f5c100f35ed20f90cd96b8ee53f674.bundle/index.js @@ -0,0 +1,783 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// lib/assertions/providers/lambda-handler/index.ts +var lambda_handler_exports = {}; +__export(lambda_handler_exports, { + handler: () => handler, + isComplete: () => isComplete, + onTimeout: () => onTimeout +}); +module.exports = __toCommonJS(lambda_handler_exports); + +// ../assertions/lib/matcher.ts +var Matcher = class { + static isMatcher(x) { + return x && x instanceof Matcher; + } +}; +var MatchResult = class { + constructor(target) { + this.failures = []; + this.captures = /* @__PURE__ */ new Map(); + this.finalized = false; + this.target = target; + } + push(matcher, path, message) { + return this.recordFailure({ matcher, path, message }); + } + recordFailure(failure) { + this.failures.push(failure); + return this; + } + hasFailed() { + return this.failures.length !== 0; + } + get failCount() { + return this.failures.length; + } + compose(id, inner) { + const innerF = inner.failures; + this.failures.push(...innerF.map((f) => { + return { path: [id, ...f.path], message: f.message, matcher: f.matcher }; + })); + inner.captures.forEach((vals, capture) => { + vals.forEach((value) => this.recordCapture({ capture, value })); + }); + return this; + } + finished() { + if (this.finalized) { + return this; + } + if (this.failCount === 0) { + this.captures.forEach((vals, cap) => cap._captured.push(...vals)); + } + this.finalized = true; + return this; + } + toHumanStrings() { + return this.failures.map((r) => { + const loc = r.path.length === 0 ? "" : ` at ${r.path.join("")}`; + return "" + r.message + loc + ` (using ${r.matcher.name} matcher)`; + }); + } + recordCapture(options) { + let values = this.captures.get(options.capture); + if (values === void 0) { + values = []; + } + values.push(options.value); + this.captures.set(options.capture, values); + } +}; + +// ../assertions/lib/private/matchers/absent.ts +var AbsentMatch = class extends Matcher { + constructor(name) { + super(); + this.name = name; + } + test(actual) { + const result = new MatchResult(actual); + if (actual !== void 0) { + result.recordFailure({ + matcher: this, + path: [], + message: `Received ${actual}, but key should be absent` + }); + } + return result; + } +}; + +// ../assertions/lib/private/type.ts +function getType(obj) { + return Array.isArray(obj) ? "array" : typeof obj; +} + +// ../assertions/lib/match.ts +var Match = class { + static absent() { + return new AbsentMatch("absent"); + } + static arrayWith(pattern) { + return new ArrayMatch("arrayWith", pattern); + } + static arrayEquals(pattern) { + return new ArrayMatch("arrayEquals", pattern, { subsequence: false }); + } + static exact(pattern) { + return new LiteralMatch("exact", pattern, { partialObjects: false }); + } + static objectLike(pattern) { + return new ObjectMatch("objectLike", pattern); + } + static objectEquals(pattern) { + return new ObjectMatch("objectEquals", pattern, { partial: false }); + } + static not(pattern) { + return new NotMatch("not", pattern); + } + static serializedJson(pattern) { + return new SerializedJson("serializedJson", pattern); + } + static anyValue() { + return new AnyMatch("anyValue"); + } + static stringLikeRegexp(pattern) { + return new StringLikeRegexpMatch("stringLikeRegexp", pattern); + } +}; +var LiteralMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.partialObjects = options.partialObjects ?? false; + if (Matcher.isMatcher(this.pattern)) { + throw new Error("LiteralMatch cannot directly contain another matcher. Remove the top-level matcher or nest it more deeply."); + } + } + test(actual) { + if (Array.isArray(this.pattern)) { + return new ArrayMatch(this.name, this.pattern, { subsequence: false, partialObjects: this.partialObjects }).test(actual); + } + if (typeof this.pattern === "object") { + return new ObjectMatch(this.name, this.pattern, { partial: this.partialObjects }).test(actual); + } + const result = new MatchResult(actual); + if (typeof this.pattern !== typeof actual) { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected type ${typeof this.pattern} but received ${getType(actual)}` + }); + return result; + } + if (actual !== this.pattern) { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected ${this.pattern} but received ${actual}` + }); + } + return result; + } +}; +var ArrayMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.subsequence = options.subsequence ?? true; + this.partialObjects = options.partialObjects ?? false; + } + test(actual) { + if (!Array.isArray(actual)) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected type array but received ${getType(actual)}` + }); + } + if (!this.subsequence && this.pattern.length !== actual.length) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected array of length ${this.pattern.length} but received ${actual.length}` + }); + } + let patternIdx = 0; + let actualIdx = 0; + const result = new MatchResult(actual); + while (patternIdx < this.pattern.length && actualIdx < actual.length) { + const patternElement = this.pattern[patternIdx]; + const matcher = Matcher.isMatcher(patternElement) ? patternElement : new LiteralMatch(this.name, patternElement, { partialObjects: this.partialObjects }); + const matcherName = matcher.name; + if (this.subsequence && (matcherName == "absent" || matcherName == "anyValue")) { + throw new Error(`The Matcher ${matcherName}() cannot be nested within arrayWith()`); + } + const innerResult = matcher.test(actual[actualIdx]); + if (!this.subsequence || !innerResult.hasFailed()) { + result.compose(`[${actualIdx}]`, innerResult); + patternIdx++; + actualIdx++; + } else { + actualIdx++; + } + } + for (; patternIdx < this.pattern.length; patternIdx++) { + const pattern = this.pattern[patternIdx]; + const element = Matcher.isMatcher(pattern) || typeof pattern === "object" ? " " : ` [${pattern}] `; + result.recordFailure({ + matcher: this, + path: [], + message: `Missing element${element}at pattern index ${patternIdx}` + }); + } + return result; + } +}; +var ObjectMatch = class extends Matcher { + constructor(name, pattern, options = {}) { + super(); + this.name = name; + this.pattern = pattern; + this.partial = options.partial ?? true; + } + test(actual) { + if (typeof actual !== "object" || Array.isArray(actual)) { + return new MatchResult(actual).recordFailure({ + matcher: this, + path: [], + message: `Expected type object but received ${getType(actual)}` + }); + } + const result = new MatchResult(actual); + if (!this.partial) { + for (const a of Object.keys(actual)) { + if (!(a in this.pattern)) { + result.recordFailure({ + matcher: this, + path: [`/${a}`], + message: "Unexpected key" + }); + } + } + } + for (const [patternKey, patternVal] of Object.entries(this.pattern)) { + if (!(patternKey in actual) && !(patternVal instanceof AbsentMatch)) { + result.recordFailure({ + matcher: this, + path: [`/${patternKey}`], + message: `Missing key '${patternKey}' among {${Object.keys(actual).join(",")}}` + }); + continue; + } + const matcher = Matcher.isMatcher(patternVal) ? patternVal : new LiteralMatch(this.name, patternVal, { partialObjects: this.partial }); + const inner = matcher.test(actual[patternKey]); + result.compose(`/${patternKey}`, inner); + } + return result; + } +}; +var SerializedJson = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + const result = new MatchResult(actual); + if (getType(actual) !== "string") { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected JSON as a string but found ${getType(actual)}` + }); + return result; + } + let parsed; + try { + parsed = JSON.parse(actual); + } catch (err) { + if (err instanceof SyntaxError) { + result.recordFailure({ + matcher: this, + path: [], + message: `Invalid JSON string: ${actual}` + }); + return result; + } else { + throw err; + } + } + const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); + const innerResult = matcher.test(parsed); + result.compose(`(${this.name})`, innerResult); + return result; + } +}; +var NotMatch = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + const matcher = Matcher.isMatcher(this.pattern) ? this.pattern : new LiteralMatch(this.name, this.pattern); + const innerResult = matcher.test(actual); + const result = new MatchResult(actual); + if (innerResult.failCount === 0) { + result.recordFailure({ + matcher: this, + path: [], + message: `Found unexpected match: ${JSON.stringify(actual, void 0, 2)}` + }); + } + return result; + } +}; +var AnyMatch = class extends Matcher { + constructor(name) { + super(); + this.name = name; + } + test(actual) { + const result = new MatchResult(actual); + if (actual == null) { + result.recordFailure({ + matcher: this, + path: [], + message: "Expected a value but found none" + }); + } + return result; + } +}; +var StringLikeRegexpMatch = class extends Matcher { + constructor(name, pattern) { + super(); + this.name = name; + this.pattern = pattern; + } + test(actual) { + const result = new MatchResult(actual); + const regex = new RegExp(this.pattern, "gm"); + if (typeof actual !== "string") { + result.recordFailure({ + matcher: this, + path: [], + message: `Expected a string, but got '${typeof actual}'` + }); + } + if (!regex.test(actual)) { + result.recordFailure({ + matcher: this, + path: [], + message: `String '${actual}' did not match pattern '${this.pattern}'` + }); + } + return result; + } +}; + +// lib/assertions/providers/lambda-handler/base.ts +var https = __toESM(require("https")); +var url = __toESM(require("url")); +var AWS = __toESM(require("aws-sdk")); +var CustomResourceHandler = class { + constructor(event, context) { + this.event = event; + this.context = context; + this.timedOut = false; + this.timeout = setTimeout(async () => { + await this.respond({ + status: "FAILED", + reason: "Lambda Function Timeout", + data: this.context.logStreamName + }); + this.timedOut = true; + }, context.getRemainingTimeInMillis() - 1200); + this.event = event; + this.physicalResourceId = extractPhysicalResourceId(event); + } + async handle() { + try { + if ("stateMachineArn" in this.event.ResourceProperties) { + const req = { + stateMachineArn: this.event.ResourceProperties.stateMachineArn, + name: this.event.RequestId, + input: JSON.stringify(this.event) + }; + await this.startExecution(req); + return; + } else { + const response = await this.processEvent(this.event.ResourceProperties); + return response; + } + } catch (e) { + console.log(e); + throw e; + } finally { + clearTimeout(this.timeout); + } + } + async handleIsComplete() { + try { + const result = await this.processEvent(this.event.ResourceProperties); + return result; + } catch (e) { + console.log(e); + return; + } finally { + clearTimeout(this.timeout); + } + } + async startExecution(req) { + try { + const sfn = new AWS.StepFunctions(); + await sfn.startExecution(req).promise(); + } finally { + clearTimeout(this.timeout); + } + } + respond(response) { + if (this.timedOut) { + return; + } + const cfResponse = { + Status: response.status, + Reason: response.reason, + PhysicalResourceId: this.physicalResourceId, + StackId: this.event.StackId, + RequestId: this.event.RequestId, + LogicalResourceId: this.event.LogicalResourceId, + NoEcho: false, + Data: response.data + }; + const responseBody = JSON.stringify(cfResponse); + console.log("Responding to CloudFormation", responseBody); + const parsedUrl = url.parse(this.event.ResponseURL); + const requestOptions = { + hostname: parsedUrl.hostname, + path: parsedUrl.path, + method: "PUT", + headers: { "content-type": "", "content-length": responseBody.length } + }; + return new Promise((resolve, reject) => { + try { + const request2 = https.request(requestOptions, resolve); + request2.on("error", reject); + request2.write(responseBody); + request2.end(); + } catch (e) { + reject(e); + } finally { + clearTimeout(this.timeout); + } + }); + } +}; +function extractPhysicalResourceId(event) { + switch (event.RequestType) { + case "Create": + return event.LogicalResourceId; + case "Update": + case "Delete": + return event.PhysicalResourceId; + } +} + +// lib/assertions/providers/lambda-handler/assertion.ts +var AssertionHandler = class extends CustomResourceHandler { + async processEvent(request2) { + let actual = decodeCall(request2.actual); + const expected = decodeCall(request2.expected); + let result; + const matcher = new MatchCreator(expected).getMatcher(); + console.log(`Testing equality between ${JSON.stringify(request2.actual)} and ${JSON.stringify(request2.expected)}`); + const matchResult = matcher.test(actual); + matchResult.finished(); + if (matchResult.hasFailed()) { + result = { + failed: true, + assertion: JSON.stringify({ + status: "fail", + message: [ + ...matchResult.toHumanStrings(), + JSON.stringify(matchResult.target, void 0, 2) + ].join("\n") + }) + }; + if (request2.failDeployment) { + throw new Error(result.assertion); + } + } else { + result = { + assertion: JSON.stringify({ + status: "success" + }) + }; + } + return result; + } +}; +var MatchCreator = class { + constructor(obj) { + this.parsedObj = { + matcher: obj + }; + } + getMatcher() { + try { + const final = JSON.parse(JSON.stringify(this.parsedObj), function(_k, v) { + const nested = Object.keys(v)[0]; + switch (nested) { + case "$ArrayWith": + return Match.arrayWith(v[nested]); + case "$ObjectLike": + return Match.objectLike(v[nested]); + case "$StringLike": + return Match.stringLikeRegexp(v[nested]); + default: + return v; + } + }); + if (Matcher.isMatcher(final.matcher)) { + return final.matcher; + } + return Match.exact(final.matcher); + } catch { + return Match.exact(this.parsedObj.matcher); + } + } +}; +function decodeCall(call) { + if (!call) { + return void 0; + } + try { + const parsed = JSON.parse(call); + return parsed; + } catch (e) { + return call; + } +} + +// lib/assertions/providers/lambda-handler/utils.ts +function decode(object) { + return JSON.parse(JSON.stringify(object), (_k, v) => { + switch (v) { + case "TRUE:BOOLEAN": + return true; + case "FALSE:BOOLEAN": + return false; + default: + return v; + } + }); +} + +// lib/assertions/providers/lambda-handler/sdk.ts +function flatten(object) { + return Object.assign( + {}, + ...function _flatten(child, path = []) { + return [].concat(...Object.keys(child).map((key) => { + let childKey = Buffer.isBuffer(child[key]) ? child[key].toString("utf8") : child[key]; + if (typeof childKey === "string") { + childKey = isJsonString(childKey); + } + return typeof childKey === "object" && childKey !== null ? _flatten(childKey, path.concat([key])) : { [path.concat([key]).join(".")]: childKey }; + })); + }(object) + ); +} +var AwsApiCallHandler = class extends CustomResourceHandler { + async processEvent(request2) { + const AWS2 = require("aws-sdk"); + console.log(`AWS SDK VERSION: ${AWS2.VERSION}`); + if (!Object.prototype.hasOwnProperty.call(AWS2, request2.service)) { + throw Error(`Service ${request2.service} does not exist in AWS SDK version ${AWS2.VERSION}.`); + } + const service = new AWS2[request2.service](); + const response = await service[request2.api](request2.parameters && decode(request2.parameters)).promise(); + console.log(`SDK response received ${JSON.stringify(response)}`); + delete response.ResponseMetadata; + const respond = { + apiCallResponse: response + }; + const flatData = { + ...flatten(respond) + }; + let resp = respond; + if (request2.outputPaths) { + resp = filterKeys(flatData, request2.outputPaths); + } else if (request2.flattenResponse === "true") { + resp = flatData; + } + console.log(`Returning result ${JSON.stringify(resp)}`); + return resp; + } +}; +function filterKeys(object, searchStrings) { + return Object.entries(object).reduce((filteredObject, [key, value]) => { + for (const searchString of searchStrings) { + if (key.startsWith(`apiCallResponse.${searchString}`)) { + filteredObject[key] = value; + } + } + return filteredObject; + }, {}); +} +function isJsonString(value) { + try { + return JSON.parse(value); + } catch { + return value; + } +} + +// lib/assertions/providers/lambda-handler/types.ts +var ASSERT_RESOURCE_TYPE = "Custom::DeployAssert@AssertEquals"; +var SDK_RESOURCE_TYPE_PREFIX = "Custom::DeployAssert@SdkCall"; + +// lib/assertions/providers/lambda-handler/index.ts +async function handler(event, context) { + console.log(`Event: ${JSON.stringify({ ...event, ResponseURL: "..." })}`); + const provider = createResourceHandler(event, context); + try { + if (event.RequestType === "Delete") { + await provider.respond({ + status: "SUCCESS", + reason: "OK" + }); + return; + } + const result = await provider.handle(); + if ("stateMachineArn" in event.ResourceProperties) { + console.info('Found "stateMachineArn", waiter statemachine started'); + return; + } else if ("expected" in event.ResourceProperties) { + console.info('Found "expected", testing assertions'); + const actualPath = event.ResourceProperties.actualPath; + const actual = actualPath ? result[`apiCallResponse.${actualPath}`] : result.apiCallResponse; + const assertion = new AssertionHandler({ + ...event, + ResourceProperties: { + ServiceToken: event.ServiceToken, + actual, + expected: event.ResourceProperties.expected + } + }, context); + try { + const assertionResult = await assertion.handle(); + await provider.respond({ + status: "SUCCESS", + reason: "OK", + data: { + ...assertionResult, + ...result + } + }); + return; + } catch (e) { + await provider.respond({ + status: "FAILED", + reason: e.message ?? "Internal Error" + }); + return; + } + } + await provider.respond({ + status: "SUCCESS", + reason: "OK", + data: result + }); + } catch (e) { + await provider.respond({ + status: "FAILED", + reason: e.message ?? "Internal Error" + }); + return; + } + return; +} +async function onTimeout(timeoutEvent) { + const isCompleteRequest = JSON.parse(JSON.parse(timeoutEvent.Cause).errorMessage); + const provider = createResourceHandler(isCompleteRequest, standardContext); + await provider.respond({ + status: "FAILED", + reason: "Operation timed out: " + JSON.stringify(isCompleteRequest) + }); +} +async function isComplete(event, context) { + console.log(`Event: ${JSON.stringify({ ...event, ResponseURL: "..." })}`); + const provider = createResourceHandler(event, context); + try { + const result = await provider.handleIsComplete(); + const actualPath = event.ResourceProperties.actualPath; + if (result) { + const actual = actualPath ? result[`apiCallResponse.${actualPath}`] : result.apiCallResponse; + if ("expected" in event.ResourceProperties) { + const assertion = new AssertionHandler({ + ...event, + ResourceProperties: { + ServiceToken: event.ServiceToken, + actual, + expected: event.ResourceProperties.expected + } + }, context); + const assertionResult = await assertion.handleIsComplete(); + if (!(assertionResult == null ? void 0 : assertionResult.failed)) { + await provider.respond({ + status: "SUCCESS", + reason: "OK", + data: { + ...assertionResult, + ...result + } + }); + return; + } else { + console.log(`Assertion Failed: ${JSON.stringify(assertionResult)}`); + throw new Error(JSON.stringify(event)); + } + } + await provider.respond({ + status: "SUCCESS", + reason: "OK", + data: result + }); + } else { + console.log("No result"); + throw new Error(JSON.stringify(event)); + } + return; + } catch (e) { + console.log(e); + throw new Error(JSON.stringify(event)); + } +} +function createResourceHandler(event, context) { + if (event.ResourceType.startsWith(SDK_RESOURCE_TYPE_PREFIX)) { + return new AwsApiCallHandler(event, context); + } else if (event.ResourceType.startsWith(ASSERT_RESOURCE_TYPE)) { + return new AssertionHandler(event, context); + } else { + throw new Error(`Unsupported resource type "${event.ResourceType}`); + } +} +var standardContext = { + getRemainingTimeInMillis: () => 9e4 +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + handler, + isComplete, + onTimeout +}); diff --git a/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/aws-cdk-redshift-cluster-create.assets.json b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/aws-cdk-redshift-cluster-create.assets.json new file mode 100644 index 0000000000000..9d403bee01fcb --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/aws-cdk-redshift-cluster-create.assets.json @@ -0,0 +1,45 @@ +{ + "version": "22.0.0", + "files": { + "1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e": { + "source": { + "path": "asset.1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585": { + "source": { + "path": "asset.a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "93a411da5664a42e1702532262aa281227dd5fc1f136148d06a42addd7c763c0": { + "source": { + "path": "aws-cdk-redshift-cluster-create.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "93a411da5664a42e1702532262aa281227dd5fc1f136148d06a42addd7c763c0.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/aws-cdk-redshift-cluster-create.template.json b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/aws-cdk-redshift-cluster-create.template.json new file mode 100644 index 0000000000000..f7c7f21326370 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/aws-cdk-redshift-cluster-create.template.json @@ -0,0 +1,553 @@ +{ + "Resources": { + "Vpc8378EB38": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-create/Vpc" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet1Subnet77A7FDC6": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "Vpc8378EB38" + }, + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.0.0/17", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "foobar" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Isolated" + }, + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet1RouteTableAF4E5874": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "Vpc8378EB38" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet1RouteTableAssociation502CBE55": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcfoobarSubnet1RouteTableAF4E5874" + }, + "SubnetId": { + "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet2Subnet85B013AD": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "Vpc8378EB38" + }, + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.128.0/17", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "foobar" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Isolated" + }, + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet2RouteTable5127598D": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "Vpc8378EB38" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet2RouteTableAssociation5013D70B": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcfoobarSubnet2RouteTable5127598D" + }, + "SubnetId": { + "Ref": "VpcfoobarSubnet2Subnet85B013AD" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ParameterGroup5E32DECB": { + "Type": "AWS::Redshift::ClusterParameterGroup", + "Properties": { + "Description": "Cluster parameter group for family redshift-1.0", + "ParameterGroupFamily": "redshift-1.0", + "Parameters": [ + { + "ParameterName": "enable_user_activity_logging", + "ParameterValue": "true" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterSubnetsDCFA5CB7": { + "Type": "AWS::Redshift::ClusterSubnetGroup", + "Properties": { + "Description": "Subnets for Cluster Redshift cluster", + "SubnetIds": [ + { + "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" + }, + { + "Ref": "VpcfoobarSubnet2Subnet85B013AD" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterSecurityGroup0921994B": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "Redshift security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterSecret6368BD0F": { + "Type": "AWS::SecretsManager::Secret", + "Properties": { + "GenerateSecretString": { + "ExcludeCharacters": "\"@/\\ '", + "GenerateStringKey": "password", + "PasswordLength": 30, + "SecretStringTemplate": "{\"username\":\"admin\"}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterSecretAttachment769E6258": { + "Type": "AWS::SecretsManager::SecretTargetAttachment", + "Properties": { + "SecretId": { + "Ref": "ClusterSecret6368BD0F" + }, + "TargetId": { + "Ref": "ClusterEB0386A7" + }, + "TargetType": "AWS::Redshift::Cluster" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterEB0386A7": { + "Type": "AWS::Redshift::Cluster", + "Properties": { + "ClusterType": "multi-node", + "DBName": "default_db", + "MasterUsername": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "ClusterSecret6368BD0F" + }, + ":SecretString:username::}}" + ] + ] + }, + "MasterUserPassword": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "ClusterSecret6368BD0F" + }, + ":SecretString:password::}}" + ] + ] + }, + "NodeType": "dc2.large", + "AllowVersionUpgrade": true, + "AutomatedSnapshotRetentionPeriod": 1, + "ClusterParameterGroupName": { + "Ref": "ParameterGroup5E32DECB" + }, + "ClusterSubnetGroupName": { + "Ref": "ClusterSubnetsDCFA5CB7" + }, + "Encrypted": true, + "NumberOfNodes": 2, + "PubliclyAccessible": false, + "VpcSecurityGroupIds": [ + { + "Fn::GetAtt": [ + "ClusterSecurityGroup0921994B", + "GroupId" + ] + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", + "Roles": [ + { + "Ref": "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterResourceProviderframeworkonEvent15BB3722": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585.zip" + }, + "Role": { + "Fn::GetAtt": [ + "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE", + "Arn" + ] + }, + "Description": "AWS CDK resource provider framework - onEvent (aws-cdk-redshift-cluster-create/Cluster/ResourceProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + } + } + }, + "Handler": "framework.onEvent", + "Runtime": "nodejs14.x", + "Timeout": 900 + }, + "DependsOn": [ + "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", + "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterRedshiftClusterRebooterCustomResource773361E1": { + "Type": "Custom::RedshiftClusterRebooter", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "ClusterResourceProviderframeworkonEvent15BB3722", + "Arn" + ] + }, + "ClusterId": { + "Ref": "ClusterEB0386A7" + }, + "ParameterGroupName": { + "Ref": "ParameterGroup5E32DECB" + }, + "ParametersString": "{\"enable_user_activity_logging\":\"true\"}" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "redshift:DescribeClusters", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "redshift:RebootCluster", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":redshift:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":cluster:", + { + "Ref": "ClusterEB0386A7" + } + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF", + "Roles": [ + { + "Ref": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e.zip" + }, + "Role": { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525", + "Arn" + ] + }, + "Handler": "index.handler", + "Runtime": "nodejs16.x", + "Timeout": 900 + }, + "DependsOn": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF", + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/aws-cdk-redshift-cluster-update.assets.json b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/aws-cdk-redshift-cluster-update.assets.json new file mode 100644 index 0000000000000..4349cdb12e9be --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/aws-cdk-redshift-cluster-update.assets.json @@ -0,0 +1,45 @@ +{ + "version": "22.0.0", + "files": { + "1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e": { + "source": { + "path": "asset.1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585": { + "source": { + "path": "asset.a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "5a23231417fb67ed1d1d3f790c75060c7ca5f2b45a1e8b532dcaf9d8d40171cd": { + "source": { + "path": "aws-cdk-redshift-cluster-update.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "5a23231417fb67ed1d1d3f790c75060c7ca5f2b45a1e8b532dcaf9d8d40171cd.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/aws-cdk-redshift-cluster-update.template.json b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/aws-cdk-redshift-cluster-update.template.json new file mode 100644 index 0000000000000..a06dc5062ed6b --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/aws-cdk-redshift-cluster-update.template.json @@ -0,0 +1,575 @@ +{ + "Resources": { + "Vpc8378EB38": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-update/Vpc" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet1Subnet77A7FDC6": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "Vpc8378EB38" + }, + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.0.0/17", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "foobar" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Isolated" + }, + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet1RouteTableAF4E5874": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "Vpc8378EB38" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet1RouteTableAssociation502CBE55": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcfoobarSubnet1RouteTableAF4E5874" + }, + "SubnetId": { + "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet2Subnet85B013AD": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "Vpc8378EB38" + }, + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.128.0/17", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "foobar" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Isolated" + }, + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet2RouteTable5127598D": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "Vpc8378EB38" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "VpcfoobarSubnet2RouteTableAssociation5013D70B": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcfoobarSubnet2RouteTable5127598D" + }, + "SubnetId": { + "Ref": "VpcfoobarSubnet2Subnet85B013AD" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ParameterGroup5E32DECB": { + "Type": "AWS::Redshift::ClusterParameterGroup", + "Properties": { + "Description": "Cluster parameter group for family redshift-1.0", + "ParameterGroupFamily": "redshift-1.0", + "Parameters": [ + { + "ParameterName": "enable_user_activity_logging", + "ParameterValue": "false" + }, + { + "ParameterName": "use_fips_ssl", + "ParameterValue": "true" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterSubnetsDCFA5CB7": { + "Type": "AWS::Redshift::ClusterSubnetGroup", + "Properties": { + "Description": "Subnets for Cluster Redshift cluster", + "SubnetIds": [ + { + "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" + }, + { + "Ref": "VpcfoobarSubnet2Subnet85B013AD" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterSecurityGroup0921994B": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "Redshift security group", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterSecret6368BD0F": { + "Type": "AWS::SecretsManager::Secret", + "Properties": { + "GenerateSecretString": { + "ExcludeCharacters": "\"@/\\ '", + "GenerateStringKey": "password", + "PasswordLength": 30, + "SecretStringTemplate": "{\"username\":\"admin\"}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterSecretAttachment769E6258": { + "Type": "AWS::SecretsManager::SecretTargetAttachment", + "Properties": { + "SecretId": { + "Ref": "ClusterSecret6368BD0F" + }, + "TargetId": { + "Ref": "ClusterEB0386A7" + }, + "TargetType": "AWS::Redshift::Cluster" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterEB0386A7": { + "Type": "AWS::Redshift::Cluster", + "Properties": { + "ClusterType": "multi-node", + "DBName": "default_db", + "MasterUsername": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "ClusterSecret6368BD0F" + }, + ":SecretString:username::}}" + ] + ] + }, + "MasterUserPassword": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "ClusterSecret6368BD0F" + }, + ":SecretString:password::}}" + ] + ] + }, + "NodeType": "dc2.large", + "AllowVersionUpgrade": true, + "AutomatedSnapshotRetentionPeriod": 1, + "ClusterParameterGroupName": { + "Ref": "ParameterGroup5E32DECB" + }, + "ClusterSubnetGroupName": { + "Ref": "ClusterSubnetsDCFA5CB7" + }, + "Encrypted": true, + "NumberOfNodes": 2, + "PubliclyAccessible": false, + "VpcSecurityGroupIds": [ + { + "Fn::GetAtt": [ + "ClusterSecurityGroup0921994B", + "GroupId" + ] + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", + "Roles": [ + { + "Ref": "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterResourceProviderframeworkonEvent15BB3722": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585.zip" + }, + "Role": { + "Fn::GetAtt": [ + "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE", + "Arn" + ] + }, + "Description": "AWS CDK resource provider framework - onEvent (aws-cdk-redshift-cluster-update/Cluster/ResourceProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + } + } + }, + "Handler": "framework.onEvent", + "Runtime": "nodejs14.x", + "Timeout": 900 + }, + "DependsOn": [ + "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", + "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "ClusterRedshiftClusterRebooterCustomResource773361E1": { + "Type": "Custom::RedshiftClusterRebooter", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "ClusterResourceProviderframeworkonEvent15BB3722", + "Arn" + ] + }, + "ClusterId": { + "Ref": "ClusterEB0386A7" + }, + "ParameterGroupName": { + "Ref": "ParameterGroup5E32DECB" + }, + "ParametersString": "{\"enable_user_activity_logging\":\"false\",\"use_fips_ssl\":\"true\"}" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "redshift:DescribeClusters", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "redshift:RebootCluster", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":redshift:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":cluster:", + { + "Ref": "ClusterEB0386A7" + } + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF", + "Roles": [ + { + "Ref": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e.zip" + }, + "Role": { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525", + "Arn" + ] + }, + "Handler": "index.handler", + "Runtime": "nodejs16.x", + "Timeout": 900 + }, + "DependsOn": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF", + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Outputs": { + "ExportsOutputRefClusterEB0386A796A0E3FE": { + "Value": { + "Ref": "ClusterEB0386A7" + }, + "Export": { + "Name": "aws-cdk-redshift-cluster-reboot-integ:ExportsOutputRefClusterEB0386A796A0E3FE" + } + }, + "ExportsOutputRefParameterGroup5E32DECBB33EA140": { + "Value": { + "Ref": "ParameterGroup5E32DECB" + }, + "Export": { + "Name": "aws-cdk-redshift-cluster-reboot-integ:ExportsOutputRefParameterGroup5E32DECBB33EA140" + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets.json b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets.json new file mode 100644 index 0000000000000..3db8d2f9bd63d --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets.json @@ -0,0 +1,32 @@ +{ + "version": "22.0.0", + "files": { + "382ba2a8fd0a13f6782aec5543e465f988f5c100f35ed20f90cd96b8ee53f674": { + "source": { + "path": "asset.382ba2a8fd0a13f6782aec5543e465f988f5c100f35ed20f90cd96b8ee53f674.bundle", + "packaging": "zip" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "382ba2a8fd0a13f6782aec5543e465f988f5c100f35ed20f90cd96b8ee53f674.zip", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + }, + "02ba7e5975057b784436be8170fb2b40a050d51601ba1ed065a7339ea2cd67ae": { + "source": { + "path": "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "02ba7e5975057b784436be8170fb2b40a050d51601ba1ed065a7339ea2cd67ae.json", + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.template.json b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.template.json new file mode 100644 index 0000000000000..8cb906f08a943 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.template.json @@ -0,0 +1,177 @@ +{ + "Resources": { + "AwsApiCallRedshiftdescribeClusters": { + "Type": "Custom::DeployAssert@SdkCallRedshiftdescribeClusters", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", + "Arn" + ] + }, + "service": "Redshift", + "api": "describeClusters", + "expected": "{\"$StringLike\":\"in-sync\"}", + "actualPath": "Clusters.0.ClusterParameterGroups.0.ParameterApplyStatus", + "parameters": { + "ClusterIdentifier": { + "Fn::ImportValue": "aws-cdk-redshift-cluster-reboot-integ:ExportsOutputRefClusterEB0386A796A0E3FE" + } + }, + "flattenResponse": "true", + "outputPaths": [ + "Clusters.0.ClusterParameterGroups.0.ParameterApplyStatus" + ], + "salt": "1671057311528" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ] + }, + "ManagedPolicyArns": [ + { + "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + } + ], + "Policies": [ + { + "PolicyName": "Inline", + "PolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": [ + "redshift:DescribeClusters" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + }, + { + "Action": [ + "redshift:DescribeClusterParameters" + ], + "Effect": "Allow", + "Resource": [ + "*" + ] + } + ] + } + } + ] + } + }, + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Runtime": "nodejs14.x", + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "382ba2a8fd0a13f6782aec5543e465f988f5c100f35ed20f90cd96b8ee53f674.zip" + }, + "Timeout": 120, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73", + "Arn" + ] + } + } + }, + "AwsApiCallRedshiftdescribeClusterParameters": { + "Type": "Custom::DeployAssert@SdkCallRedshiftdescribeClusterParameter", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F", + "Arn" + ] + }, + "service": "Redshift", + "api": "describeClusterParameters", + "expected": "{\"$ObjectLike\":{\"Parameters\":{\"$ArrayWith\":[{\"$ObjectLike\":{\"ParameterName\":\"enable_user_activity_logging\",\"ParameterValue\":\"false\"}},{\"$ObjectLike\":{\"ParameterName\":\"use_fips_ssl\",\"ParameterValue\":\"true\"}}]}}}", + "parameters": { + "ParameterGroupName": { + "Fn::ImportValue": "aws-cdk-redshift-cluster-reboot-integ:ExportsOutputRefParameterGroup5E32DECBB33EA140" + }, + "Source": "user" + }, + "flattenResponse": "false", + "salt": "1671057311529" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Outputs": { + "AssertionResultsAwsApiCallRedshiftdescribeClusters": { + "Value": { + "Fn::GetAtt": [ + "AwsApiCallRedshiftdescribeClusters", + "assertion" + ] + } + }, + "AssertionResultsAwsApiCallRedshiftdescribeClusterParameters": { + "Value": { + "Fn::GetAtt": [ + "AwsApiCallRedshiftdescribeClusterParameters", + "assertion" + ] + } + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/cdk.out b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/cdk.out new file mode 100644 index 0000000000000..145739f539580 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"22.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/integ.json b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/integ.json new file mode 100644 index 0000000000000..9cdefdeec7bab --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/integ.json @@ -0,0 +1,14 @@ +{ + "version": "22.0.0", + "testCases": { + "aws-cdk-redshift-reboot-test/DefaultTest": { + "stacks": [ + "aws-cdk-redshift-cluster-create", + "aws-cdk-redshift-cluster-update" + ], + "stackUpdateWorkflow": false, + "assertionStack": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert", + "assertionStackName": "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/manifest.json b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/manifest.json new file mode 100644 index 0000000000000..614f41d6c6a65 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/manifest.json @@ -0,0 +1,444 @@ +{ + "version": "22.0.0", + "artifacts": { + "aws-cdk-redshift-cluster-create.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "aws-cdk-redshift-cluster-create.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "aws-cdk-redshift-cluster-create": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "aws-cdk-redshift-cluster-create.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/93a411da5664a42e1702532262aa281227dd5fc1f136148d06a42addd7c763c0.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "aws-cdk-redshift-cluster-create.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + }, + "stackName": "aws-cdk-redshift-cluster-reboot-integ" + }, + "dependencies": [ + "aws-cdk-redshift-cluster-create.assets" + ], + "metadata": { + "/aws-cdk-redshift-cluster-create/Vpc/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Vpc8378EB38" + } + ], + "/aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet1Subnet77A7FDC6" + } + ], + "/aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet1RouteTableAF4E5874" + } + ], + "/aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet1RouteTableAssociation502CBE55" + } + ], + "/aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet2Subnet85B013AD" + } + ], + "/aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet2RouteTable5127598D" + } + ], + "/aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet2RouteTableAssociation5013D70B" + } + ], + "/aws-cdk-redshift-cluster-create/ParameterGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ParameterGroup5E32DECB" + } + ], + "/aws-cdk-redshift-cluster-create/Cluster/Subnets/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterSubnetsDCFA5CB7" + } + ], + "/aws-cdk-redshift-cluster-create/Cluster/SecurityGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterSecurityGroup0921994B" + } + ], + "/aws-cdk-redshift-cluster-create/Cluster/Secret/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterSecret6368BD0F" + } + ], + "/aws-cdk-redshift-cluster-create/Cluster/Secret/Attachment/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterSecretAttachment769E6258" + } + ], + "/aws-cdk-redshift-cluster-create/Cluster/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterEB0386A7" + } + ], + "/aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" + } + ], + "/aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86" + } + ], + "/aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterResourceProviderframeworkonEvent15BB3722" + } + ], + "/aws-cdk-redshift-cluster-create/Cluster/RedshiftClusterRebooterCustomResource/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterRedshiftClusterRebooterCustomResource773361E1" + } + ], + "/aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" + } + ], + "/aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF" + } + ], + "/aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5" + } + ], + "/aws-cdk-redshift-cluster-create/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/aws-cdk-redshift-cluster-create/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "aws-cdk-redshift-cluster-create" + }, + "aws-cdk-redshift-cluster-update.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "aws-cdk-redshift-cluster-update.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "aws-cdk-redshift-cluster-update": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "aws-cdk-redshift-cluster-update.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/5a23231417fb67ed1d1d3f790c75060c7ca5f2b45a1e8b532dcaf9d8d40171cd.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "aws-cdk-redshift-cluster-update.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + }, + "stackName": "aws-cdk-redshift-cluster-reboot-integ" + }, + "dependencies": [ + "aws-cdk-redshift-cluster-create", + "aws-cdk-redshift-cluster-update.assets" + ], + "metadata": { + "/aws-cdk-redshift-cluster-update/Vpc/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Vpc8378EB38" + } + ], + "/aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet1Subnet77A7FDC6" + } + ], + "/aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet1RouteTableAF4E5874" + } + ], + "/aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet1RouteTableAssociation502CBE55" + } + ], + "/aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet2Subnet85B013AD" + } + ], + "/aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet2RouteTable5127598D" + } + ], + "/aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcfoobarSubnet2RouteTableAssociation5013D70B" + } + ], + "/aws-cdk-redshift-cluster-update/ParameterGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ParameterGroup5E32DECB" + } + ], + "/aws-cdk-redshift-cluster-update/Cluster/Subnets/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterSubnetsDCFA5CB7" + } + ], + "/aws-cdk-redshift-cluster-update/Cluster/SecurityGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterSecurityGroup0921994B" + } + ], + "/aws-cdk-redshift-cluster-update/Cluster/Secret/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterSecret6368BD0F" + } + ], + "/aws-cdk-redshift-cluster-update/Cluster/Secret/Attachment/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterSecretAttachment769E6258" + } + ], + "/aws-cdk-redshift-cluster-update/Cluster/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterEB0386A7" + } + ], + "/aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" + } + ], + "/aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86" + } + ], + "/aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterResourceProviderframeworkonEvent15BB3722" + } + ], + "/aws-cdk-redshift-cluster-update/Cluster/RedshiftClusterRebooterCustomResource/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterRedshiftClusterRebooterCustomResource773361E1" + } + ], + "/aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" + } + ], + "/aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF" + } + ], + "/aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5" + } + ], + "/aws-cdk-redshift-cluster-update/Exports/Output{\"Ref\":\"ClusterEB0386A7\"}": [ + { + "type": "aws:cdk:logicalId", + "data": "ExportsOutputRefClusterEB0386A796A0E3FE" + } + ], + "/aws-cdk-redshift-cluster-update/Exports/Output{\"Ref\":\"ParameterGroup5E32DECB\"}": [ + { + "type": "aws:cdk:logicalId", + "data": "ExportsOutputRefParameterGroup5E32DECBB33EA140" + } + ], + "/aws-cdk-redshift-cluster-update/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/aws-cdk-redshift-cluster-update/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "aws-cdk-redshift-cluster-update" + }, + "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/02ba7e5975057b784436be8170fb2b40a050d51601ba1ed065a7339ea2cd67ae.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "aws-cdk-redshift-cluster-update", + "awscdkredshiftreboottestDefaultTestDeployAssert1AE11B34.assets" + ], + "metadata": { + "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters/Default/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "AwsApiCallRedshiftdescribeClusters" + } + ], + "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters/AssertionResults": [ + { + "type": "aws:cdk:logicalId", + "data": "AssertionResultsAwsApiCallRedshiftdescribeClusters" + } + ], + "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role": [ + { + "type": "aws:cdk:logicalId", + "data": "SingletonFunction1488541a7b23466481b69b4408076b81Role37ABCE73" + } + ], + "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler": [ + { + "type": "aws:cdk:logicalId", + "data": "SingletonFunction1488541a7b23466481b69b4408076b81HandlerCD40AE9F" + } + ], + "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters/Default/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "AwsApiCallRedshiftdescribeClusterParameters" + } + ], + "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters/AssertionResults": [ + { + "type": "aws:cdk:logicalId", + "data": "AssertionResultsAwsApiCallRedshiftdescribeClusterParameters" + } + ], + "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/tree.json b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/tree.json new file mode 100644 index 0000000000000..f4bf2ad97974e --- /dev/null +++ b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.js.snapshot/tree.json @@ -0,0 +1,2041 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "aws-cdk-redshift-cluster-create": { + "id": "aws-cdk-redshift-cluster-create", + "path": "aws-cdk-redshift-cluster-create", + "children": { + "Vpc": { + "id": "Vpc", + "path": "aws-cdk-redshift-cluster-create/Vpc", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/Vpc/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPC", + "aws:cdk:cloudformation:props": { + "cidrBlock": "10.0.0.0/16", + "enableDnsHostnames": true, + "enableDnsSupport": true, + "instanceTenancy": "default", + "tags": [ + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-create/Vpc" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnVPC", + "version": "0.0.0" + } + }, + "foobarSubnet1": { + "id": "foobarSubnet1", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "Vpc8378EB38" + }, + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.0.0/17", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "foobar" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Isolated" + }, + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/Acl", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "Vpc8378EB38" + }, + "tags": [ + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VpcfoobarSubnet1RouteTableAF4E5874" + }, + "subnetId": { + "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "foobarSubnet2": { + "id": "foobarSubnet2", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "Vpc8378EB38" + }, + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.128.0/17", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "foobar" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Isolated" + }, + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/Acl", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "Vpc8378EB38" + }, + "tags": [ + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-cdk-redshift-cluster-create/Vpc/foobarSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VpcfoobarSubnet2RouteTable5127598D" + }, + "subnetId": { + "Ref": "VpcfoobarSubnet2Subnet85B013AD" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.Vpc", + "version": "0.0.0" + } + }, + "ParameterGroup": { + "id": "ParameterGroup", + "path": "aws-cdk-redshift-cluster-create/ParameterGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/ParameterGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Redshift::ClusterParameterGroup", + "aws:cdk:cloudformation:props": { + "description": "Cluster parameter group for family redshift-1.0", + "parameterGroupFamily": "redshift-1.0", + "parameters": [ + { + "parameterName": "enable_user_activity_logging", + "parameterValue": "true" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.CfnClusterParameterGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.ClusterParameterGroup", + "version": "0.0.0" + } + }, + "Cluster": { + "id": "Cluster", + "path": "aws-cdk-redshift-cluster-create/Cluster", + "children": { + "Subnets": { + "id": "Subnets", + "path": "aws-cdk-redshift-cluster-create/Cluster/Subnets", + "children": { + "Default": { + "id": "Default", + "path": "aws-cdk-redshift-cluster-create/Cluster/Subnets/Default", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Redshift::ClusterSubnetGroup", + "aws:cdk:cloudformation:props": { + "description": "Subnets for Cluster Redshift cluster", + "subnetIds": [ + { + "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" + }, + { + "Ref": "VpcfoobarSubnet2Subnet85B013AD" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.CfnClusterSubnetGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.ClusterSubnetGroup", + "version": "0.0.0" + } + }, + "SecurityGroup": { + "id": "SecurityGroup", + "path": "aws-cdk-redshift-cluster-create/Cluster/SecurityGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/Cluster/SecurityGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "Redshift security group", + "securityGroupEgress": [ + { + "cidrIp": "0.0.0.0/0", + "description": "Allow all outbound traffic by default", + "ipProtocol": "-1" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.SecurityGroup", + "version": "0.0.0" + } + }, + "Secret": { + "id": "Secret", + "path": "aws-cdk-redshift-cluster-create/Cluster/Secret", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/Cluster/Secret/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::Secret", + "aws:cdk:cloudformation:props": { + "generateSecretString": { + "passwordLength": 30, + "secretStringTemplate": "{\"username\":\"admin\"}", + "generateStringKey": "password", + "excludeCharacters": "\"@/\\ '" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.CfnSecret", + "version": "0.0.0" + } + }, + "Attachment": { + "id": "Attachment", + "path": "aws-cdk-redshift-cluster-create/Cluster/Secret/Attachment", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/Cluster/Secret/Attachment/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::SecretTargetAttachment", + "aws:cdk:cloudformation:props": { + "secretId": { + "Ref": "ClusterSecret6368BD0F" + }, + "targetId": { + "Ref": "ClusterEB0386A7" + }, + "targetType": "AWS::Redshift::Cluster" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.CfnSecretTargetAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.SecretTargetAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.DatabaseSecret", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/Cluster/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Redshift::Cluster", + "aws:cdk:cloudformation:props": { + "clusterType": "multi-node", + "dbName": "default_db", + "masterUsername": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "ClusterSecret6368BD0F" + }, + ":SecretString:username::}}" + ] + ] + }, + "masterUserPassword": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "ClusterSecret6368BD0F" + }, + ":SecretString:password::}}" + ] + ] + }, + "nodeType": "dc2.large", + "allowVersionUpgrade": true, + "automatedSnapshotRetentionPeriod": 1, + "clusterParameterGroupName": { + "Ref": "ParameterGroup5E32DECB" + }, + "clusterSubnetGroupName": { + "Ref": "ClusterSubnetsDCFA5CB7" + }, + "encrypted": true, + "numberOfNodes": 2, + "publiclyAccessible": false, + "vpcSecurityGroupIds": [ + { + "Fn::GetAtt": [ + "ClusterSecurityGroup0921994B", + "GroupId" + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.CfnCluster", + "version": "0.0.0" + } + }, + "RedshiftClusterRebooterFunction": { + "id": "RedshiftClusterRebooterFunction", + "path": "aws-cdk-redshift-cluster-create/Cluster/RedshiftClusterRebooterFunction", + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.SingletonFunction", + "version": "0.0.0" + } + }, + "ResourceProvider": { + "id": "ResourceProvider", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider", + "children": { + "framework-onEvent": { + "id": "framework-onEvent", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "policyName": "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", + "roles": [ + { + "Ref": "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3-assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/Cluster/ResourceProvider/framework-onEvent/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585.zip" + }, + "role": { + "Fn::GetAtt": [ + "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE", + "Arn" + ] + }, + "description": "AWS CDK resource provider framework - onEvent (aws-cdk-redshift-cluster-create/Cluster/ResourceProvider)", + "environment": { + "variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + } + } + }, + "handler": "framework.onEvent", + "runtime": "nodejs14.x", + "timeout": 900 + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.Function", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/custom-resources.Provider", + "version": "0.0.0" + } + }, + "RedshiftClusterRebooterCustomResource": { + "id": "RedshiftClusterRebooterCustomResource", + "path": "aws-cdk-redshift-cluster-create/Cluster/RedshiftClusterRebooterCustomResource", + "children": { + "Default": { + "id": "Default", + "path": "aws-cdk-redshift-cluster-create/Cluster/RedshiftClusterRebooterCustomResource/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.Cluster", + "version": "0.0.0" + } + }, + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2": { + "id": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "redshift:DescribeClusters", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "redshift:RebootCluster", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":redshift:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":cluster:", + { + "Ref": "ClusterEB0386A7" + } + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "policyName": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF", + "roles": [ + { + "Ref": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3-assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-create/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e.zip" + }, + "role": { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525", + "Arn" + ] + }, + "handler": "index.handler", + "runtime": "nodejs16.x", + "timeout": 900 + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.Function", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-cdk-redshift-cluster-create/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-cdk-redshift-cluster-create/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "aws-cdk-redshift-cluster-update": { + "id": "aws-cdk-redshift-cluster-update", + "path": "aws-cdk-redshift-cluster-update", + "children": { + "Vpc": { + "id": "Vpc", + "path": "aws-cdk-redshift-cluster-update/Vpc", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/Vpc/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPC", + "aws:cdk:cloudformation:props": { + "cidrBlock": "10.0.0.0/16", + "enableDnsHostnames": true, + "enableDnsSupport": true, + "instanceTenancy": "default", + "tags": [ + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-update/Vpc" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnVPC", + "version": "0.0.0" + } + }, + "foobarSubnet1": { + "id": "foobarSubnet1", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "Vpc8378EB38" + }, + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.0.0/17", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "foobar" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Isolated" + }, + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/Acl", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "Vpc8378EB38" + }, + "tags": [ + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VpcfoobarSubnet1RouteTableAF4E5874" + }, + "subnetId": { + "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "foobarSubnet2": { + "id": "foobarSubnet2", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "Vpc8378EB38" + }, + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.128.0/17", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "foobar" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Isolated" + }, + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/Acl", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "Vpc8378EB38" + }, + "tags": [ + { + "key": "Name", + "value": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-cdk-redshift-cluster-update/Vpc/foobarSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VpcfoobarSubnet2RouteTable5127598D" + }, + "subnetId": { + "Ref": "VpcfoobarSubnet2Subnet85B013AD" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.Vpc", + "version": "0.0.0" + } + }, + "ParameterGroup": { + "id": "ParameterGroup", + "path": "aws-cdk-redshift-cluster-update/ParameterGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/ParameterGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Redshift::ClusterParameterGroup", + "aws:cdk:cloudformation:props": { + "description": "Cluster parameter group for family redshift-1.0", + "parameterGroupFamily": "redshift-1.0", + "parameters": [ + { + "parameterName": "enable_user_activity_logging", + "parameterValue": "false" + }, + { + "parameterName": "use_fips_ssl", + "parameterValue": "true" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.CfnClusterParameterGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.ClusterParameterGroup", + "version": "0.0.0" + } + }, + "Cluster": { + "id": "Cluster", + "path": "aws-cdk-redshift-cluster-update/Cluster", + "children": { + "Subnets": { + "id": "Subnets", + "path": "aws-cdk-redshift-cluster-update/Cluster/Subnets", + "children": { + "Default": { + "id": "Default", + "path": "aws-cdk-redshift-cluster-update/Cluster/Subnets/Default", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Redshift::ClusterSubnetGroup", + "aws:cdk:cloudformation:props": { + "description": "Subnets for Cluster Redshift cluster", + "subnetIds": [ + { + "Ref": "VpcfoobarSubnet1Subnet77A7FDC6" + }, + { + "Ref": "VpcfoobarSubnet2Subnet85B013AD" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.CfnClusterSubnetGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.ClusterSubnetGroup", + "version": "0.0.0" + } + }, + "SecurityGroup": { + "id": "SecurityGroup", + "path": "aws-cdk-redshift-cluster-update/Cluster/SecurityGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/Cluster/SecurityGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "Redshift security group", + "securityGroupEgress": [ + { + "cidrIp": "0.0.0.0/0", + "description": "Allow all outbound traffic by default", + "ipProtocol": "-1" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.SecurityGroup", + "version": "0.0.0" + } + }, + "Secret": { + "id": "Secret", + "path": "aws-cdk-redshift-cluster-update/Cluster/Secret", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/Cluster/Secret/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::Secret", + "aws:cdk:cloudformation:props": { + "generateSecretString": { + "passwordLength": 30, + "secretStringTemplate": "{\"username\":\"admin\"}", + "generateStringKey": "password", + "excludeCharacters": "\"@/\\ '" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.CfnSecret", + "version": "0.0.0" + } + }, + "Attachment": { + "id": "Attachment", + "path": "aws-cdk-redshift-cluster-update/Cluster/Secret/Attachment", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/Cluster/Secret/Attachment/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::SecretTargetAttachment", + "aws:cdk:cloudformation:props": { + "secretId": { + "Ref": "ClusterSecret6368BD0F" + }, + "targetId": { + "Ref": "ClusterEB0386A7" + }, + "targetType": "AWS::Redshift::Cluster" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.CfnSecretTargetAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-secretsmanager.SecretTargetAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.DatabaseSecret", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/Cluster/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Redshift::Cluster", + "aws:cdk:cloudformation:props": { + "clusterType": "multi-node", + "dbName": "default_db", + "masterUsername": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "ClusterSecret6368BD0F" + }, + ":SecretString:username::}}" + ] + ] + }, + "masterUserPassword": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "ClusterSecret6368BD0F" + }, + ":SecretString:password::}}" + ] + ] + }, + "nodeType": "dc2.large", + "allowVersionUpgrade": true, + "automatedSnapshotRetentionPeriod": 1, + "clusterParameterGroupName": { + "Ref": "ParameterGroup5E32DECB" + }, + "clusterSubnetGroupName": { + "Ref": "ClusterSubnetsDCFA5CB7" + }, + "encrypted": true, + "numberOfNodes": 2, + "publiclyAccessible": false, + "vpcSecurityGroupIds": [ + { + "Fn::GetAtt": [ + "ClusterSecurityGroup0921994B", + "GroupId" + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.CfnCluster", + "version": "0.0.0" + } + }, + "RedshiftClusterRebooterFunction": { + "id": "RedshiftClusterRebooterFunction", + "path": "aws-cdk-redshift-cluster-update/Cluster/RedshiftClusterRebooterFunction", + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.SingletonFunction", + "version": "0.0.0" + } + }, + "ResourceProvider": { + "id": "ResourceProvider", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider", + "children": { + "framework-onEvent": { + "id": "framework-onEvent", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/ServiceRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "policyName": "ClusterResourceProviderframeworkonEventServiceRoleDefaultPolicy525CDD86", + "roles": [ + { + "Ref": "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3-assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/Cluster/ResourceProvider/framework-onEvent/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "a8a62b989c7866e3ad5b24f3eb6228f8ca91ebff5f5c76f1da466f6c805c0585.zip" + }, + "role": { + "Fn::GetAtt": [ + "ClusterResourceProviderframeworkonEventServiceRoleD686A5EE", + "Arn" + ] + }, + "description": "AWS CDK resource provider framework - onEvent (aws-cdk-redshift-cluster-update/Cluster/ResourceProvider)", + "environment": { + "variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac281740AC5", + "Arn" + ] + } + } + }, + "handler": "framework.onEvent", + "runtime": "nodejs14.x", + "timeout": 900 + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.Function", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/custom-resources.Provider", + "version": "0.0.0" + } + }, + "RedshiftClusterRebooterCustomResource": { + "id": "RedshiftClusterRebooterCustomResource", + "path": "aws-cdk-redshift-cluster-update/Cluster/RedshiftClusterRebooterCustomResource", + "children": { + "Default": { + "id": "Default", + "path": "aws-cdk-redshift-cluster-update/Cluster/RedshiftClusterRebooterCustomResource/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift.Cluster", + "version": "0.0.0" + } + }, + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2": { + "id": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/ServiceRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "redshift:DescribeClusters", + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "redshift:RebootCluster", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":redshift:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":cluster:", + { + "Ref": "ClusterEB0386A7" + } + ] + ] + } + } + ], + "Version": "2012-10-17" + }, + "policyName": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRoleDefaultPolicyF49983EF", + "roles": [ + { + "Ref": "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-iam.Role", + "version": "0.0.0" + } + }, + "Code": { + "id": "Code", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Code", + "children": { + "Stage": { + "id": "Stage", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Code/Stage", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "AssetBucket": { + "id": "AssetBucket", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Code/AssetBucket", + "constructInfo": { + "fqn": "@aws-cdk/aws-s3.BucketBase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-s3-assets.Asset", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-cdk-redshift-cluster-update/SingletonLambda511e207f13df4b8bb632c32b30b65ac2/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "s3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "s3Key": "1b88b7c3e3e0f8d3e27ded1bde51b7a80c75f3d8733872af7952c3a6d902147e.zip" + }, + "role": { + "Fn::GetAtt": [ + "SingletonLambda511e207f13df4b8bb632c32b30b65ac2ServiceRole4BDC9525", + "Arn" + ] + }, + "handler": "index.handler", + "runtime": "nodejs16.x", + "timeout": 900 + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.CfnFunction", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-lambda.Function", + "version": "0.0.0" + } + }, + "Exports": { + "id": "Exports", + "path": "aws-cdk-redshift-cluster-update/Exports", + "children": { + "Output{\"Ref\":\"ClusterEB0386A7\"}": { + "id": "Output{\"Ref\":\"ClusterEB0386A7\"}", + "path": "aws-cdk-redshift-cluster-update/Exports/Output{\"Ref\":\"ClusterEB0386A7\"}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + }, + "Output{\"Ref\":\"ParameterGroup5E32DECB\"}": { + "id": "Output{\"Ref\":\"ParameterGroup5E32DECB\"}", + "path": "aws-cdk-redshift-cluster-update/Exports/Output{\"Ref\":\"ParameterGroup5E32DECB\"}", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.182" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-cdk-redshift-cluster-update/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-cdk-redshift-cluster-update/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "aws-cdk-redshift-reboot-test": { + "id": "aws-cdk-redshift-reboot-test", + "path": "aws-cdk-redshift-reboot-test", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "aws-cdk-redshift-reboot-test/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.182" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert", + "children": { + "AwsApiCallRedshiftdescribeClusters": { + "id": "AwsApiCallRedshiftdescribeClusters", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters", + "children": { + "SdkProvider": { + "id": "SdkProvider", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters/SdkProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters/SdkProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.182" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", + "version": "0.0.0" + } + }, + "Default": { + "id": "Default", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters/Default", + "children": { + "Default": { + "id": "Default", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters/Default/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + }, + "AssertionResults": { + "id": "AssertionResults", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusters/AssertionResults", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AwsApiCall", + "version": "0.0.0" + } + }, + "SingletonFunction1488541a7b23466481b69b4408076b81": { + "id": "SingletonFunction1488541a7b23466481b69b4408076b81", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81", + "children": { + "Staging": { + "id": "Staging", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Staging", + "constructInfo": { + "fqn": "@aws-cdk/core.AssetStaging", + "version": "0.0.0" + } + }, + "Role": { + "id": "Role", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Role", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + }, + "Handler": { + "id": "Handler", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/SingletonFunction1488541a7b23466481b69b4408076b81/Handler", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.182" + } + }, + "AwsApiCallRedshiftdescribeClusterParameters": { + "id": "AwsApiCallRedshiftdescribeClusterParameters", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters", + "children": { + "SdkProvider": { + "id": "SdkProvider", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters/SdkProvider", + "children": { + "AssertionsProvider": { + "id": "AssertionsProvider", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters/SdkProvider/AssertionsProvider", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.182" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AssertionsProvider", + "version": "0.0.0" + } + }, + "Default": { + "id": "Default", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters/Default", + "children": { + "Default": { + "id": "Default", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters/Default/Default", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.CustomResource", + "version": "0.0.0" + } + }, + "AssertionResults": { + "id": "AssertionResults", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/AwsApiCallRedshiftdescribeClusterParameters/AssertionResults", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnOutput", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.AwsApiCall", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-cdk-redshift-reboot-test/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.182" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.ts b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.ts index d8cd1eef3e50b..2645ee74dd686 100644 --- a/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.ts +++ b/packages/@aws-cdk/aws-redshift/test/integ.cluster-reboot.ts @@ -1,6 +1,7 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import * as cdk from '@aws-cdk/core'; import * as integ from '@aws-cdk/integ-tests'; +import { Match } from '@aws-cdk/integ-tests'; import * as constructs from 'constructs'; import * as redshift from '../lib'; @@ -10,8 +11,7 @@ import * as redshift from '../lib'; * 1. Creates a stack with a Redshift cluster. * 2. Creates a second stack with the same name to update the parameter group and cause the custom resource to run. * - * The diff assets flag and assertions have been commented out due to some current issues with integ-tests. - * This test was manually verified by manually checking the sync status and reboot history of the redshift cluster. + * The diff assets flag (used when testing custom resources) has been commented out due to snapshots not properly verifying in CodeBuild. */ const app = new cdk.App(); @@ -76,41 +76,26 @@ stacks.forEach(s => { }); }); -new integ.IntegTest(app, 'aws-cdk-redshift-reboot-test', { +const test = new integ.IntegTest(app, 'aws-cdk-redshift-reboot-test', { testCases: stacks, - stackUpdateWorkflow: true, + stackUpdateWorkflow: false, // diffAssets: true, }); -// https://github.com/aws/aws-cdk/issues/22059 -// const describeCluster = test.assertions.awsApiCall('Redshift', 'describeClusters', { -// ClusterIdentifier: updateStack.cluster.clusterName, -// }); - -// describeCluster.expect(integ.ExpectedResult.objectLike( -// { -// ParameterGroupName: updateStack.parameterGroup.clusterParameterGroupName, -// ParameterApplyStatus: 'in-sync', -// }, -// )); - -// const describeParams = test.assertions.awsApiCall('Redshift', 'describeClusterParameters', { -// ParameterGroupName: updateStack.parameterGroup.clusterParameterGroupName, -// }); - -// describeParams.expect(integ.ExpectedResult.arrayWith([ -// integ.ExpectedResult.objectLike( -// { -// ParameterName: 'enable_user_activity_logging', -// ParameterValue: 'false', -// }, -// ), -// integ.ExpectedResult.objectLike( -// { -// ParameterName: 'use_fips_ssl', -// ParameterValue: 'true', -// }, -// ), -// ])); - +const describeClusters = test.assertions.awsApiCall('Redshift', 'describeClusters', { ClusterIdentifier: updateStack.cluster.clusterName }); +describeClusters.assertAtPath('Clusters.0.ClusterParameterGroups.0.ParameterGroupName', integ.ExpectedResult.stringLikeRegexp(updateStack.parameterGroup.clusterParameterGroupName)); +describeClusters.assertAtPath('Clusters.0.ClusterParameterGroups.0.ParameterApplyStatus', integ.ExpectedResult.stringLikeRegexp('in-sync')); + +const describeParams = test.assertions.awsApiCall('Redshift', 'describeClusterParameters', + { + ParameterGroupName: updateStack.parameterGroup.clusterParameterGroupName, + Source: 'user', + }, +); +describeParams.expect(integ.ExpectedResult.objectLike({ + Parameters: Match.arrayWith([ + Match.objectLike({ ParameterName: 'enable_user_activity_logging', ParameterValue: 'false' }), + Match.objectLike({ ParameterName: 'use_fips_ssl', ParameterValue: 'true' }), + ]), +})); app.synth(); From b6c323d187e40780d3e32fd43318f18ce8443917 Mon Sep 17 00:00:00 2001 From: Arun Donti Date: Tue, 14 Feb 2023 10:55:04 -0500 Subject: [PATCH 12/15] refactor: removing unknown-error from reboot actions --- .../lib/cluster-parameter-change-reboot-handler/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-redshift/lib/cluster-parameter-change-reboot-handler/index.ts b/packages/@aws-cdk/aws-redshift/lib/cluster-parameter-change-reboot-handler/index.ts index f69314783b600..a0bbdb920f59f 100644 --- a/packages/@aws-cdk/aws-redshift/lib/cluster-parameter-change-reboot-handler/index.ts +++ b/packages/@aws-cdk/aws-redshift/lib/cluster-parameter-change-reboot-handler/index.ts @@ -17,7 +17,7 @@ async function rebootClusterIfRequired(clusterId: string, parameterGroupName: st // https://docs.aws.amazon.com/redshift/latest/APIReference/API_ClusterParameterStatus.html async function executeActionForStatus(status: string, retryDurationMs?: number): Promise { await sleep(retryDurationMs ?? 0); - if (['pending-reboot', 'apply-deferred', 'apply-error', 'unknown-error'].includes(status)) { + if (['pending-reboot', 'apply-deferred', 'apply-error'].includes(status)) { try { await redshift.rebootCluster({ ClusterIdentifier: clusterId }).promise(); } catch (err) { From 80848a95b82da7ac917b6766b5bd4a9b902d0ec1 Mon Sep 17 00:00:00 2001 From: Arun Donti Date: Tue, 14 Feb 2023 15:50:11 -0500 Subject: [PATCH 13/15] Update packages/@aws-cdk/aws-redshift/lib/cluster-parameter-change-reboot-handler/index.ts Co-authored-by: Calvin Combs <66279577+comcalvi@users.noreply.github.com> --- .../lib/cluster-parameter-change-reboot-handler/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-redshift/lib/cluster-parameter-change-reboot-handler/index.ts b/packages/@aws-cdk/aws-redshift/lib/cluster-parameter-change-reboot-handler/index.ts index a0bbdb920f59f..ab7432375fc55 100644 --- a/packages/@aws-cdk/aws-redshift/lib/cluster-parameter-change-reboot-handler/index.ts +++ b/packages/@aws-cdk/aws-redshift/lib/cluster-parameter-change-reboot-handler/index.ts @@ -21,7 +21,7 @@ async function rebootClusterIfRequired(clusterId: string, parameterGroupName: st try { await redshift.rebootCluster({ ClusterIdentifier: clusterId }).promise(); } catch (err) { - if ((err).code === 'InvalidClusterState') { + if ((err as any).code === 'InvalidClusterState') { return await executeActionForStatus(status, 30000); } else { throw err; From f91ffeb87204b7819b904c24242f7ab82029381b Mon Sep 17 00:00:00 2001 From: Arun Donti Date: Thu, 16 Feb 2023 16:53:24 -0500 Subject: [PATCH 14/15] refactor: use guard clause for clarity --- packages/@aws-cdk/aws-redshift/lib/cluster.ts | 121 +++++++++--------- 1 file changed, 61 insertions(+), 60 deletions(-) diff --git a/packages/@aws-cdk/aws-redshift/lib/cluster.ts b/packages/@aws-cdk/aws-redshift/lib/cluster.ts index 951dae66cb913..4df592642596b 100644 --- a/packages/@aws-cdk/aws-redshift/lib/cluster.ts +++ b/packages/@aws-cdk/aws-redshift/lib/cluster.ts @@ -1,4 +1,3 @@ -import * as path from 'path'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; @@ -8,6 +7,7 @@ import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; import { ArnFormat, CustomResource, Duration, IResource, Lazy, RemovalPolicy, Resource, SecretValue, Stack, Token } from '@aws-cdk/core'; import { AwsCustomResource, AwsCustomResourcePolicy, PhysicalResourceId, Provider } from '@aws-cdk/custom-resources'; import { Construct } from 'constructs'; +import * as path from 'path'; import { DatabaseSecret } from './database-secret'; import { Endpoint } from './endpoint'; import { ClusterParameterGroup, IClusterParameterGroup } from './parameter-group'; @@ -478,7 +478,7 @@ export class Cluster extends ClusterBase { protected parameterGroup?: IClusterParameterGroup; /** - * Whether the cluster will be rebooted when changes to the cluster's parameter group that require a restart to apply. + * Guards against repeated invocations of enableRebootForParameterChanges() */ protected rebootForParameterChangesEnabled?: boolean; @@ -707,65 +707,66 @@ export class Cluster extends ClusterBase { * Enables automatic cluster rebooting when changes to the cluster's parameter group require a restart to apply. */ public enableRebootForParameterChanges(): void { - if (!this.rebootForParameterChangesEnabled) { - this.rebootForParameterChangesEnabled = true; - const rebootFunction = new lambda.SingletonFunction(this, 'RedshiftClusterRebooterFunction', { - uuid: '511e207f-13df-4b8b-b632-c32b30b65ac2', - runtime: lambda.Runtime.NODEJS_16_X, - code: lambda.Code.fromAsset(path.join(__dirname, 'cluster-parameter-change-reboot-handler')), - handler: 'index.handler', - timeout: Duration.seconds(900), - }); - rebootFunction.addToRolePolicy(new iam.PolicyStatement({ - actions: ['redshift:DescribeClusters'], - resources: ['*'], - })); - rebootFunction.addToRolePolicy(new iam.PolicyStatement({ - actions: ['redshift:RebootCluster'], - resources: [ - Stack.of(this).formatArn({ - service: 'redshift', - resource: 'cluster', - resourceName: this.clusterName, - arnFormat: ArnFormat.COLON_RESOURCE_NAME, - }), - ], - })); - const provider = new Provider(this, 'ResourceProvider', { - onEventHandler: rebootFunction, - }); - const customResource = new CustomResource(this, 'RedshiftClusterRebooterCustomResource', { - resourceType: 'Custom::RedshiftClusterRebooter', - serviceToken: provider.serviceToken, - properties: { - ClusterId: this.clusterName, - ParameterGroupName: Lazy.string({ - produce: () => { - if (!this.parameterGroup) { - throw new Error('Cannot enable reboot for parameter changes when there is no associated ClusterParameterGroup.'); - } - return this.parameterGroup.clusterParameterGroupName; - }, - }), - ParametersString: Lazy.string({ - produce: () => { - if (!(this.parameterGroup instanceof ClusterParameterGroup)) { - throw new Error('Cannot enable reboot for parameter changes when using an imported parameter group.'); - } - return JSON.stringify(this.parameterGroup.parameters); - }, - }), - }, - }); - Lazy.any({ - produce: () => { - if (!this.parameterGroup) { - throw new Error('Cannot enable reboot for parameter changes when there is no associated ClusterParameterGroup.'); - } - customResource.node.addDependency(this, this.parameterGroup); - }, - }); + if (this.rebootForParameterChangesEnabled) { + return; } + this.rebootForParameterChangesEnabled = true; + const rebootFunction = new lambda.SingletonFunction(this, 'RedshiftClusterRebooterFunction', { + uuid: '511e207f-13df-4b8b-b632-c32b30b65ac2', + runtime: lambda.Runtime.NODEJS_16_X, + code: lambda.Code.fromAsset(path.join(__dirname, 'cluster-parameter-change-reboot-handler')), + handler: 'index.handler', + timeout: Duration.seconds(900), + }); + rebootFunction.addToRolePolicy(new iam.PolicyStatement({ + actions: ['redshift:DescribeClusters'], + resources: ['*'], + })); + rebootFunction.addToRolePolicy(new iam.PolicyStatement({ + actions: ['redshift:RebootCluster'], + resources: [ + Stack.of(this).formatArn({ + service: 'redshift', + resource: 'cluster', + resourceName: this.clusterName, + arnFormat: ArnFormat.COLON_RESOURCE_NAME, + }), + ], + })); + const provider = new Provider(this, 'ResourceProvider', { + onEventHandler: rebootFunction, + }); + const customResource = new CustomResource(this, 'RedshiftClusterRebooterCustomResource', { + resourceType: 'Custom::RedshiftClusterRebooter', + serviceToken: provider.serviceToken, + properties: { + ClusterId: this.clusterName, + ParameterGroupName: Lazy.string({ + produce: () => { + if (!this.parameterGroup) { + throw new Error('Cannot enable reboot for parameter changes when there is no associated ClusterParameterGroup.'); + } + return this.parameterGroup.clusterParameterGroupName; + }, + }), + ParametersString: Lazy.string({ + produce: () => { + if (!(this.parameterGroup instanceof ClusterParameterGroup)) { + throw new Error('Cannot enable reboot for parameter changes when using an imported parameter group.'); + } + return JSON.stringify(this.parameterGroup.parameters); + }, + }), + }, + }); + Lazy.any({ + produce: () => { + if (!this.parameterGroup) { + throw new Error('Cannot enable reboot for parameter changes when there is no associated ClusterParameterGroup.'); + } + customResource.node.addDependency(this, this.parameterGroup); + }, + }); } /** From a76b88763c2cad732b3080184651a1718cdeb429 Mon Sep 17 00:00:00 2001 From: Arun Donti Date: Fri, 17 Feb 2023 10:55:38 -0500 Subject: [PATCH 15/15] refactor: update guard clause --- packages/@aws-cdk/aws-redshift/lib/cluster.ts | 10 ++-------- .../@aws-cdk/aws-redshift/test/cluster.test.ts | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/packages/@aws-cdk/aws-redshift/lib/cluster.ts b/packages/@aws-cdk/aws-redshift/lib/cluster.ts index 4df592642596b..3e415604d035a 100644 --- a/packages/@aws-cdk/aws-redshift/lib/cluster.ts +++ b/packages/@aws-cdk/aws-redshift/lib/cluster.ts @@ -1,3 +1,4 @@ +import * as path from 'path'; import * as ec2 from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; @@ -7,7 +8,6 @@ import * as secretsmanager from '@aws-cdk/aws-secretsmanager'; import { ArnFormat, CustomResource, Duration, IResource, Lazy, RemovalPolicy, Resource, SecretValue, Stack, Token } from '@aws-cdk/core'; import { AwsCustomResource, AwsCustomResourcePolicy, PhysicalResourceId, Provider } from '@aws-cdk/custom-resources'; import { Construct } from 'constructs'; -import * as path from 'path'; import { DatabaseSecret } from './database-secret'; import { Endpoint } from './endpoint'; import { ClusterParameterGroup, IClusterParameterGroup } from './parameter-group'; @@ -477,11 +477,6 @@ export class Cluster extends ClusterBase { */ protected parameterGroup?: IClusterParameterGroup; - /** - * Guards against repeated invocations of enableRebootForParameterChanges() - */ - protected rebootForParameterChangesEnabled?: boolean; - /** * The ARNs of the roles that will be attached to the cluster. * @@ -707,10 +702,9 @@ export class Cluster extends ClusterBase { * Enables automatic cluster rebooting when changes to the cluster's parameter group require a restart to apply. */ public enableRebootForParameterChanges(): void { - if (this.rebootForParameterChangesEnabled) { + if (this.node.tryFindChild('RedshiftClusterRebooterCustomResource')) { return; } - this.rebootForParameterChangesEnabled = true; const rebootFunction = new lambda.SingletonFunction(this, 'RedshiftClusterRebooterFunction', { uuid: '511e207f-13df-4b8b-b632-c32b30b65ac2', runtime: lambda.Runtime.NODEJS_16_X, diff --git a/packages/@aws-cdk/aws-redshift/test/cluster.test.ts b/packages/@aws-cdk/aws-redshift/test/cluster.test.ts index 8c1c7c4de8046..45b71e307a6b8 100644 --- a/packages/@aws-cdk/aws-redshift/test/cluster.test.ts +++ b/packages/@aws-cdk/aws-redshift/test/cluster.test.ts @@ -662,6 +662,22 @@ describe('reboot for Parameter Changes', () => { .not.toThrowError(/Cannot enable reboot for parameter changes/); }); + test('not create duplicate resources when reboot feature is enabled multiple times on a cluster', () => { + // Given + const cluster = new Cluster(stack, 'Redshift', { + masterUser: { + masterUsername: 'admin', + }, + vpc, + rebootForParameterChanges: true, + }); + cluster.addToParameterGroup('foo', 'bar'); + //WHEN + cluster.enableRebootForParameterChanges(); + // THEN + Template.fromStack(stack).resourceCountIs('Custom::RedshiftClusterRebooter', 1); + }); + test('cluster with parameter group', () => { // Given const cluster = new Cluster(stack, 'Redshift', {