From 41b2a51e11d87eac2d1ee2f2b5eb82cc18b35602 Mon Sep 17 00:00:00 2001 From: "Imtiaz Asad Bin, INI-DNA-DL" Date: Thu, 3 Oct 2024 19:31:05 +0200 Subject: [PATCH 1/6] feat(redshift-alpha): issue #31634: add support for RA3.large node type --- packages/@aws-cdk/aws-redshift-alpha/lib/cluster.ts | 5 +++++ packages/@aws-cdk/aws-redshift-alpha/test/cluster.test.ts | 4 ++-- packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/@aws-cdk/aws-redshift-alpha/lib/cluster.ts b/packages/@aws-cdk/aws-redshift-alpha/lib/cluster.ts index a47841324456d..07a7dc7692afe 100644 --- a/packages/@aws-cdk/aws-redshift-alpha/lib/cluster.ts +++ b/packages/@aws-cdk/aws-redshift-alpha/lib/cluster.ts @@ -49,6 +49,11 @@ export enum NodeType { */ DC2_8XLARGE = 'dc2.8xlarge', + /** + * ra3.large + */ + RA3_LARGE = 'ra3.large', + /** * ra3.xlplus */ diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/cluster.test.ts b/packages/@aws-cdk/aws-redshift-alpha/test/cluster.test.ts index 0d4ee8ba951a2..cd10644e10c8c 100644 --- a/packages/@aws-cdk/aws-redshift-alpha/test/cluster.test.ts +++ b/packages/@aws-cdk/aws-redshift-alpha/test/cluster.test.ts @@ -671,7 +671,7 @@ describe('multi AZ cluster', () => { masterPassword: cdk.SecretValue.unsafePlainText('tooshort'), }, vpc, - nodeType: NodeType.RA3_XLPLUS, + nodeType: NodeType.RA3_LARGE, multiAz: true, }); @@ -684,7 +684,7 @@ describe('multi AZ cluster', () => { AutomatedSnapshotRetentionPeriod: 1, Encrypted: true, NumberOfNodes: 2, - NodeType: 'ra3.xlplus', + NodeType: 'ra3.large', DBName: 'default_db', PubliclyAccessible: false, ClusterSubnetGroupName: { Ref: 'RedshiftSubnetsDFE70E0A' }, diff --git a/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md b/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md index 2de4a12515cb1..d4030cf1e93f5 100644 --- a/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md +++ b/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md @@ -141,7 +141,7 @@ The following json shows the current recommended set of flags, as `cdk init` wou "@aws-cdk/aws-s3:keepNotificationInImportedBucket": false, "@aws-cdk/aws-ecs:reduceEc2FargateCloudWatchPermissions": true, "@aws-cdk/aws-ec2:ec2SumTImeoutEnabled": true, - "@aws-cdk/aws-appsync:appSyncGraphQLAPIScopeLambdaPermission": true + "@aws-cdk/aws-appsync:appSyncGraphQLAPIScopeLambdaPermission": true, "@aws-cdk/aws-rds:setCorrectValueForDatabaseInstanceReadReplicaInstanceResourceId": true } } From a114c31b1e8e0d4111fd6eb215ebc6638740a4d0 Mon Sep 17 00:00:00 2001 From: "Imtiaz Asad Bin, INI-DNA-DL" Date: Fri, 4 Oct 2024 11:11:31 +0200 Subject: [PATCH 2/6] feat(redshift-alpha): issue #31634: added integration tests for redshift node type --- .../@aws-cdk/aws-redshift-alpha/README.md | 1 + .../test/integ.cluster-nodetype.ts | 35 + ...efaultTestDeployAssert1EF91947.assets.json | 19 + ...aultTestDeployAssert1EF91947.template.json | 36 + .../cdk.out | 1 + .../integ.json | 12 + .../manifest.json | 277 ++++++ .../redshift-ra3-large-integ.assets.json | 19 + .../redshift-ra3-large-integ.template.json | 536 ++++++++++ .../tree.json | 935 ++++++++++++++++++ 10 files changed, 1871 insertions(+) create mode 100644 packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts create mode 100644 packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.assets.json create mode 100644 packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.template.json create mode 100644 packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/cdk.out create mode 100644 packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/integ.json create mode 100644 packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/manifest.json create mode 100644 packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/redshift-ra3-large-integ.assets.json create mode 100644 packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/redshift-ra3-large-integ.template.json create mode 100644 packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/tree.json diff --git a/packages/@aws-cdk/aws-redshift-alpha/README.md b/packages/@aws-cdk/aws-redshift-alpha/README.md index bd43d96f838f9..186b6621bbb75 100644 --- a/packages/@aws-cdk/aws-redshift-alpha/README.md +++ b/packages/@aws-cdk/aws-redshift-alpha/README.md @@ -616,6 +616,7 @@ as it's a fast operation and typically completes in minutes. Elastic resize is o * dc2.8xlarge * ds2.xlarge * ds2.8xlarge + * ra3.large * ra3.xlplus * ra3.4xlarge * ra3.16xlarge diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts new file mode 100644 index 0000000000000..3c496b483a855 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts @@ -0,0 +1,35 @@ +import * as ec2 from 'aws-cdk-lib/aws-ec2'; +import { Stack, App, StackProps } from 'aws-cdk-lib'; +import * as integ from '@aws-cdk/integ-tests-alpha'; +import { Construct } from 'constructs'; +import * as redshift from '../lib'; + +class RedshiftRA3LargeTestStack extends Stack { + constructor(scope: Construct, id: string, props?: StackProps) { + super(scope, id, props); + + const vpc = new ec2.Vpc(this, 'VPC', { + restrictDefaultSecurityGroup: false + }); + + new redshift.Cluster(this, 'RA3LargeCluster', { + vpc: vpc, + vpcSubnets: { + subnetType: ec2.SubnetType.PUBLIC, + }, + masterUser: { + masterUsername: 'admin', + }, + nodeType: redshift.NodeType.RA3_LARGE, + numberOfNodes: 2, + }); + } +} + +const app = new App(); + +new integ.IntegTest(app, 'RA3LargeNodeIntegTest', { + testCases: [new RedshiftRA3LargeTestStack(app, 'redshift-ra3-large-integ')], +}); + +app.synth(); \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.assets.json b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.assets.json new file mode 100644 index 0000000000000..872fc22389b0d --- /dev/null +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.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-alpha/test/integ.cluster-nodetype.ts.snapshot/RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.template.json b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.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-alpha/test/integ.cluster-nodetype.ts.snapshot/cdk.out b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/cdk.out new file mode 100644 index 0000000000000..c6e612584e352 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"38.0.1"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/integ.json b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/integ.json new file mode 100644 index 0000000000000..1bdca2edc87d9 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "38.0.1", + "testCases": { + "RA3LargeNodeIntegTest/DefaultTest": { + "stacks": [ + "redshift-ra3-large-integ" + ], + "assertionStack": "RA3LargeNodeIntegTest/DefaultTest/DeployAssert", + "assertionStackName": "RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/manifest.json b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/manifest.json new file mode 100644 index 0000000000000..077c59bbd73b9 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/manifest.json @@ -0,0 +1,277 @@ +{ + "version": "38.0.1", + "artifacts": { + "redshift-ra3-large-integ.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "redshift-ra3-large-integ.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "redshift-ra3-large-integ": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "redshift-ra3-large-integ.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "notificationArns": [], + "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}/ac3ba08dcff1225c9f2f2ed2b165b8082ead5ca78d285898b4ad93a7f44eabac.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "redshift-ra3-large-integ.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": [ + "redshift-ra3-large-integ.assets" + ], + "metadata": { + "/redshift-ra3-large-integ/VPC/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCB9E5F0B4" + } + ], + "/redshift-ra3-large-integ/VPC/PublicSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1SubnetB4246D30" + } + ], + "/redshift-ra3-large-integ/VPC/PublicSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1RouteTableFEE4B781" + } + ], + "/redshift-ra3-large-integ/VPC/PublicSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1RouteTableAssociation0B0896DC" + } + ], + "/redshift-ra3-large-integ/VPC/PublicSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1DefaultRoute91CEF279" + } + ], + "/redshift-ra3-large-integ/VPC/PublicSubnet1/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1EIP6AD938E8" + } + ], + "/redshift-ra3-large-integ/VPC/PublicSubnet1/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1NATGatewayE0556630" + } + ], + "/redshift-ra3-large-integ/VPC/PublicSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2Subnet74179F39" + } + ], + "/redshift-ra3-large-integ/VPC/PublicSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2RouteTable6F1A15F1" + } + ], + "/redshift-ra3-large-integ/VPC/PublicSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2RouteTableAssociation5A808732" + } + ], + "/redshift-ra3-large-integ/VPC/PublicSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2DefaultRouteB7481BBA" + } + ], + "/redshift-ra3-large-integ/VPC/PublicSubnet2/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2EIP4947BC00" + } + ], + "/redshift-ra3-large-integ/VPC/PublicSubnet2/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2NATGateway3C070193" + } + ], + "/redshift-ra3-large-integ/VPC/PrivateSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1Subnet8BCA10E0" + } + ], + "/redshift-ra3-large-integ/VPC/PrivateSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1RouteTableBE8A6027" + } + ], + "/redshift-ra3-large-integ/VPC/PrivateSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1RouteTableAssociation347902D1" + } + ], + "/redshift-ra3-large-integ/VPC/PrivateSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1DefaultRouteAE1D6490" + } + ], + "/redshift-ra3-large-integ/VPC/PrivateSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + ], + "/redshift-ra3-large-integ/VPC/PrivateSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2RouteTable0A19E10E" + } + ], + "/redshift-ra3-large-integ/VPC/PrivateSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2RouteTableAssociation0C73D413" + } + ], + "/redshift-ra3-large-integ/VPC/PrivateSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2DefaultRouteF4F5CFD2" + } + ], + "/redshift-ra3-large-integ/VPC/IGW": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCIGWB7E252D3" + } + ], + "/redshift-ra3-large-integ/VPC/VPCGW": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCVPCGW99B986DC" + } + ], + "/redshift-ra3-large-integ/RA3LargeCluster/Subnets/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "RA3LargeClusterSubnets3256497D" + } + ], + "/redshift-ra3-large-integ/RA3LargeCluster/SecurityGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "RA3LargeClusterSecurityGroupDEDD1AE1" + } + ], + "/redshift-ra3-large-integ/RA3LargeCluster/Secret/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "RA3LargeClusterSecret4A7DB934" + } + ], + "/redshift-ra3-large-integ/RA3LargeCluster/Secret/Attachment/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "RA3LargeClusterSecretAttachment853268E7" + } + ], + "/redshift-ra3-large-integ/RA3LargeCluster/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "RA3LargeClusterCA6C6D40" + } + ], + "/redshift-ra3-large-integ/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/redshift-ra3-large-integ/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "redshift-ra3-large-integ" + }, + "RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "notificationArns": [], + "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": [ + "RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.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": [ + "RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.assets" + ], + "metadata": { + "/RA3LargeNodeIntegTest/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/RA3LargeNodeIntegTest/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "RA3LargeNodeIntegTest/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/redshift-ra3-large-integ.assets.json b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/redshift-ra3-large-integ.assets.json new file mode 100644 index 0000000000000..483e03805474e --- /dev/null +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/redshift-ra3-large-integ.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "ac3ba08dcff1225c9f2f2ed2b165b8082ead5ca78d285898b4ad93a7f44eabac": { + "source": { + "path": "redshift-ra3-large-integ.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "ac3ba08dcff1225c9f2f2ed2b165b8082ead5ca78d285898b4ad93a7f44eabac.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-alpha/test/integ.cluster-nodetype.ts.snapshot/redshift-ra3-large-integ.template.json b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/redshift-ra3-large-integ.template.json new file mode 100644 index 0000000000000..10699d96f1523 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/redshift-ra3-large-integ.template.json @@ -0,0 +1,536 @@ +{ + "Resources": { + "VPCB9E5F0B4": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC" + } + ] + } + }, + "VPCPublicSubnet1SubnetB4246D30": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.0.0/18", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPublicSubnet1RouteTableFEE4B781": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPublicSubnet1RouteTableAssociation0B0896DC": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + }, + "SubnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + } + } + }, + "VPCPublicSubnet1DefaultRoute91CEF279": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "RouteTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + } + }, + "DependsOn": [ + "VPCVPCGW99B986DC" + ] + }, + "VPCPublicSubnet1EIP6AD938E8": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC/PublicSubnet1" + } + ] + } + }, + "VPCPublicSubnet1NATGatewayE0556630": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet1EIP6AD938E8", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + "Tags": [ + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC/PublicSubnet1" + } + ] + }, + "DependsOn": [ + "VPCPublicSubnet1DefaultRoute91CEF279", + "VPCPublicSubnet1RouteTableAssociation0B0896DC" + ] + }, + "VPCPublicSubnet2Subnet74179F39": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.64.0/18", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPublicSubnet2RouteTable6F1A15F1": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPublicSubnet2RouteTableAssociation5A808732": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + }, + "SubnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + } + } + }, + "VPCPublicSubnet2DefaultRouteB7481BBA": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "RouteTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + } + }, + "DependsOn": [ + "VPCVPCGW99B986DC" + ] + }, + "VPCPublicSubnet2EIP4947BC00": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC/PublicSubnet2" + } + ] + } + }, + "VPCPublicSubnet2NATGateway3C070193": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet2EIP4947BC00", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + }, + "Tags": [ + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC/PublicSubnet2" + } + ] + }, + "DependsOn": [ + "VPCPublicSubnet2DefaultRouteB7481BBA", + "VPCPublicSubnet2RouteTableAssociation5A808732" + ] + }, + "VPCPrivateSubnet1Subnet8BCA10E0": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.128.0/18", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC/PrivateSubnet1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPrivateSubnet1RouteTableBE8A6027": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC/PrivateSubnet1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPrivateSubnet1RouteTableAssociation347902D1": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + }, + "SubnetId": { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + } + } + }, + "VPCPrivateSubnet1DefaultRouteAE1D6490": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "VPCPublicSubnet1NATGatewayE0556630" + }, + "RouteTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + } + } + }, + "VPCPrivateSubnet2SubnetCFCDAA7A": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.192.0/18", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC/PrivateSubnet2" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPrivateSubnet2RouteTable0A19E10E": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC/PrivateSubnet2" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPrivateSubnet2RouteTableAssociation0C73D413": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + }, + "SubnetId": { + "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + } + }, + "VPCPrivateSubnet2DefaultRouteF4F5CFD2": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "VPCPublicSubnet2NATGateway3C070193" + }, + "RouteTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + } + } + }, + "VPCIGWB7E252D3": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC" + } + ] + } + }, + "VPCVPCGW99B986DC": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "InternetGatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "RA3LargeClusterSubnets3256497D": { + "Type": "AWS::Redshift::ClusterSubnetGroup", + "Properties": { + "Description": "Subnets for RA3LargeCluster Redshift cluster", + "SubnetIds": [ + { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + { + "Ref": "VPCPublicSubnet2Subnet74179F39" + } + ] + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "RA3LargeClusterSecurityGroupDEDD1AE1": { + "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": "VPCB9E5F0B4" + } + } + }, + "RA3LargeClusterSecret4A7DB934": { + "Type": "AWS::SecretsManager::Secret", + "Properties": { + "GenerateSecretString": { + "ExcludeCharacters": "\"@/\\ '", + "GenerateStringKey": "password", + "PasswordLength": 30, + "SecretStringTemplate": "{\"username\":\"admin\"}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "RA3LargeClusterSecretAttachment853268E7": { + "Type": "AWS::SecretsManager::SecretTargetAttachment", + "Properties": { + "SecretId": { + "Ref": "RA3LargeClusterSecret4A7DB934" + }, + "TargetId": { + "Ref": "RA3LargeClusterCA6C6D40" + }, + "TargetType": "AWS::Redshift::Cluster" + } + }, + "RA3LargeClusterCA6C6D40": { + "Type": "AWS::Redshift::Cluster", + "Properties": { + "AllowVersionUpgrade": true, + "AutomatedSnapshotRetentionPeriod": 1, + "ClusterSubnetGroupName": { + "Ref": "RA3LargeClusterSubnets3256497D" + }, + "ClusterType": "multi-node", + "DBName": "default_db", + "Encrypted": true, + "MasterUserPassword": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "RA3LargeClusterSecret4A7DB934" + }, + ":SecretString:password::}}" + ] + ] + }, + "MasterUsername": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "RA3LargeClusterSecret4A7DB934" + }, + ":SecretString:username::}}" + ] + ] + }, + "NodeType": "ra3.large", + "NumberOfNodes": 2, + "PubliclyAccessible": false, + "VpcSecurityGroupIds": [ + { + "Fn::GetAtt": [ + "RA3LargeClusterSecurityGroupDEDD1AE1", + "GroupId" + ] + } + ] + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + } + }, + "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-alpha/test/integ.cluster-nodetype.ts.snapshot/tree.json b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/tree.json new file mode 100644 index 0000000000000..a1b518727023c --- /dev/null +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/tree.json @@ -0,0 +1,935 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "redshift-ra3-large-integ": { + "id": "redshift-ra3-large-integ", + "path": "redshift-ra3-large-integ", + "children": { + "VPC": { + "id": "VPC", + "path": "redshift-ra3-large-integ/VPC", + "children": { + "Resource": { + "id": "Resource", + "path": "redshift-ra3-large-integ/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": "redshift-ra3-large-integ/VPC" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPC", + "version": "0.0.0" + } + }, + "PublicSubnet1": { + "id": "PublicSubnet1", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.0.0/18", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "redshift-ra3-large-integ/VPC/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet1/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "redshift-ra3-large-integ/VPC/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + }, + "subnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "routeTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + }, + "EIP": { + "id": "EIP", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet1/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "redshift-ra3-large-integ/VPC/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", + "version": "0.0.0" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet1/NATGateway", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", + "aws:cdk:cloudformation:props": { + "allocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet1EIP6AD938E8", + "AllocationId" + ] + }, + "subnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + "tags": [ + { + "key": "Name", + "value": "redshift-ra3-large-integ/VPC/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", + "version": "0.0.0" + } + }, + "PublicSubnet2": { + "id": "PublicSubnet2", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.64.0/18", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "redshift-ra3-large-integ/VPC/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet2/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "redshift-ra3-large-integ/VPC/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + }, + "subnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "routeTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + }, + "EIP": { + "id": "EIP", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet2/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "redshift-ra3-large-integ/VPC/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", + "version": "0.0.0" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet2/NATGateway", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", + "aws:cdk:cloudformation:props": { + "allocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet2EIP4947BC00", + "AllocationId" + ] + }, + "subnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + }, + "tags": [ + { + "key": "Name", + "value": "redshift-ra3-large-integ/VPC/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", + "version": "0.0.0" + } + }, + "PrivateSubnet1": { + "id": "PrivateSubnet1", + "path": "redshift-ra3-large-integ/VPC/PrivateSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "redshift-ra3-large-integ/VPC/PrivateSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.128.0/18", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Private" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Private" + }, + { + "key": "Name", + "value": "redshift-ra3-large-integ/VPC/PrivateSubnet1" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "redshift-ra3-large-integ/VPC/PrivateSubnet1/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "redshift-ra3-large-integ/VPC/PrivateSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "redshift-ra3-large-integ/VPC/PrivateSubnet1" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "redshift-ra3-large-integ/VPC/PrivateSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + }, + "subnetId": { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "redshift-ra3-large-integ/VPC/PrivateSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "natGatewayId": { + "Ref": "VPCPublicSubnet1NATGatewayE0556630" + }, + "routeTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "PrivateSubnet2": { + "id": "PrivateSubnet2", + "path": "redshift-ra3-large-integ/VPC/PrivateSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "redshift-ra3-large-integ/VPC/PrivateSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.192.0/18", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Private" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Private" + }, + { + "key": "Name", + "value": "redshift-ra3-large-integ/VPC/PrivateSubnet2" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "redshift-ra3-large-integ/VPC/PrivateSubnet2/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "redshift-ra3-large-integ/VPC/PrivateSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "redshift-ra3-large-integ/VPC/PrivateSubnet2" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "redshift-ra3-large-integ/VPC/PrivateSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + }, + "subnetId": { + "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "redshift-ra3-large-integ/VPC/PrivateSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "natGatewayId": { + "Ref": "VPCPublicSubnet2NATGateway3C070193" + }, + "routeTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "IGW": { + "id": "IGW", + "path": "redshift-ra3-large-integ/VPC/IGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "redshift-ra3-large-integ/VPC" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnInternetGateway", + "version": "0.0.0" + } + }, + "VPCGW": { + "id": "VPCGW", + "path": "redshift-ra3-large-integ/VPC/VPCGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", + "aws:cdk:cloudformation:props": { + "internetGatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.Vpc", + "version": "0.0.0" + } + }, + "RA3LargeCluster": { + "id": "RA3LargeCluster", + "path": "redshift-ra3-large-integ/RA3LargeCluster", + "children": { + "Subnets": { + "id": "Subnets", + "path": "redshift-ra3-large-integ/RA3LargeCluster/Subnets", + "children": { + "Default": { + "id": "Default", + "path": "redshift-ra3-large-integ/RA3LargeCluster/Subnets/Default", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Redshift::ClusterSubnetGroup", + "aws:cdk:cloudformation:props": { + "description": "Subnets for RA3LargeCluster Redshift cluster", + "subnetIds": [ + { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + { + "Ref": "VPCPublicSubnet2Subnet74179F39" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_redshift.CfnClusterSubnetGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift-alpha.ClusterSubnetGroup", + "version": "0.0.0" + } + }, + "SecurityGroup": { + "id": "SecurityGroup", + "path": "redshift-ra3-large-integ/RA3LargeCluster/SecurityGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "redshift-ra3-large-integ/RA3LargeCluster/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": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.SecurityGroup", + "version": "0.0.0" + } + }, + "Secret": { + "id": "Secret", + "path": "redshift-ra3-large-integ/RA3LargeCluster/Secret", + "children": { + "Resource": { + "id": "Resource", + "path": "redshift-ra3-large-integ/RA3LargeCluster/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-lib.aws_secretsmanager.CfnSecret", + "version": "0.0.0" + } + }, + "Attachment": { + "id": "Attachment", + "path": "redshift-ra3-large-integ/RA3LargeCluster/Secret/Attachment", + "children": { + "Resource": { + "id": "Resource", + "path": "redshift-ra3-large-integ/RA3LargeCluster/Secret/Attachment/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::SecretTargetAttachment", + "aws:cdk:cloudformation:props": { + "secretId": { + "Ref": "RA3LargeClusterSecret4A7DB934" + }, + "targetId": { + "Ref": "RA3LargeClusterCA6C6D40" + }, + "targetType": "AWS::Redshift::Cluster" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_secretsmanager.CfnSecretTargetAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_secretsmanager.SecretTargetAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift-alpha.DatabaseSecret", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "redshift-ra3-large-integ/RA3LargeCluster/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Redshift::Cluster", + "aws:cdk:cloudformation:props": { + "allowVersionUpgrade": true, + "automatedSnapshotRetentionPeriod": 1, + "clusterSubnetGroupName": { + "Ref": "RA3LargeClusterSubnets3256497D" + }, + "clusterType": "multi-node", + "dbName": "default_db", + "encrypted": true, + "masterUsername": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "RA3LargeClusterSecret4A7DB934" + }, + ":SecretString:username::}}" + ] + ] + }, + "masterUserPassword": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "RA3LargeClusterSecret4A7DB934" + }, + ":SecretString:password::}}" + ] + ] + }, + "nodeType": "ra3.large", + "numberOfNodes": 2, + "publiclyAccessible": false, + "vpcSecurityGroupIds": [ + { + "Fn::GetAtt": [ + "RA3LargeClusterSecurityGroupDEDD1AE1", + "GroupId" + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_redshift.CfnCluster", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift-alpha.Cluster", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "redshift-ra3-large-integ/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "redshift-ra3-large-integ/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + }, + "RA3LargeNodeIntegTest": { + "id": "RA3LargeNodeIntegTest", + "path": "RA3LargeNodeIntegTest", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "RA3LargeNodeIntegTest/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "RA3LargeNodeIntegTest/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "RA3LargeNodeIntegTest/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "RA3LargeNodeIntegTest/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "RA3LargeNodeIntegTest/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "0.0.0" + } + } +} \ No newline at end of file From 9c311a3b651ba2fbab2e52df9d3e7d0ddf68293c Mon Sep 17 00:00:00 2001 From: "Imtiaz Asad Bin, INI-DNA-DL" Date: Fri, 4 Oct 2024 11:17:19 +0200 Subject: [PATCH 3/6] feat(redshift-alpha): issue #31634: merge conflict resolved --- packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md b/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md index d4030cf1e93f5..44de4cac4e2f2 100644 --- a/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md +++ b/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md @@ -142,7 +142,9 @@ The following json shows the current recommended set of flags, as `cdk init` wou "@aws-cdk/aws-ecs:reduceEc2FargateCloudWatchPermissions": true, "@aws-cdk/aws-ec2:ec2SumTImeoutEnabled": true, "@aws-cdk/aws-appsync:appSyncGraphQLAPIScopeLambdaPermission": true, - "@aws-cdk/aws-rds:setCorrectValueForDatabaseInstanceReadReplicaInstanceResourceId": true + "@aws-cdk/aws-rds:setCorrectValueForDatabaseInstanceReadReplicaInstanceResourceId": true, + "@aws-cdk/core:cfnIncludeRejectComplexResourceUpdateCreatePolicyIntrinsics": true, + "@aws-cdk/aws-lambda-nodejs:sdkV3ExcludeSmithyPackages": true } } ``` From 5399e65b7ff6fe07722246d9696a4fb668afad92 Mon Sep 17 00:00:00 2001 From: "Imtiaz Asad Bin, INI-DNA-DL" Date: Fri, 8 Nov 2024 19:47:12 +0100 Subject: [PATCH 4/6] feat(redshift-alpha): issue #31634: add support for RA3.large node type --- ...efaultTestDeployAssert1EF91947.assets.json | 19 + ...aultTestDeployAssert1EF91947.template.json | 36 + .../cdk.out | 1 + .../integ.json | 12 + .../manifest.json | 277 ++++++ .../redshift-ra3-large-integ.assets.json | 19 + .../redshift-ra3-large-integ.template.json | 536 ++++++++++ .../tree.json | 935 ++++++++++++++++++ .../test/integ.cluster-nodetype.ts | 2 +- tools/@aws-cdk/eslint-plugin/lib/index.d.ts | 6 - tools/@aws-cdk/eslint-plugin/lib/index.js | 10 - .../lib/private/import-cache.d.ts | 15 - .../eslint-plugin/lib/private/import-cache.js | 29 - .../lib/private/is-prod-file.d.ts | 4 - .../eslint-plugin/lib/private/is-prod-file.js | 15 - .../lib/rules/invalid-cfn-imports.d.ts | 2 - .../lib/rules/invalid-cfn-imports.js | 174 ---- .../lib/rules/no-core-construct.d.ts | 2 - .../lib/rules/no-core-construct.js | 151 --- .../lib/rules/no-invalid-path.d.ts | 2 - .../lib/rules/no-invalid-path.js | 79 -- .../lib/rules/no-literal-partition.d.ts | 7 - .../lib/rules/no-literal-partition.js | 38 - .../test/rules/fixtures.test.d.ts | 1 - .../eslint-plugin/test/rules/fixtures.test.js | 94 -- 25 files changed, 1836 insertions(+), 630 deletions(-) create mode 100644 packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.assets.json create mode 100644 packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.template.json create mode 100644 packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/cdk.out create mode 100644 packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/integ.json create mode 100644 packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/manifest.json create mode 100644 packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/redshift-ra3-large-integ.assets.json create mode 100644 packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/redshift-ra3-large-integ.template.json create mode 100644 packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/tree.json delete mode 100644 tools/@aws-cdk/eslint-plugin/lib/index.d.ts delete mode 100644 tools/@aws-cdk/eslint-plugin/lib/index.js delete mode 100644 tools/@aws-cdk/eslint-plugin/lib/private/import-cache.d.ts delete mode 100644 tools/@aws-cdk/eslint-plugin/lib/private/import-cache.js delete mode 100644 tools/@aws-cdk/eslint-plugin/lib/private/is-prod-file.d.ts delete mode 100644 tools/@aws-cdk/eslint-plugin/lib/private/is-prod-file.js delete mode 100644 tools/@aws-cdk/eslint-plugin/lib/rules/invalid-cfn-imports.d.ts delete mode 100644 tools/@aws-cdk/eslint-plugin/lib/rules/invalid-cfn-imports.js delete mode 100644 tools/@aws-cdk/eslint-plugin/lib/rules/no-core-construct.d.ts delete mode 100644 tools/@aws-cdk/eslint-plugin/lib/rules/no-core-construct.js delete mode 100644 tools/@aws-cdk/eslint-plugin/lib/rules/no-invalid-path.d.ts delete mode 100644 tools/@aws-cdk/eslint-plugin/lib/rules/no-invalid-path.js delete mode 100644 tools/@aws-cdk/eslint-plugin/lib/rules/no-literal-partition.d.ts delete mode 100644 tools/@aws-cdk/eslint-plugin/lib/rules/no-literal-partition.js delete mode 100644 tools/@aws-cdk/eslint-plugin/test/rules/fixtures.test.d.ts delete mode 100644 tools/@aws-cdk/eslint-plugin/test/rules/fixtures.test.js diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.assets.json b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.assets.json new file mode 100644 index 0000000000000..872fc22389b0d --- /dev/null +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.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-alpha/test/integ.cluster-nodetype.js.snapshot/RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.template.json b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.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-alpha/test/integ.cluster-nodetype.js.snapshot/cdk.out b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/cdk.out new file mode 100644 index 0000000000000..c6e612584e352 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"38.0.1"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/integ.json b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/integ.json new file mode 100644 index 0000000000000..1bdca2edc87d9 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "38.0.1", + "testCases": { + "RA3LargeNodeIntegTest/DefaultTest": { + "stacks": [ + "redshift-ra3-large-integ" + ], + "assertionStack": "RA3LargeNodeIntegTest/DefaultTest/DeployAssert", + "assertionStackName": "RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/manifest.json b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/manifest.json new file mode 100644 index 0000000000000..077c59bbd73b9 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/manifest.json @@ -0,0 +1,277 @@ +{ + "version": "38.0.1", + "artifacts": { + "redshift-ra3-large-integ.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "redshift-ra3-large-integ.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "redshift-ra3-large-integ": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "redshift-ra3-large-integ.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "notificationArns": [], + "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}/ac3ba08dcff1225c9f2f2ed2b165b8082ead5ca78d285898b4ad93a7f44eabac.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "redshift-ra3-large-integ.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": [ + "redshift-ra3-large-integ.assets" + ], + "metadata": { + "/redshift-ra3-large-integ/VPC/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCB9E5F0B4" + } + ], + "/redshift-ra3-large-integ/VPC/PublicSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1SubnetB4246D30" + } + ], + "/redshift-ra3-large-integ/VPC/PublicSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1RouteTableFEE4B781" + } + ], + "/redshift-ra3-large-integ/VPC/PublicSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1RouteTableAssociation0B0896DC" + } + ], + "/redshift-ra3-large-integ/VPC/PublicSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1DefaultRoute91CEF279" + } + ], + "/redshift-ra3-large-integ/VPC/PublicSubnet1/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1EIP6AD938E8" + } + ], + "/redshift-ra3-large-integ/VPC/PublicSubnet1/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet1NATGatewayE0556630" + } + ], + "/redshift-ra3-large-integ/VPC/PublicSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2Subnet74179F39" + } + ], + "/redshift-ra3-large-integ/VPC/PublicSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2RouteTable6F1A15F1" + } + ], + "/redshift-ra3-large-integ/VPC/PublicSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2RouteTableAssociation5A808732" + } + ], + "/redshift-ra3-large-integ/VPC/PublicSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2DefaultRouteB7481BBA" + } + ], + "/redshift-ra3-large-integ/VPC/PublicSubnet2/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2EIP4947BC00" + } + ], + "/redshift-ra3-large-integ/VPC/PublicSubnet2/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPublicSubnet2NATGateway3C070193" + } + ], + "/redshift-ra3-large-integ/VPC/PrivateSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1Subnet8BCA10E0" + } + ], + "/redshift-ra3-large-integ/VPC/PrivateSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1RouteTableBE8A6027" + } + ], + "/redshift-ra3-large-integ/VPC/PrivateSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1RouteTableAssociation347902D1" + } + ], + "/redshift-ra3-large-integ/VPC/PrivateSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet1DefaultRouteAE1D6490" + } + ], + "/redshift-ra3-large-integ/VPC/PrivateSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + ], + "/redshift-ra3-large-integ/VPC/PrivateSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2RouteTable0A19E10E" + } + ], + "/redshift-ra3-large-integ/VPC/PrivateSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2RouteTableAssociation0C73D413" + } + ], + "/redshift-ra3-large-integ/VPC/PrivateSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCPrivateSubnet2DefaultRouteF4F5CFD2" + } + ], + "/redshift-ra3-large-integ/VPC/IGW": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCIGWB7E252D3" + } + ], + "/redshift-ra3-large-integ/VPC/VPCGW": [ + { + "type": "aws:cdk:logicalId", + "data": "VPCVPCGW99B986DC" + } + ], + "/redshift-ra3-large-integ/RA3LargeCluster/Subnets/Default": [ + { + "type": "aws:cdk:logicalId", + "data": "RA3LargeClusterSubnets3256497D" + } + ], + "/redshift-ra3-large-integ/RA3LargeCluster/SecurityGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "RA3LargeClusterSecurityGroupDEDD1AE1" + } + ], + "/redshift-ra3-large-integ/RA3LargeCluster/Secret/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "RA3LargeClusterSecret4A7DB934" + } + ], + "/redshift-ra3-large-integ/RA3LargeCluster/Secret/Attachment/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "RA3LargeClusterSecretAttachment853268E7" + } + ], + "/redshift-ra3-large-integ/RA3LargeCluster/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "RA3LargeClusterCA6C6D40" + } + ], + "/redshift-ra3-large-integ/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/redshift-ra3-large-integ/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "redshift-ra3-large-integ" + }, + "RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.template.json", + "terminationProtection": false, + "validateOnSynth": false, + "notificationArns": [], + "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": [ + "RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.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": [ + "RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.assets" + ], + "metadata": { + "/RA3LargeNodeIntegTest/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/RA3LargeNodeIntegTest/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "RA3LargeNodeIntegTest/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/redshift-ra3-large-integ.assets.json b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/redshift-ra3-large-integ.assets.json new file mode 100644 index 0000000000000..483e03805474e --- /dev/null +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/redshift-ra3-large-integ.assets.json @@ -0,0 +1,19 @@ +{ + "version": "38.0.1", + "files": { + "ac3ba08dcff1225c9f2f2ed2b165b8082ead5ca78d285898b4ad93a7f44eabac": { + "source": { + "path": "redshift-ra3-large-integ.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "ac3ba08dcff1225c9f2f2ed2b165b8082ead5ca78d285898b4ad93a7f44eabac.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-alpha/test/integ.cluster-nodetype.js.snapshot/redshift-ra3-large-integ.template.json b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/redshift-ra3-large-integ.template.json new file mode 100644 index 0000000000000..10699d96f1523 --- /dev/null +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/redshift-ra3-large-integ.template.json @@ -0,0 +1,536 @@ +{ + "Resources": { + "VPCB9E5F0B4": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC" + } + ] + } + }, + "VPCPublicSubnet1SubnetB4246D30": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.0.0/18", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPublicSubnet1RouteTableFEE4B781": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPublicSubnet1RouteTableAssociation0B0896DC": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + }, + "SubnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + } + } + }, + "VPCPublicSubnet1DefaultRoute91CEF279": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "RouteTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + } + }, + "DependsOn": [ + "VPCVPCGW99B986DC" + ] + }, + "VPCPublicSubnet1EIP6AD938E8": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC/PublicSubnet1" + } + ] + } + }, + "VPCPublicSubnet1NATGatewayE0556630": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet1EIP6AD938E8", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + "Tags": [ + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC/PublicSubnet1" + } + ] + }, + "DependsOn": [ + "VPCPublicSubnet1DefaultRoute91CEF279", + "VPCPublicSubnet1RouteTableAssociation0B0896DC" + ] + }, + "VPCPublicSubnet2Subnet74179F39": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.64.0/18", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPublicSubnet2RouteTable6F1A15F1": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPublicSubnet2RouteTableAssociation5A808732": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + }, + "SubnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + } + } + }, + "VPCPublicSubnet2DefaultRouteB7481BBA": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "RouteTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + } + }, + "DependsOn": [ + "VPCVPCGW99B986DC" + ] + }, + "VPCPublicSubnet2EIP4947BC00": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC/PublicSubnet2" + } + ] + } + }, + "VPCPublicSubnet2NATGateway3C070193": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet2EIP4947BC00", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + }, + "Tags": [ + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC/PublicSubnet2" + } + ] + }, + "DependsOn": [ + "VPCPublicSubnet2DefaultRouteB7481BBA", + "VPCPublicSubnet2RouteTableAssociation5A808732" + ] + }, + "VPCPrivateSubnet1Subnet8BCA10E0": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.128.0/18", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC/PrivateSubnet1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPrivateSubnet1RouteTableBE8A6027": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC/PrivateSubnet1" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPrivateSubnet1RouteTableAssociation347902D1": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + }, + "SubnetId": { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + } + } + }, + "VPCPrivateSubnet1DefaultRouteAE1D6490": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "VPCPublicSubnet1NATGatewayE0556630" + }, + "RouteTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + } + } + }, + "VPCPrivateSubnet2SubnetCFCDAA7A": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.192.0/18", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC/PrivateSubnet2" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPrivateSubnet2RouteTable0A19E10E": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC/PrivateSubnet2" + } + ], + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "VPCPrivateSubnet2RouteTableAssociation0C73D413": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + }, + "SubnetId": { + "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + } + }, + "VPCPrivateSubnet2DefaultRouteF4F5CFD2": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "VPCPublicSubnet2NATGateway3C070193" + }, + "RouteTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + } + } + }, + "VPCIGWB7E252D3": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "redshift-ra3-large-integ/VPC" + } + ] + } + }, + "VPCVPCGW99B986DC": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "InternetGatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "VpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "RA3LargeClusterSubnets3256497D": { + "Type": "AWS::Redshift::ClusterSubnetGroup", + "Properties": { + "Description": "Subnets for RA3LargeCluster Redshift cluster", + "SubnetIds": [ + { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + { + "Ref": "VPCPublicSubnet2Subnet74179F39" + } + ] + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + }, + "RA3LargeClusterSecurityGroupDEDD1AE1": { + "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": "VPCB9E5F0B4" + } + } + }, + "RA3LargeClusterSecret4A7DB934": { + "Type": "AWS::SecretsManager::Secret", + "Properties": { + "GenerateSecretString": { + "ExcludeCharacters": "\"@/\\ '", + "GenerateStringKey": "password", + "PasswordLength": 30, + "SecretStringTemplate": "{\"username\":\"admin\"}" + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "RA3LargeClusterSecretAttachment853268E7": { + "Type": "AWS::SecretsManager::SecretTargetAttachment", + "Properties": { + "SecretId": { + "Ref": "RA3LargeClusterSecret4A7DB934" + }, + "TargetId": { + "Ref": "RA3LargeClusterCA6C6D40" + }, + "TargetType": "AWS::Redshift::Cluster" + } + }, + "RA3LargeClusterCA6C6D40": { + "Type": "AWS::Redshift::Cluster", + "Properties": { + "AllowVersionUpgrade": true, + "AutomatedSnapshotRetentionPeriod": 1, + "ClusterSubnetGroupName": { + "Ref": "RA3LargeClusterSubnets3256497D" + }, + "ClusterType": "multi-node", + "DBName": "default_db", + "Encrypted": true, + "MasterUserPassword": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "RA3LargeClusterSecret4A7DB934" + }, + ":SecretString:password::}}" + ] + ] + }, + "MasterUsername": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "RA3LargeClusterSecret4A7DB934" + }, + ":SecretString:username::}}" + ] + ] + }, + "NodeType": "ra3.large", + "NumberOfNodes": 2, + "PubliclyAccessible": false, + "VpcSecurityGroupIds": [ + { + "Fn::GetAtt": [ + "RA3LargeClusterSecurityGroupDEDD1AE1", + "GroupId" + ] + } + ] + }, + "UpdateReplacePolicy": "Retain", + "DeletionPolicy": "Retain" + } + }, + "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-alpha/test/integ.cluster-nodetype.js.snapshot/tree.json b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/tree.json new file mode 100644 index 0000000000000..b43de8eee7d1c --- /dev/null +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.js.snapshot/tree.json @@ -0,0 +1,935 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "redshift-ra3-large-integ": { + "id": "redshift-ra3-large-integ", + "path": "redshift-ra3-large-integ", + "children": { + "VPC": { + "id": "VPC", + "path": "redshift-ra3-large-integ/VPC", + "children": { + "Resource": { + "id": "Resource", + "path": "redshift-ra3-large-integ/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": "redshift-ra3-large-integ/VPC" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPC", + "version": "0.0.0" + } + }, + "PublicSubnet1": { + "id": "PublicSubnet1", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.0.0/18", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "redshift-ra3-large-integ/VPC/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet1/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "redshift-ra3-large-integ/VPC/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + }, + "subnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "routeTableId": { + "Ref": "VPCPublicSubnet1RouteTableFEE4B781" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + }, + "EIP": { + "id": "EIP", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet1/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "redshift-ra3-large-integ/VPC/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", + "version": "0.0.0" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet1/NATGateway", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", + "aws:cdk:cloudformation:props": { + "allocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet1EIP6AD938E8", + "AllocationId" + ] + }, + "subnetId": { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + "tags": [ + { + "key": "Name", + "value": "redshift-ra3-large-integ/VPC/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", + "version": "0.0.0" + } + }, + "PublicSubnet2": { + "id": "PublicSubnet2", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.64.0/18", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "redshift-ra3-large-integ/VPC/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet2/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "redshift-ra3-large-integ/VPC/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + }, + "subnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "routeTableId": { + "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + }, + "EIP": { + "id": "EIP", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet2/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "redshift-ra3-large-integ/VPC/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", + "version": "0.0.0" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "redshift-ra3-large-integ/VPC/PublicSubnet2/NATGateway", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", + "aws:cdk:cloudformation:props": { + "allocationId": { + "Fn::GetAtt": [ + "VPCPublicSubnet2EIP4947BC00", + "AllocationId" + ] + }, + "subnetId": { + "Ref": "VPCPublicSubnet2Subnet74179F39" + }, + "tags": [ + { + "key": "Name", + "value": "redshift-ra3-large-integ/VPC/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", + "version": "0.0.0" + } + }, + "PrivateSubnet1": { + "id": "PrivateSubnet1", + "path": "redshift-ra3-large-integ/VPC/PrivateSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "redshift-ra3-large-integ/VPC/PrivateSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.128.0/18", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Private" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Private" + }, + { + "key": "Name", + "value": "redshift-ra3-large-integ/VPC/PrivateSubnet1" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "redshift-ra3-large-integ/VPC/PrivateSubnet1/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "redshift-ra3-large-integ/VPC/PrivateSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "redshift-ra3-large-integ/VPC/PrivateSubnet1" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "redshift-ra3-large-integ/VPC/PrivateSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + }, + "subnetId": { + "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "redshift-ra3-large-integ/VPC/PrivateSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "natGatewayId": { + "Ref": "VPCPublicSubnet1NATGatewayE0556630" + }, + "routeTableId": { + "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "PrivateSubnet2": { + "id": "PrivateSubnet2", + "path": "redshift-ra3-large-integ/VPC/PrivateSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "redshift-ra3-large-integ/VPC/PrivateSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.192.0/18", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Private" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Private" + }, + { + "key": "Name", + "value": "redshift-ra3-large-integ/VPC/PrivateSubnet2" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "redshift-ra3-large-integ/VPC/PrivateSubnet2/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "redshift-ra3-large-integ/VPC/PrivateSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "redshift-ra3-large-integ/VPC/PrivateSubnet2" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "redshift-ra3-large-integ/VPC/PrivateSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + }, + "subnetId": { + "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "redshift-ra3-large-integ/VPC/PrivateSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "natGatewayId": { + "Ref": "VPCPublicSubnet2NATGateway3C070193" + }, + "routeTableId": { + "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "IGW": { + "id": "IGW", + "path": "redshift-ra3-large-integ/VPC/IGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "redshift-ra3-large-integ/VPC" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnInternetGateway", + "version": "0.0.0" + } + }, + "VPCGW": { + "id": "VPCGW", + "path": "redshift-ra3-large-integ/VPC/VPCGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", + "aws:cdk:cloudformation:props": { + "internetGatewayId": { + "Ref": "VPCIGWB7E252D3" + }, + "vpcId": { + "Ref": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.Vpc", + "version": "0.0.0" + } + }, + "RA3LargeCluster": { + "id": "RA3LargeCluster", + "path": "redshift-ra3-large-integ/RA3LargeCluster", + "children": { + "Subnets": { + "id": "Subnets", + "path": "redshift-ra3-large-integ/RA3LargeCluster/Subnets", + "children": { + "Default": { + "id": "Default", + "path": "redshift-ra3-large-integ/RA3LargeCluster/Subnets/Default", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Redshift::ClusterSubnetGroup", + "aws:cdk:cloudformation:props": { + "description": "Subnets for RA3LargeCluster Redshift cluster", + "subnetIds": [ + { + "Ref": "VPCPublicSubnet1SubnetB4246D30" + }, + { + "Ref": "VPCPublicSubnet2Subnet74179F39" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_redshift.CfnClusterSubnetGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift-alpha.ClusterSubnetGroup", + "version": "0.0.0" + } + }, + "SecurityGroup": { + "id": "SecurityGroup", + "path": "redshift-ra3-large-integ/RA3LargeCluster/SecurityGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "redshift-ra3-large-integ/RA3LargeCluster/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": "VPCB9E5F0B4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.SecurityGroup", + "version": "0.0.0" + } + }, + "Secret": { + "id": "Secret", + "path": "redshift-ra3-large-integ/RA3LargeCluster/Secret", + "children": { + "Resource": { + "id": "Resource", + "path": "redshift-ra3-large-integ/RA3LargeCluster/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-lib.aws_secretsmanager.CfnSecret", + "version": "0.0.0" + } + }, + "Attachment": { + "id": "Attachment", + "path": "redshift-ra3-large-integ/RA3LargeCluster/Secret/Attachment", + "children": { + "Resource": { + "id": "Resource", + "path": "redshift-ra3-large-integ/RA3LargeCluster/Secret/Attachment/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SecretsManager::SecretTargetAttachment", + "aws:cdk:cloudformation:props": { + "secretId": { + "Ref": "RA3LargeClusterSecret4A7DB934" + }, + "targetId": { + "Ref": "RA3LargeClusterCA6C6D40" + }, + "targetType": "AWS::Redshift::Cluster" + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_secretsmanager.CfnSecretTargetAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_secretsmanager.SecretTargetAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift-alpha.DatabaseSecret", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "redshift-ra3-large-integ/RA3LargeCluster/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Redshift::Cluster", + "aws:cdk:cloudformation:props": { + "allowVersionUpgrade": true, + "automatedSnapshotRetentionPeriod": 1, + "clusterSubnetGroupName": { + "Ref": "RA3LargeClusterSubnets3256497D" + }, + "clusterType": "multi-node", + "dbName": "default_db", + "encrypted": true, + "masterUsername": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "RA3LargeClusterSecret4A7DB934" + }, + ":SecretString:username::}}" + ] + ] + }, + "masterUserPassword": { + "Fn::Join": [ + "", + [ + "{{resolve:secretsmanager:", + { + "Ref": "RA3LargeClusterSecret4A7DB934" + }, + ":SecretString:password::}}" + ] + ] + }, + "nodeType": "ra3.large", + "numberOfNodes": 2, + "publiclyAccessible": false, + "vpcSecurityGroupIds": [ + { + "Fn::GetAtt": [ + "RA3LargeClusterSecurityGroupDEDD1AE1", + "GroupId" + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_redshift.CfnCluster", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-redshift-alpha.Cluster", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "redshift-ra3-large-integ/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "redshift-ra3-large-integ/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + }, + "RA3LargeNodeIntegTest": { + "id": "RA3LargeNodeIntegTest", + "path": "RA3LargeNodeIntegTest", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "RA3LargeNodeIntegTest/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "RA3LargeNodeIntegTest/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "RA3LargeNodeIntegTest/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "RA3LargeNodeIntegTest/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "RA3LargeNodeIntegTest/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.4.2" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts index 3c496b483a855..22d2e2f382f15 100644 --- a/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts @@ -9,7 +9,7 @@ class RedshiftRA3LargeTestStack extends Stack { super(scope, id, props); const vpc = new ec2.Vpc(this, 'VPC', { - restrictDefaultSecurityGroup: false + restrictDefaultSecurityGroup: false, }); new redshift.Cluster(this, 'RA3LargeCluster', { diff --git a/tools/@aws-cdk/eslint-plugin/lib/index.d.ts b/tools/@aws-cdk/eslint-plugin/lib/index.d.ts deleted file mode 100644 index 69609e4327f17..0000000000000 --- a/tools/@aws-cdk/eslint-plugin/lib/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare const rules: { - 'no-core-construct': any; - 'invalid-cfn-imports': any; - 'no-literal-partition': any; - 'no-invalid-path': any; -}; diff --git a/tools/@aws-cdk/eslint-plugin/lib/index.js b/tools/@aws-cdk/eslint-plugin/lib/index.js deleted file mode 100644 index 76859c6db048f..0000000000000 --- a/tools/@aws-cdk/eslint-plugin/lib/index.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.rules = void 0; -exports.rules = { - 'no-core-construct': require('./rules/no-core-construct'), - 'invalid-cfn-imports': require('./rules/invalid-cfn-imports'), - 'no-literal-partition': require('./rules/no-literal-partition'), - 'no-invalid-path': require('./rules/no-invalid-path'), -}; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBYSxRQUFBLEtBQUssR0FBRztJQUNuQixtQkFBbUIsRUFBRSxPQUFPLENBQUMsMkJBQTJCLENBQUM7SUFDekQscUJBQXFCLEVBQUUsT0FBTyxDQUFDLDZCQUE2QixDQUFDO0lBQzdELHNCQUFzQixFQUFFLE9BQU8sQ0FBQyw4QkFBOEIsQ0FBQztJQUMvRCxpQkFBaUIsRUFBRSxPQUFPLENBQUMseUJBQXlCLENBQUM7Q0FDdEQsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBjb25zdCBydWxlcyA9IHtcbiAgJ25vLWNvcmUtY29uc3RydWN0JzogcmVxdWlyZSgnLi9ydWxlcy9uby1jb3JlLWNvbnN0cnVjdCcpLFxuICAnaW52YWxpZC1jZm4taW1wb3J0cyc6IHJlcXVpcmUoJy4vcnVsZXMvaW52YWxpZC1jZm4taW1wb3J0cycpLFxuICAnbm8tbGl0ZXJhbC1wYXJ0aXRpb24nOiByZXF1aXJlKCcuL3J1bGVzL25vLWxpdGVyYWwtcGFydGl0aW9uJyksXG4gICduby1pbnZhbGlkLXBhdGgnOiByZXF1aXJlKCcuL3J1bGVzL25vLWludmFsaWQtcGF0aCcpLFxufTtcbiJdfQ== \ No newline at end of file diff --git a/tools/@aws-cdk/eslint-plugin/lib/private/import-cache.d.ts b/tools/@aws-cdk/eslint-plugin/lib/private/import-cache.d.ts deleted file mode 100644 index 7b184d8feb35d..0000000000000 --- a/tools/@aws-cdk/eslint-plugin/lib/private/import-cache.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -export interface ImportCacheKey { - readonly fileName: string; - readonly typeName: string; -} -export type Node = any; -export interface ImportCacheRecord extends ImportCacheKey { - readonly importNode: Node; - readonly localName: string; -} -export declare class ImportCache { - private records; - record(record: ImportCacheRecord): void; - find(key: ImportCacheKey): ImportCacheRecord | undefined; - get imports(): ImportCacheRecord[]; -} diff --git a/tools/@aws-cdk/eslint-plugin/lib/private/import-cache.js b/tools/@aws-cdk/eslint-plugin/lib/private/import-cache.js deleted file mode 100644 index c3c2b59db8c8b..0000000000000 --- a/tools/@aws-cdk/eslint-plugin/lib/private/import-cache.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ImportCache = void 0; -const crypto = require("crypto"); -class ImportCache { - constructor() { - this.records = {}; - } - record(record) { - const key = { - fileName: record.fileName, - typeName: record.typeName, - }; - this.records[hashed(key)] = record; - } - find(key) { - return this.records[hashed(key)]; - } - get imports() { - return Object.values(this.records); - } -} -exports.ImportCache = ImportCache; -function hashed(key) { - const hash = crypto.createHash('md5'); - hash.update(JSON.stringify(key)); - return hash.digest('hex'); -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW1wb3J0LWNhY2hlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaW1wb3J0LWNhY2hlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLGlDQUFpQztBQWlCakMsTUFBYSxXQUFXO0lBQXhCO1FBQ1UsWUFBTyxHQUF5QyxFQUFFLENBQUM7SUFpQjdELENBQUM7SUFmUSxNQUFNLENBQUMsTUFBeUI7UUFDckMsTUFBTSxHQUFHLEdBQW1CO1lBQzFCLFFBQVEsRUFBRSxNQUFNLENBQUMsUUFBUTtZQUN6QixRQUFRLEVBQUUsTUFBTSxDQUFDLFFBQVE7U0FDMUIsQ0FBQztRQUNGLElBQUksQ0FBQyxPQUFPLENBQUMsTUFBTSxDQUFDLEdBQUcsQ0FBQyxDQUFDLEdBQUcsTUFBTSxDQUFDO0lBQ3JDLENBQUM7SUFFTSxJQUFJLENBQUMsR0FBbUI7UUFDN0IsT0FBTyxJQUFJLENBQUMsT0FBTyxDQUFDLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQyxDQUFDO0lBQ25DLENBQUM7SUFFRCxJQUFX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ws-cdk/eslint-plugin/lib/private/is-prod-file.d.ts b/tools/@aws-cdk/eslint-plugin/lib/private/is-prod-file.d.ts deleted file mode 100644 index 14f030e856d62..0000000000000 --- a/tools/@aws-cdk/eslint-plugin/lib/private/is-prod-file.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/** - * We don't care about project test files (in a /test/ directory, excluding our fixtures) - */ -export declare function isProdFile(filename: string): boolean; diff --git a/tools/@aws-cdk/eslint-plugin/lib/private/is-prod-file.js b/tools/@aws-cdk/eslint-plugin/lib/private/is-prod-file.js deleted file mode 100644 index 17b98f801e224..0000000000000 --- a/tools/@aws-cdk/eslint-plugin/lib/private/is-prod-file.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isProdFile = void 0; -const path = require("path"); -/** - * We don't care about project test files (in a /test/ directory, excluding our fixtures) - */ -function isProdFile(filename) { - const isInTestFolder = new RegExp(/\/test\//).test(filename); - const isTestingPackage = new RegExp(/@aws-cdk-testing/).test(filename); - const isInOurTestFolder = path.resolve(filename).startsWith(path.resolve(__dirname, '..', '..', 'test')); - return (!isInTestFolder && !isTestingPackage) || isInOurTestFolder; -} -exports.isProdFile = isProdFile; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaXMtcHJvZC1maWxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiaXMtcHJvZC1maWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLDZCQUE2QjtBQUU3Qjs7R0FFRztBQUNILFNBQWdCLFVBQVUsQ0FBQyxRQUFnQjtJQUN6QyxNQUFNLGNBQWMsR0FBRyxJQUFJLE1BQU0sQ0FBQyxVQUFVLENBQUMsQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDLENBQUM7SUFDN0QsTUFBTSxnQkFBZ0IsR0FBRyxJQUFJLE1BQU0sQ0FBQyxrQkFBa0IsQ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--git a/tools/@aws-cdk/eslint-plugin/lib/rules/invalid-cfn-imports.d.ts b/tools/@aws-cdk/eslint-plugin/lib/rules/invalid-cfn-imports.d.ts deleted file mode 100644 index 8d0dfdcab1186..0000000000000 --- a/tools/@aws-cdk/eslint-plugin/lib/rules/invalid-cfn-imports.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { Rule } from 'eslint'; -export declare function create(context: Rule.RuleContext): Rule.NodeListener; diff --git a/tools/@aws-cdk/eslint-plugin/lib/rules/invalid-cfn-imports.js b/tools/@aws-cdk/eslint-plugin/lib/rules/invalid-cfn-imports.js deleted file mode 100644 index a2d492ae0cfd7..0000000000000 --- a/tools/@aws-cdk/eslint-plugin/lib/rules/invalid-cfn-imports.js +++ /dev/null @@ -1,174 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.create = void 0; -const fs = require("fs-extra"); -const path = require("path"); -let namespaceImports = {}; -function create(context) { - // The format of Cfn imports only matters for alpha packages, so that they can be - // formatted correctly when released separately for V2. The linter rule should only be - // applied if the file is in an alpha package, or it is a test file. - const filename = context.getFilename(); - if (!currentFileIsInAlphaPackage(filename) && !filename.match('test/rules/fixtures')) { - return {}; - } - return { - ImportDeclaration: node => { - const location = node.source.value; - // Store all of the 'import * as name from location' imports, so that we can check the location when - // we find name.CfnXXX references. - node.specifiers.forEach(e => { - if (e.type === 'ImportNamespaceSpecifier') { - namespaceImports[e.local.name] = location; - } - }); - if (location.endsWith('generated') || location === '@aws-cdk/core') { - // If importing directly from a generated file, this is fine. Also we know that aws-cdk/core is not experimental, so that is fine as well. - return; - } - const cfnImports = []; - const otherImports = []; - node.specifiers.forEach(e => { - if (e.type === 'ImportSpecifier') { - if (e.imported.name.startsWith('Cfn')) { - cfnImports.push(e); - } - else { - otherImports.push(e); - } - } - }); - if (cfnImports.length > 0 && otherImports.length > 0 && location.startsWith('.')) { - // import { CfnXXX, SomethingElse, AnotherThing } from './some/relative/path/not/ending/in/generated'; - context.report({ - message: 'To allow rewriting imports when generating v2 experimental packages, import of `' + cfnImports.map(e => e.imported.name).join(', ') + '` must be separate from import of `' + otherImports.map(e => e.imported.name).join(', ') + '`, and imported from its specific .generated location.', - node: node, - }); - } - else if (cfnImports.length > 0 && location.startsWith('.')) { - // import { CfnXXX } from './some/relative/path/not/ending/in/generated'; - context.report({ - message: 'To allow rewriting imports when generating v2 experimental packages, import of `' + cfnImports.map(e => e.imported.name).join(', ') + '` must be imported from its specific .generated location.', - node: node, - }); - } - else if (cfnImports.length > 0 && otherImports.length > 0 && checkIfImportedLocationIsAnAlphaPackage(location, context.getFilename())) { - // import { CfnXXX, SomethingElse, AnotherThing } from '@aws-cdk/another-alpha-package'; - context.report({ - message: 'To allow rewriting imports when generating v2 experimental packages, import of `' + cfnImports.map(e => e.imported.name).join(', ') + '` must be separate from import of `' + otherImports.map(e => e.imported.name).join(', ') + '`', - node: node, - }); - } - }, - // This captures using `xxx.CfnConstruct` as an identifier - Identifier: node => { - const typeAnnotation = node.typeAnnotation?.typeAnnotation; - const type = typeAnnotation?.typeName; - if (type?.type === 'TSQualifiedName') { - const result = checkLeftAndRightForCfn(type); - if (result) { - reportErrorIfImportedLocationIsNotValid(context, node, result.name, result.location); - } - } - if (node.name.startsWith('Cfn') && node.parent.type === 'MemberExpression' && node.parent.object.type === 'Identifier') { - // new xxx.CfnConstruct(); - reportErrorIfImportedLocationIsNotValid(context, node, node.name, node.parent.object.name); - } - }, - }; -} -exports.create = create; -function reportErrorIfImportedLocationIsNotValid(context, node, name, barrelImportName) { - const location = namespaceImports[barrelImportName]; - if (!location) { - // This scenario should not happen, but if it does, we don't want users to run into weird runtime errors from the linter. - return; - } - if (location.endsWith('generated') || location === '@aws-cdk/core') { - return; - } - if (location.startsWith('.')) { - // import * as name from './some/relative/path/not/ending/in/generated'; name.CfnConstruct(); - context.report({ - message: 'To allow rewriting imports when generating v2 experimental packages, `' + name + '` must be imported by name from its specific .generated location.', - node: node, - }); - } - else if (checkIfImportedLocationIsAnAlphaPackage(location, context.getFilename())) { - // import * as name from '@aws-cdk/another-alpha-package'; name.CfnConstruct(); - context.report({ - message: 'To allow rewriting imports when generating v2 experimental packages, `' + name + '` must be imported by name and separate from non-L1 imports, since it is being imported from an experimental package: ' + location, - node: node, - }); - } -} -function currentFileIsInAlphaPackage(filename) { - const filePathSplit = filename.split(path.sep); - const awsCdkNamespaceIndex = filePathSplit.findIndex(e => e.match('@aws-cdk')); - if (awsCdkNamespaceIndex !== -1) { - const packageDir = filePathSplit.slice(0, awsCdkNamespaceIndex + 2).join(path.sep); - return isAlphaPackage(packageDir); - } - return false; -} -function checkIfImportedLocationIsAnAlphaPackage(location, currentFilename) { - const rootDir = getCdkRootDir(currentFilename); - if (rootDir) { - const packageDir = rootDir + `/packages/${location}`; - return isAlphaPackage(packageDir); - } - return false; -} -function getCdkRootDir(filename) { - const filenameSplit = filename.split(path.sep); - // for test files - let rootDirIndex = filenameSplit.findIndex(e => e.match('tools')); - // for package files - if (rootDirIndex === -1) { - rootDirIndex = filenameSplit.findIndex(e => e.match('packages')); - } - if (rootDirIndex !== -1) { - return filenameSplit.slice(0, rootDirIndex).join(path.sep); - } - return undefined; -} -function isAlphaPackage(packageDir) { - if (packageDir.endsWith('aws-cdk-lib/core')) { - return false; // special case for core because it does not have a package.json - } - const pkg = JSON.parse(fs.readFileSync(path.join(packageDir, 'package.json'), { encoding: 'utf-8' })); - const separateModule = pkg['separate-module']; - if (separateModule !== undefined) { - return separateModule; - } - const maturity = pkg.maturity; - if (maturity !== 'experimental' && maturity !== 'developer-preview') { - return false; - } - // we're only interested in '@aws-cdk/' packages, - // and those that are JSII-enabled - return pkg.name.startsWith('@aws-cdk/') && !!pkg['jsii']; -} -function checkLeftAndRightForCfn(node) { - // Checking the left and right allows capturing the CfnConstruct name even if the TSQualifiedName references a subtype like: - // xxx.CfnConstruct.subtype - // xxx.CfnConstruct.subtype.anothersubtype - if (!node) { - return undefined; - } - if (node.name?.startsWith('Cfn')) { - if (node.name === node.parent.left.name) { - // This is the scenario for a reference to CfnConstruct.subtype - // In this case, it is not qualified with a barrel import, so we don't need to do anything. - return undefined; - } - return { - name: node.name, - location: node.parent.left.name, - }; - } - const right = checkLeftAndRightForCfn(node.right); - const left = checkLeftAndRightForCfn(node.left); - return right ?? left ?? undefined; -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW52YWxpZC1jZm4taW1wb3J0cy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImludmFsaWQtY2ZuLWltcG9ydHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBRUEsK0JBQStCO0FBQy9CLDZCQUE2QjtBQUU3QixJQUFJLGdCQUFnQixHQUVoQixFQUFFLENBQUM7QUFFUCxTQUFnQixNQUFNLENBQUMsT0FBeUI7SUFDOUMsaUZBQWlGO0lBQ2pGLHNGQUFzRjtJQUN0RixvRUFBb0U7SUFDcEUsTUFBTSxRQUFRLEdBQUcsT0FBTyxDQUFDLFdBQVcsRUFBRSxDQUFDO0lBQ3ZDLElBQUksQ0FBQywyQkFBMkIsQ0FBQyxRQUFRLENBQUMsSUFBSSxDQUFDLFFBQVEsQ0FBQyxLQUFLLENBQUMscUJBQXFCLENBQUMsRUFBRSxDQUFDO1FBQ3JGLE9BQU8sRUFBRSxDQUFDO0lBQ1osQ0FBQztJQUVELE9BQU87UUFDTCxpQkFBaUIsRUFBRSxJQUFJLENBQUMsRUFBRTtZQUN4QixNQUFNLFFBQVEsR0FBRyxJQUFJLENBQUMsTUFBTSxDQUFDLEtBQWUsQ0FBQztZQUM3QyxvR0FBb0c7WUFDcEcsa0NBQWtDO1lBQ2xDLElBQUksQ0FBQyxVQUFVLENBQUMsT0FBTyxDQUFDLENBQUMsQ0FBQyxFQUFFO2dCQUMxQixJQUFJLENBQUMsQ0FBQyxJQUFJLEtBQUssMEJBQTBCLEVBQUUsQ0FBQztvQkFDMUMsZ0JBQWdCLENBQ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0KTtcblxuICByZXR1cm4gcmlnaHQgPz8gbGVmdCA/PyB1bmRlZmluZWQ7XG59XG4iXX0= \ No newline at end of file diff --git a/tools/@aws-cdk/eslint-plugin/lib/rules/no-core-construct.d.ts b/tools/@aws-cdk/eslint-plugin/lib/rules/no-core-construct.d.ts deleted file mode 100644 index 8d0dfdcab1186..0000000000000 --- a/tools/@aws-cdk/eslint-plugin/lib/rules/no-core-construct.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { Rule } from 'eslint'; -export declare function create(context: Rule.RuleContext): Rule.NodeListener; diff --git a/tools/@aws-cdk/eslint-plugin/lib/rules/no-core-construct.js b/tools/@aws-cdk/eslint-plugin/lib/rules/no-core-construct.js deleted file mode 100644 index 64925fb2223cc..0000000000000 --- a/tools/@aws-cdk/eslint-plugin/lib/rules/no-core-construct.js +++ /dev/null @@ -1,151 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.create = void 0; -const import_cache_1 = require("../private/import-cache"); -let importCache; -let importsFixed; -const BANNED_TYPES = ['IConstruct', 'Construct']; -function create(context) { - return { - // `node` is a type from @typescript-eslint/typescript-estree, but using 'any' for now - // since it's incompatible with eslint.Rule namespace. Waiting for better compatibility in - // https://github.com/typescript-eslint/typescript-eslint/tree/1765a178e456b152bd48192eb5db7e8541e2adf2/packages/experimental-utils#note - // Meanwhile, use a debugger to explore the AST node. - Program(_node) { - if (!isTestFile(context.getFilename())) { - return; - } - importCache = new import_cache_1.ImportCache(); - importsFixed = false; - }, - ImportDeclaration(node) { - if (!isTestFile(context.getFilename())) { - return; - } - if (node.source.value === '@aws-cdk/core') { - node.specifiers.forEach((s) => { - if (s.type === 'ImportSpecifier' && BANNED_TYPES.includes(s.imported.name)) { - // named import - importCache.record({ - fileName: context.getFilename(), - typeName: s.imported.name, - importNode: node, - localName: s.local.name - }); - } - else if (s.type === 'ImportNamespaceSpecifier') { - // barrel import - BANNED_TYPES.forEach(typeName => { - importCache.record({ - fileName: context.getFilename(), - typeName, - importNode: node, - localName: `${s.local.name}.${typeName}` - }); - }); - } - }); - } - }, - Identifier(node) { - if (!isTestFile(context.getFilename())) { - return; - } - // Only apply rule to bindings (variables and function parameters) - const typeAnnotation = node.typeAnnotation?.typeAnnotation; - if (!typeAnnotation) { - return; - } - const type = typeAnnotation.typeName; - if (!type) { - return; - } - const message = 'Use Construct and IConstruct from the "constructs" module in variable declarations (not "@aws-cdk/core")'; - if (type.type === 'TSQualifiedName') { - // barrel import - const qualifier = type.left.name; - const typename = type.right.name; - const importNode = findImportNode(`${qualifier}.${typename}`); - if (!importNode) { - return; - } - context.report({ - node, - message, - fix: (fixer) => { - const fixes = []; - if (!importsFixed) { - fixes.push(fixer.insertTextAfter(importNode, "\nimport * as constructs from 'constructs';")); - importsFixed = true; - } - fixes.push(fixer.replaceTextRange(typeAnnotation.range, `constructs.${typename}`)); - return fixes; - } - }); - } - else if (type.type === 'Identifier') { - // named imports - const importNode = findImportNode(type.name); - if (!importNode) { - return; - } - context.report({ - node, - message, - fix: (fixer) => { - const fixes = []; - if (!importsFixed) { - const typesToImport = BANNED_TYPES.map(typeName => { - const val = importCache.find({ fileName: context.getFilename(), typeName }); - if (!val) { - return undefined; - } - if (typeName === val.localName) { - return typeName; - } - return `${typeName} as ${val.localName}`; - }).filter(x => x !== undefined); - fixes.push(fixer.insertTextAfter(importNode, `\nimport { ${typesToImport.join(', ')} } from 'constructs';`)); - const specifiers = importNode.specifiers; - if (specifiers.length === typesToImport.length) { - fixes.push(fixer.removeRange(importNode.range)); - } - else { - for (let i = 0; i < specifiers.length; i++) { - const s = specifiers[i]; - if (typesToImport.includes(s.imported.name)) { - if (i === specifiers.length - 1) { - fixes.push(fixer.removeRange([s.range[0] - 2, s.range[1]])); // include the leading comma - } - else { - fixes.push(fixer.removeRange([s.range[0], s.range[1] + 2])); // include the trailing comma - } - } - } - } - importsFixed = true; - } - return fixes; - } - }); - } - else { - return; - } - function findImportNode(locaName) { - return BANNED_TYPES.map(typeName => { - const val = importCache.find({ fileName: context.getFilename(), typeName }); - if (val && val.localName === locaName) { - return val.importNode; - } - return undefined; - }).find(x => x !== undefined); - } - }, - }; -} -exports.create = create; -function isTestFile(filename) { - return new RegExp(/\/test\//).test(filename); -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm8tY29yZS1jb25zdHJ1Y3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJuby1jb3JlLWNvbnN0cnVjdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFDQSwwREFBNEQ7QUFFNUQsSUFBSSxXQUF3QixDQUFDO0FBQzdCLElBQUksWUFBcUIsQ0FBQztBQUUxQixNQUFNLFlBQVksR0FBRyxDQUFFLFlBQVksRUFBRSxXQUFXLENBQUUsQ0FBQztBQUVuRCxTQUFnQixNQUFNLENBQUMsT0FBeUI7SUFDOUMsT0FBTztRQUVMLHNGQUFzRjtRQUN0RiwwRkFBMEY7UUFDMUYsd0lBQXdJO1FBQ3hJLHFEQUFxRDtRQUVyRCxPQUFPLENBQUMsS0FBVTtZQUNoQixJQUFJLENBQUMsVUFBVSxDQUFDLE9BQU8sQ0FBQyxXQUFXLEVBQUUsQ0FBQyxFQUFFLENBQUM7Z0JBQ3ZDLE9BQU87WUFDVCxDQUFDO1lBQ0QsV0FBVyxHQUFHLElBQUksMEJBQVcsRUFBRSxDQUFDO1lBQ2hDLFlBQVksR0FBRyxLQUFLLENBQUM7UUFDdkIsQ0FBQztRQUVELGlCQUFpQixDQUFDLElBQVM7WUFDekIsSUFBSSxDQUFDLFVBQVUsQ0FBQyxPQUFPLENBQUMsV0FBVyxFQUFFLENBQUMsRUFBRSxDQUFDO2dCQUN2QyxPQUFPO1lBQ1QsQ0FBQztZQUNELElBQUksSUFBSSxDQUFDLE1BQU0sQ0FBQyxLQUFLLEtBQUssZUFBZSxFQUFFLENBQUM7Z0JBQzFDLElBQUksQ0FBQyxVQUFVLENBQ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ogcy5sb2NhbC5uYW1lXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9IGVsc2UgaWYgKHMudHlwZSA9PT0gJ0ltcG9ydE5hbWVzcGFjZVNwZWNpZmllcicpIHtcbiAgICAgICAgICAgIC8vIGJhcnJlbCBpbXBvcnRcbiAgICAgICAgICAgIEJBTk5FRF9UWVBFUy5mb3JFYWNoKHR5cGVOYW1lID0+IHtcbiAgICAgICAgICAgICAgaW1wb3J0Q2FjaGUucmVjb3JkKHtcbiAgICAgICAgICAgICAgICBmaWxlTmFtZTogY29udGV4dC5nZXRGaWxlbmFtZSgpLFxuICAgICAgICAgICAgICAgIHR5cGVOYW1lLFxuICAgICAgICAgICAgICAgIGltcG9ydE5vZGU6IG5vZGUsXG4gICAgICAgICAgICAgICAgbG9jYWxOYW1lOiBgJHtzLmxvY2FsLm5hbWV9LiR7dHlwZU5hbWV9YFxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgICB9XG4gICAgfSxcblxuICAgIElkZW50aWZpZXIobm9kZTogYW55KSB7XG4gICAgICBpZiAoIWlzVGVzdEZpbGUoY29udGV4dC5nZXRGaWxlbmFtZSgpKSkge1xuICAgICAgICByZXR1cm47XG4gICAgICB9XG4gICAgICAvLyBPbmx5IGFwcGx5IHJ1bGUgdG8gYmluZGluZ3MgKHZhcmlhYmxlcyBhbmQgZnVuY3Rpb24gcGFyYW1ldGVycylcbiAgICAgIGNvbnN0IHR5cGVBbm5vdGF0aW9uID0gbm9kZS50eXBlQW5ub3RhdGlvbj8udHlwZUFubm90YXRpb25cbiAgICAgIGlmICghdHlwZUFubm90YXRpb24pIHtcbiAgICAgICAgcmV0dXJuO1xuICAgICAgfVxuICAgICAgY29uc3QgdHlwZSA9IHR5cGVBbm5vdGF0aW9uLnR5cGVOYW1lO1xuICAgICAgaWYgKCF0eXBlKSB7IHJldHVybjsgfVxuXG4gICAgICBjb25zdCBtZ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0cnVjdHMuJHt0eXBlbmFtZX1gKSk7XG4gICAgICAgICAgICByZXR1cm4gZml4ZXM7XG4gICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgIH0gZWxzZSBpZiAodHlwZS50eXBlID09PSAnSWRlbnRpZmllcicpIHtcbiAgICAgICAgLy8gbmFtZWQgaW1wb3J0c1xuICAgICAgICBjb25zdCBpbXBvcnROb2RlID0gZmluZEltcG9ydE5vZGUodHlwZS5uYW1lKTtcbiAgICAgICAgaWYgKCFpbXBvcnROb2RlKSB7XG4gICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIGNvbnRleHQucmVwb3J0KHtcbiAgICAgICAgICBub2RlLFxuICAgICAgICAgIG1lc3NhZ2UsXG4gICAgICAgICAgZml4OiAoZml4ZXI6IFJ1bGUuUnVsZUZpeGVyKSA9PiB7XG4gICAgICAgICAgICBjb25zdCBmaXhlczogUnVsZS5GaXhbXSA9IFtdO1xuICAgICAgICAgICAgaWYgKCFpbXBvcnRzRml4ZWQpIHtcbiAgICAgICAgICAgICAgY29uc3QgdHlwZXNUb0ltcG9ydCA9IEJBTk5FRF9UWVBFUy5tYXAodHlwZU5hbWUgPT4ge1xuICAgICAgICAgICAgICAgIGNvbnN0IHZhbCA9IGltcG9ydENhY2hlLmZpbmQoeyBmaWxlTmFtZTogY29udGV4dC5nZXRGaWxlbmFtZSgpLCB0eXBlTmFtZSB9KTtcbiAgICAgICAgICAgICAgICBpZiAoIXZhbCkgeyByZXR1cm4gdW5kZWZpbmVkOyB9XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVOYW1lID09PSB2YWwubG9jYWxOYW1lKSB7IHJldHVybiB0eXBlTmFtZTsgfVxuICAgICAgICAgICAgICAgIHJldHVybiBgJHt0eXBlTmFtZX0gYXMgJHt2YWwubG9jYWxOYW1lfWA7XG4gICAgICAgICAgICAgIH0pLmZpbHRlcih4ID0+IHggIT09IHVuZGVmaW5lZCk7XG4gICAgICAgICAgICAgIGZp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AgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIGltcG9ydHNGaXhlZCA9IHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gZml4ZXM7XG4gICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cblxuICAgICAgZnVuY3Rpb24gZmluZEltcG9ydE5vZGUobG9jYU5hbWU6IHN0cmluZyk6IE5vZGUgfCB1bmRlZmluZWQge1xuICAgICAgICByZXR1cm4gQkFOTkVEX1RZUEVTLm1hcCh0eXBlTmFtZSA9PiB7XG4gICAgICAgICAgY29uc3QgdmFsID0gaW1wb3J0Q2FjaGUuZmluZCh7IGZpbGVOYW1lOiBjb250ZXh0LmdldEZpbGVuYW1lKCksIHR5cGVOYW1lIH0pO1xuICAgICAgICAgIGlmICh2YWwgJiYgdmFsLmxvY2FsTmFtZSA9PT0gbG9jYU5hbWUpIHtcbiAgICAgICAgICAgIHJldHVybiB2YWwuaW1wb3J0Tm9kZTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIHVuZGVmaW5lZDtcbiAgICAgICAgfSkuZmluZCh4ID0+IHggIT09IHVuZGVmaW5lZCk7XG4gICAgICB9XG4gICAgfSxcbiAgfVxufVxuXG5mdW5jdGlvbiBpc1Rlc3RGaWxlKGZpbGVuYW1lOiBzdHJpbmcpIHtcbiAgcmV0dXJuIG5ldyBSZWdFeHAoL1xcL3Rlc3RcXC8vKS50ZXN0KGZpbGVuYW1lKTtcbn0iXX0= \ No newline at end of file diff --git a/tools/@aws-cdk/eslint-plugin/lib/rules/no-invalid-path.d.ts b/tools/@aws-cdk/eslint-plugin/lib/rules/no-invalid-path.d.ts deleted file mode 100644 index 8d0dfdcab1186..0000000000000 --- a/tools/@aws-cdk/eslint-plugin/lib/rules/no-invalid-path.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { Rule } from 'eslint'; -export declare function create(context: Rule.RuleContext): Rule.NodeListener; diff --git a/tools/@aws-cdk/eslint-plugin/lib/rules/no-invalid-path.js b/tools/@aws-cdk/eslint-plugin/lib/rules/no-invalid-path.js deleted file mode 100644 index 2238857413b42..0000000000000 --- a/tools/@aws-cdk/eslint-plugin/lib/rules/no-invalid-path.js +++ /dev/null @@ -1,79 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.create = void 0; -const path = require("path"); -const fs = require("fs"); -function isPathJoinFuncCall(node) { - return (node.callee?.property?.name === 'join' && - (node.parent?.expression?.callee?.object?.name === 'path' || - node.parent?.arguments?.some((a) => a.callee?.object?.name === 'path'))); -} -function noArgumentVariables(node) { - // Outside of the first argument, all arguments should be strings - const components = node.arguments.slice(1); - return components.every((a) => a.value !== undefined); -} -function hasSlashes(args) { - return args.some((a) => a.includes('/')); -} -function firstArgIsDirname(node) { - return node.arguments[0].name && node.arguments[0].name === '__dirname'; -} -function argumentList(node) { - // Already confirmed that first argument is '__dirname', so can safely remove it - const args = node.arguments.slice(1).map((a) => { return a.value; }); - return args; -} -function recreatePath(args) { - return `path.join(__dirname, '${args.join('\', \'')}')`; -} -function create(context) { - return { - CallExpression(node) { - if (isPathJoinFuncCall(node)) { - if (node.arguments.length === 0) { - // ERROR: this is 'path.join()' - context.report({ node, message: '\'path.join()\' is not a valid path. You must specify arguments into the function.' }); - return; - } - if (!noArgumentVariables(node)) { - // WARNING: unexpected non-string in the argument list. This happens if part of the argument list is a variable, i.e. `path.join(__dirname, myPath)`. - // We may be able to do something about this, but we currently are just going to let it pass. - return; - } - // We currently do not lint any path.join without '__dirname' as the first argument - if (!firstArgIsDirname(node)) { - return; - } - const args = argumentList(node); - if (hasSlashes(args)) { - // ERROR: This path looks like 'path.join(__dirname, 'a/b')' and should be changed to 'path.join(__dirname, 'a', 'b')' - context.report({ node, message: `${recreatePath(args)} is not a valid path. It has '/' in the arguments which is not allowed. Each directory should be its own separate argument.` }); - return; - } - const firstDownDir = args.findIndex((p) => p !== '..'); - // Confirm path does not have any unnecessary '..' paths - // This allows us to validate subsequent checks - if (firstDownDir > 0 && args.some((p, i) => p === '..' && i > firstDownDir)) { - // ERROR: This path oscillates between up and down commands - context.report({ node, message: `${recreatePath(args)} is not a valid path. It goes backwards and forwards and backwards again, and can be simplified.` }); - return; - } - // Exclude the case where there are no '..' at all in the path -- those are never invalid - const currentFile = context.getFilename(); - if (firstDownDir > 0) { - for (let i = 0; i < firstDownDir; i++) { - const pjFile = path.join(...[path.dirname(currentFile), ...args.slice(0, i), 'package.json']); - if (fs.existsSync(pjFile)) { - // ERROR: this path will end up going out of the package.json directory - context.report({ node, message: `${recreatePath(args)} is not a valid path. It goes beyond the parent library's package.json file so the file it points to will not be available after the library is packaged.` }); - return; - } - } - } - } - } - }; -} -exports.create = create; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm8taW52YWxpZC1wYXRoLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsibm8taW52YWxpZC1wYXRoLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUNBLDZCQUE2QjtBQUM3Qix5QkFBeUI7QUFFekIsU0FBUyxrQkFBa0IsQ0FBQyxJQUFTO0lBQ25DLE9BQU8sQ0FDTCxJQUFJLENBQUMsTUFBTSxFQUFFLFFBQVEsRUFBRSxJQUFJLEtBQUssTUFBTTtRQUN0QyxDQUFDLElBQUksQ0FBQyxNQUFNLEVBQUUsVUFBVSxFQUFFLE1BQU0sRUFBRSxNQUFNLEVBQUUsSUFBSSxLQUFLLE1BQU07WUFDekQsSUFBSSxDQUFDLE1BQU0sRUFBRSxTQUFTLEVBQUUsSUFBSSxDQUFDLENBQUMsQ0FBTSxFQUFFLEVBQUUsQ0FBQyxDQUFDLENBQUMsTUFBTSxFQUFFLE1BQU0sRUFBRSxJQUFJLEtBQUssTUFBTSxDQUFDLENBQUMsQ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QgYWxsIGluIHRoZSBwYXRoIC0tIHRob3NlIGFyZSBuZXZlciBpbnZhbGlkXG4gICAgICAgIGNvbnN0IGN1cnJlbnRGaWxlID0gY29udGV4dC5nZXRGaWxlbmFtZSgpO1xuICAgICAgICBpZiAoZmlyc3REb3duRGlyID4gMCkge1xuICAgICAgICAgIGZvciAobGV0IGkgPSAwOyBpIDwgZmlyc3REb3duRGlyOyBpKyspIHtcbiAgICAgICAgICAgIGNvbnN0IHBqRmlsZSA9IHBhdGguam9pbiguLi5bcGF0aC5kaXJuYW1lKGN1cnJlbnRGaWxlKSwgLi4uYXJncy5zbGljZSgwLCBpKSwgJ3BhY2thZ2UuanNvbiddKTtcbiAgICAgICAgICAgIGlmIChmcy5leGlzdHNTeW5jKHBqRmlsZSkpIHtcbiAgICAgICAgICAgICAgLy8gRVJST1I6IHRoaXMgcGF0aCB3aWxsIGVuZCB1cCBnb2luZyBvdXQgb2YgdGhlIHBhY2thZ2UuanNvbiBkaXJlY3RvcnlcbiAgICAgICAgICAgICAgY29udGV4dC5yZXBvcnQoeyBub2RlLCBtZXNzYWdlOiBgJHtyZWNyZWF0ZVBhdGgoYXJncyl9IGlzIG5vdCBhIHZhbGlkIHBhdGguIEl0IGdvZXMgYmV5b25kIHRoZSBwYXJlbnQgbGlicmFyeSdzIHBhY2thZ2UuanNvbiBmaWxlIHNvIHRoZSBmaWxlIGl0IHBvaW50cyB0byB3aWxsIG5vdCBiZSBhdmFpbGFibGUgYWZ0ZXIgdGhlIGxpYnJhcnkgaXMgcGFja2FnZWQuYH0pO1xuICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG59XG4iXX0= \ No newline at end of file diff --git a/tools/@aws-cdk/eslint-plugin/lib/rules/no-literal-partition.d.ts b/tools/@aws-cdk/eslint-plugin/lib/rules/no-literal-partition.d.ts deleted file mode 100644 index 2ee220c795018..0000000000000 --- a/tools/@aws-cdk/eslint-plugin/lib/rules/no-literal-partition.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Rule } from 'eslint'; -export declare const meta: { - messages: { - hardcodedArn: string; - }; -}; -export declare function create(context: Rule.RuleContext): Rule.NodeListener; diff --git a/tools/@aws-cdk/eslint-plugin/lib/rules/no-literal-partition.js b/tools/@aws-cdk/eslint-plugin/lib/rules/no-literal-partition.js deleted file mode 100644 index 6a020f23689d5..0000000000000 --- a/tools/@aws-cdk/eslint-plugin/lib/rules/no-literal-partition.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.create = exports.meta = void 0; -const is_prod_file_1 = require("../private/is-prod-file"); -exports.meta = { - messages: { - hardcodedArn: 'There are more partitions than just \'aws\'. Silence this message if you are sure this is safe, or switch to using \'Aws.PARTITION\'', - }, -}; -function create(context) { - return { - // `node` is a type from @typescript-eslint/typescript-estree, but using 'any' for now - // since it's incompatible with eslint.Rule namespace. Waiting for better compatibility in - // https://github.com/typescript-eslint/typescript-eslint/tree/1765a178e456b152bd48192eb5db7e8541e2adf2/packages/experimental-utils#note - // Meanwhile, use a debugger to explore the AST node. - Literal(node) { - if (!(0, is_prod_file_1.isProdFile)(context.getFilename())) { - return; - } - if (typeof node.value === 'string' && node.value.includes('arn:aws:')) { - context.report({ node, messageId: 'hardcodedArn' }); - } - }, - TemplateLiteral(node) { - if (!(0, is_prod_file_1.isProdFile)(context.getFilename())) { - return; - } - for (const quasi of node.quasis) { - const value = quasi.value.cooked; - if (typeof value === 'string' && value.includes('arn:aws:')) { - context.report({ node: quasi, messageId: 'hardcodedArn' }); - } - } - } - }; -} -exports.create = create; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm8tbGl0ZXJhbC1wYXJ0aXRpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJuby1saXRlcmFsLXBhcnRpdGlvbi50cyJdLCJuYW1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ludC90cmVlLzE3NjVhMTc4ZTQ1NmIxNTJiZDQ4MTkyZWI1ZGI3ZTg1NDFlMmFkZjIvcGFja2FnZXMvZXhwZXJpbWVudGFsLXV0aWxzI25vdGVcbiAgICAvLyBNZWFud2hpbGUsIHVzZSBhIGRlYnVnZ2VyIHRvIGV4cGxvcmUgdGhlIEFTVCBub2RlLlxuXG4gICAgTGl0ZXJhbChub2RlOiBhbnkpIHtcbiAgICAgIGlmICghaXNQcm9kRmlsZShjb250ZXh0LmdldEZpbGVuYW1lKCkpKSB7XG4gICAgICAgIHJldHVybjtcbiAgICAgIH1cblxuICAgICAgaWYgKHR5cGVvZiBub2RlLnZhbHVlID09PSAnc3RyaW5nJyAmJiBub2RlLnZhbHVlLmluY2x1ZGVzKCdhcm46YXdzOicpKSB7XG4gICAgICAgIGNvbnRleHQucmVwb3J0KHsgbm9kZSwgbWVzc2FnZUlkOiAnaGFyZGNvZGVkQXJuJyB9KTtcbiAgICAgIH1cbiAgICB9LFxuXG4gICAgVGVtcGxhdGVMaXRlcmFsKG5vZGU6IGFueSkge1xuICAgICAgaWYgKCFpc1Byb2RGaWxlKGNvbnRleHQuZ2V0RmlsZW5hbWUoKSkpIHtcbiAgICAgICAgcmV0dXJuO1xuICAgICAgfVxuICAgICAgZm9yIChjb25zdCBxdWFzaSBvZiBub2RlLnF1YXNpcykge1xuICAgICAgICBjb25zdCB2YWx1ZSA9IHF1YXNpLnZhbHVlLmNvb2tlZDtcblxuICAgICAgICBpZiAodHlwZW9mIHZhbHVlID09PSAnc3RyaW5nJyAmJiB2YWx1ZS5pbmNsdWRlcygnYXJuOmF3czonKSkge1xuICAgICAgICAgIGNvbnRleHQucmVwb3J0KHsgbm9kZTogcXVhc2ksIG1lc3NhZ2VJZDogJ2hhcmRjb2RlZEFybicgfSk7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gIH1cbn1cbiJdfQ== \ No newline at end of file diff --git a/tools/@aws-cdk/eslint-plugin/test/rules/fixtures.test.d.ts b/tools/@aws-cdk/eslint-plugin/test/rules/fixtures.test.d.ts deleted file mode 100644 index cb0ff5c3b541f..0000000000000 --- a/tools/@aws-cdk/eslint-plugin/test/rules/fixtures.test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/tools/@aws-cdk/eslint-plugin/test/rules/fixtures.test.js b/tools/@aws-cdk/eslint-plugin/test/rules/fixtures.test.js deleted file mode 100644 index 77d776d46f21b..0000000000000 --- a/tools/@aws-cdk/eslint-plugin/test/rules/fixtures.test.js +++ /dev/null @@ -1,94 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const eslint_1 = require("eslint"); -const fs = require("fs-extra"); -const path = require("path"); -let linter; -const outputRoot = path.join(process.cwd(), '.test-output'); -fs.mkdirpSync(outputRoot); -const fixturesRoot = path.join(__dirname, 'fixtures'); -fs.readdirSync(fixturesRoot).filter(f => fs.lstatSync(path.join(fixturesRoot, f)).isDirectory()).forEach(d => { - describe(d, () => { - const fixturesDir = path.join(fixturesRoot, d); - beforeAll(() => { - linter = new eslint_1.ESLint({ - baseConfig: { - parser: '@typescript-eslint/parser', - }, - overrideConfigFile: path.join(fixturesDir, 'eslintrc.js'), - rulePaths: [ - path.join(__dirname, '..', '..', 'lib', 'rules'), - ], - fix: true, - }); - }); - const outputDir = path.join(outputRoot, d); - fs.mkdirpSync(outputDir); - const fixtureFiles = fs.readdirSync(fixturesDir).filter(f => f.endsWith('.ts') && !f.endsWith('.expected.ts')); - fixtureFiles.forEach(f => { - it(f, async () => { - const originalFilePath = path.join(fixturesDir, f); - const expectedFixedFilePath = path.join(fixturesDir, `${path.basename(f, '.ts')}.expected.ts`); - const expectedErrorFilepath = path.join(fixturesDir, `${path.basename(f, '.ts')}.error.txt`); - const fix = fs.existsSync(expectedFixedFilePath); - const checkErrors = fs.existsSync(expectedErrorFilepath); - if (fix && checkErrors) { - fail(`Expected only a fixed file or an expected error message file. Both ${expectedFixedFilePath} and ${expectedErrorFilepath} are present.`); - } - else if (fix) { - const actualFile = await lintAndFix(originalFilePath, outputDir); - const actual = await fs.readFile(actualFile, { encoding: 'utf8' }); - const expected = await fs.readFile(expectedFixedFilePath, { encoding: 'utf8' }); - if (actual !== expected) { - fail(`Linted file did not match expectations.\n--------- Expected ----------\n${expected}\n---------- Actual ----------\n${actual}`); - } - return; - } - else if (checkErrors) { - const actualErrorMessages = await lint(originalFilePath); - const expectedErrorMessages = (await fs.readFile(expectedErrorFilepath, { encoding: 'utf8' })).split('\n'); - if (expectedErrorMessages.length !== actualErrorMessages?.length) { - fail(`Number of messages from linter did not match expectations. Linted file: ${originalFilePath}. Expected number of messages: ${expectedErrorMessages.length}. Actual number of messages: ${actualErrorMessages?.length}.`); - } - actualErrorMessages.forEach(actualMessage => { - if (!expectedErrorMessages.some(expectedMessage => actualMessage.message.includes(expectedMessage))) { - fail(`Error message not found in .error.txt file. Linted file: ${originalFilePath}. Actual message:\n${actualMessage.message}\nExpected messages:\n${expectedErrorMessages}`); - } - }); - return; - } - else { - fail(`Expected fixed file or expected error file not found.`); - } - }); - }); - }); -}); -async function lintAndFix(file, outputDir) { - const newPath = path.join(outputDir, path.basename(file)); - let result = await linter.lintFiles(file); - const hasFixes = result.find(r => typeof (r.output) === 'string') !== undefined; - if (hasFixes) { - await eslint_1.ESLint.outputFixes(result.map(r => { - r.filePath = newPath; - return r; - })); - } - else { - // If there are no fixes, copy the input file as output - await fs.copyFile(file, newPath); - } - return newPath; -} -async function lint(file) { - const result = await linter.lintFiles(file); - // If you only lint one file, then result.length will always be one. - if (result.length === 1) { - return result[0].messages; - } - return []; -} -function fail(x) { - throw new Error(x); -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZml4dHVyZXMudGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImZpeHR1cmVzLnRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxtQ0FBZ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4gIGNvbnN0IG5ld1BhdGggPSBwYXRoLmpvaW4ob3V0cHV0RGlyLCBwYXRoLmJhc2VuYW1lKGZpbGUpKVxuICBsZXQgcmVzdWx0ID0gYXdhaXQgbGludGVyLmxpbnRGaWxlcyhmaWxlKTtcbiAgY29uc3QgaGFzRml4ZXMgPSByZXN1bHQuZmluZChyID0+IHR5cGVvZihyLm91dHB1dCkgPT09ICdzdHJpbmcnKSAhPT0gdW5kZWZpbmVkO1xuICBpZiAoaGFzRml4ZXMpIHtcbiAgICBhd2FpdCBFU0xpbnQub3V0cHV0Rml4ZXMocmVzdWx0Lm1hcChyID0+IHtcbiAgICAgIHIuZmlsZVBhdGggPSBuZXdQYXRoO1xuICAgICAgcmV0dXJuIHI7XG4gICAgfSkpO1xuICB9IGVsc2Uge1xuICAgIC8vIElmIHRoZXJlIGFyZSBubyBmaXhlcywgY29weSB0aGUgaW5wdXQgZmlsZSBhcyBvdXRwdXRcbiAgICBhd2FpdCBmcy5jb3B5RmlsZShmaWxlLCBuZXdQYXRoKTtcbiAgfVxuICByZXR1cm4gbmV3UGF0aDtcbn1cblxuYXN5bmMgZnVuY3Rpb24gbGludChmaWxlOiBzdHJpbmcpIHtcbiAgY29uc3QgcmVzdWx0ID0gYXdhaXQgbGludGVyLmxpbnRGaWxlcyhmaWxlKTtcbiAgLy8gSWYgeW91IG9ubHkgbGludCBvbmUgZmlsZSwgdGhlbiByZXN1bHQubGVuZ3RoIHdpbGwgYWx3YXlzIGJlIG9uZS5cbiAgaWYgKHJlc3VsdC5sZW5ndGggPT09IDEpIHtcbiAgICByZXR1cm4gcmVzdWx0WzBdLm1lc3NhZ2VzO1xuICB9XG4gIHJldHVybiBbXTtcbn1cblxuZnVuY3Rpb24gZmFpbCh4OiBzdHJpbmcpIHtcbiAgdGhyb3cgbmV3IEVycm9yKHgpO1xufSJdfQ== \ No newline at end of file From d786bd2fa30dcd16bd64efbf16b7521c45b223fe Mon Sep 17 00:00:00 2001 From: Asad Bin Imtiaz <46749976+AsadBinImtiaz@users.noreply.github.com> Date: Fri, 29 Nov 2024 09:06:51 +0100 Subject: [PATCH 5/6] Update packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts Co-authored-by: Matsuda --- .../@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts index 22d2e2f382f15..4544d086bb5c1 100644 --- a/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts +++ b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts @@ -31,5 +31,3 @@ const app = new App(); new integ.IntegTest(app, 'RA3LargeNodeIntegTest', { testCases: [new RedshiftRA3LargeTestStack(app, 'redshift-ra3-large-integ')], }); - -app.synth(); \ No newline at end of file From 5682bafeff620095ffd2bc1bf0a5a1aee4621e91 Mon Sep 17 00:00:00 2001 From: "Imtiaz Asad Bin, INI-DNA-DL" Date: Fri, 29 Nov 2024 09:36:41 +0100 Subject: [PATCH 6/6] feat(redshift-alpha): issue #31634: changes based on pr comments --- ...efaultTestDeployAssert1EF91947.assets.json | 19 - ...aultTestDeployAssert1EF91947.template.json | 36 - .../cdk.out | 1 - .../integ.json | 12 - .../manifest.json | 277 ------ .../redshift-ra3-large-integ.assets.json | 19 - .../redshift-ra3-large-integ.template.json | 536 ---------- .../tree.json | 935 ------------------ 8 files changed, 1835 deletions(-) delete mode 100644 packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.assets.json delete mode 100644 packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.template.json delete mode 100644 packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/cdk.out delete mode 100644 packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/integ.json delete mode 100644 packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/manifest.json delete mode 100644 packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/redshift-ra3-large-integ.assets.json delete mode 100644 packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/redshift-ra3-large-integ.template.json delete mode 100644 packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/tree.json diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.assets.json b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.assets.json deleted file mode 100644 index 872fc22389b0d..0000000000000 --- a/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.assets.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": "38.0.1", - "files": { - "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { - "source": { - "path": "RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.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-alpha/test/integ.cluster-nodetype.ts.snapshot/RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.template.json b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.template.json deleted file mode 100644 index ad9d0fb73d1dd..0000000000000 --- a/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.template.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "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-alpha/test/integ.cluster-nodetype.ts.snapshot/cdk.out b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/cdk.out deleted file mode 100644 index c6e612584e352..0000000000000 --- a/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/cdk.out +++ /dev/null @@ -1 +0,0 @@ -{"version":"38.0.1"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/integ.json b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/integ.json deleted file mode 100644 index 1bdca2edc87d9..0000000000000 --- a/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/integ.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "version": "38.0.1", - "testCases": { - "RA3LargeNodeIntegTest/DefaultTest": { - "stacks": [ - "redshift-ra3-large-integ" - ], - "assertionStack": "RA3LargeNodeIntegTest/DefaultTest/DeployAssert", - "assertionStackName": "RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/manifest.json b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/manifest.json deleted file mode 100644 index 077c59bbd73b9..0000000000000 --- a/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/manifest.json +++ /dev/null @@ -1,277 +0,0 @@ -{ - "version": "38.0.1", - "artifacts": { - "redshift-ra3-large-integ.assets": { - "type": "cdk:asset-manifest", - "properties": { - "file": "redshift-ra3-large-integ.assets.json", - "requiresBootstrapStackVersion": 6, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" - } - }, - "redshift-ra3-large-integ": { - "type": "aws:cloudformation:stack", - "environment": "aws://unknown-account/unknown-region", - "properties": { - "templateFile": "redshift-ra3-large-integ.template.json", - "terminationProtection": false, - "validateOnSynth": false, - "notificationArns": [], - "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}/ac3ba08dcff1225c9f2f2ed2b165b8082ead5ca78d285898b4ad93a7f44eabac.json", - "requiresBootstrapStackVersion": 6, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", - "additionalDependencies": [ - "redshift-ra3-large-integ.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": [ - "redshift-ra3-large-integ.assets" - ], - "metadata": { - "/redshift-ra3-large-integ/VPC/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "VPCB9E5F0B4" - } - ], - "/redshift-ra3-large-integ/VPC/PublicSubnet1/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "VPCPublicSubnet1SubnetB4246D30" - } - ], - "/redshift-ra3-large-integ/VPC/PublicSubnet1/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "VPCPublicSubnet1RouteTableFEE4B781" - } - ], - "/redshift-ra3-large-integ/VPC/PublicSubnet1/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "VPCPublicSubnet1RouteTableAssociation0B0896DC" - } - ], - "/redshift-ra3-large-integ/VPC/PublicSubnet1/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "VPCPublicSubnet1DefaultRoute91CEF279" - } - ], - "/redshift-ra3-large-integ/VPC/PublicSubnet1/EIP": [ - { - "type": "aws:cdk:logicalId", - "data": "VPCPublicSubnet1EIP6AD938E8" - } - ], - "/redshift-ra3-large-integ/VPC/PublicSubnet1/NATGateway": [ - { - "type": "aws:cdk:logicalId", - "data": "VPCPublicSubnet1NATGatewayE0556630" - } - ], - "/redshift-ra3-large-integ/VPC/PublicSubnet2/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "VPCPublicSubnet2Subnet74179F39" - } - ], - "/redshift-ra3-large-integ/VPC/PublicSubnet2/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "VPCPublicSubnet2RouteTable6F1A15F1" - } - ], - "/redshift-ra3-large-integ/VPC/PublicSubnet2/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "VPCPublicSubnet2RouteTableAssociation5A808732" - } - ], - "/redshift-ra3-large-integ/VPC/PublicSubnet2/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "VPCPublicSubnet2DefaultRouteB7481BBA" - } - ], - "/redshift-ra3-large-integ/VPC/PublicSubnet2/EIP": [ - { - "type": "aws:cdk:logicalId", - "data": "VPCPublicSubnet2EIP4947BC00" - } - ], - "/redshift-ra3-large-integ/VPC/PublicSubnet2/NATGateway": [ - { - "type": "aws:cdk:logicalId", - "data": "VPCPublicSubnet2NATGateway3C070193" - } - ], - "/redshift-ra3-large-integ/VPC/PrivateSubnet1/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "VPCPrivateSubnet1Subnet8BCA10E0" - } - ], - "/redshift-ra3-large-integ/VPC/PrivateSubnet1/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "VPCPrivateSubnet1RouteTableBE8A6027" - } - ], - "/redshift-ra3-large-integ/VPC/PrivateSubnet1/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "VPCPrivateSubnet1RouteTableAssociation347902D1" - } - ], - "/redshift-ra3-large-integ/VPC/PrivateSubnet1/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "VPCPrivateSubnet1DefaultRouteAE1D6490" - } - ], - "/redshift-ra3-large-integ/VPC/PrivateSubnet2/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "VPCPrivateSubnet2SubnetCFCDAA7A" - } - ], - "/redshift-ra3-large-integ/VPC/PrivateSubnet2/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "VPCPrivateSubnet2RouteTable0A19E10E" - } - ], - "/redshift-ra3-large-integ/VPC/PrivateSubnet2/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "VPCPrivateSubnet2RouteTableAssociation0C73D413" - } - ], - "/redshift-ra3-large-integ/VPC/PrivateSubnet2/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "VPCPrivateSubnet2DefaultRouteF4F5CFD2" - } - ], - "/redshift-ra3-large-integ/VPC/IGW": [ - { - "type": "aws:cdk:logicalId", - "data": "VPCIGWB7E252D3" - } - ], - "/redshift-ra3-large-integ/VPC/VPCGW": [ - { - "type": "aws:cdk:logicalId", - "data": "VPCVPCGW99B986DC" - } - ], - "/redshift-ra3-large-integ/RA3LargeCluster/Subnets/Default": [ - { - "type": "aws:cdk:logicalId", - "data": "RA3LargeClusterSubnets3256497D" - } - ], - "/redshift-ra3-large-integ/RA3LargeCluster/SecurityGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "RA3LargeClusterSecurityGroupDEDD1AE1" - } - ], - "/redshift-ra3-large-integ/RA3LargeCluster/Secret/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "RA3LargeClusterSecret4A7DB934" - } - ], - "/redshift-ra3-large-integ/RA3LargeCluster/Secret/Attachment/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "RA3LargeClusterSecretAttachment853268E7" - } - ], - "/redshift-ra3-large-integ/RA3LargeCluster/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "RA3LargeClusterCA6C6D40" - } - ], - "/redshift-ra3-large-integ/BootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "BootstrapVersion" - } - ], - "/redshift-ra3-large-integ/CheckBootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "CheckBootstrapVersion" - } - ] - }, - "displayName": "redshift-ra3-large-integ" - }, - "RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.assets": { - "type": "cdk:asset-manifest", - "properties": { - "file": "RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.assets.json", - "requiresBootstrapStackVersion": 6, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" - } - }, - "RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947": { - "type": "aws:cloudformation:stack", - "environment": "aws://unknown-account/unknown-region", - "properties": { - "templateFile": "RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.template.json", - "terminationProtection": false, - "validateOnSynth": false, - "notificationArns": [], - "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": [ - "RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.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": [ - "RA3LargeNodeIntegTestDefaultTestDeployAssert1EF91947.assets" - ], - "metadata": { - "/RA3LargeNodeIntegTest/DefaultTest/DeployAssert/BootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "BootstrapVersion" - } - ], - "/RA3LargeNodeIntegTest/DefaultTest/DeployAssert/CheckBootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "CheckBootstrapVersion" - } - ] - }, - "displayName": "RA3LargeNodeIntegTest/DefaultTest/DeployAssert" - }, - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/redshift-ra3-large-integ.assets.json b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/redshift-ra3-large-integ.assets.json deleted file mode 100644 index 483e03805474e..0000000000000 --- a/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/redshift-ra3-large-integ.assets.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": "38.0.1", - "files": { - "ac3ba08dcff1225c9f2f2ed2b165b8082ead5ca78d285898b4ad93a7f44eabac": { - "source": { - "path": "redshift-ra3-large-integ.template.json", - "packaging": "file" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "ac3ba08dcff1225c9f2f2ed2b165b8082ead5ca78d285898b4ad93a7f44eabac.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-alpha/test/integ.cluster-nodetype.ts.snapshot/redshift-ra3-large-integ.template.json b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/redshift-ra3-large-integ.template.json deleted file mode 100644 index 10699d96f1523..0000000000000 --- a/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/redshift-ra3-large-integ.template.json +++ /dev/null @@ -1,536 +0,0 @@ -{ - "Resources": { - "VPCB9E5F0B4": { - "Type": "AWS::EC2::VPC", - "Properties": { - "CidrBlock": "10.0.0.0/16", - "EnableDnsHostnames": true, - "EnableDnsSupport": true, - "InstanceTenancy": "default", - "Tags": [ - { - "Key": "Name", - "Value": "redshift-ra3-large-integ/VPC" - } - ] - } - }, - "VPCPublicSubnet1SubnetB4246D30": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "AvailabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.0.0/18", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "redshift-ra3-large-integ/VPC/PublicSubnet1" - } - ], - "VpcId": { - "Ref": "VPCB9E5F0B4" - } - } - }, - "VPCPublicSubnet1RouteTableFEE4B781": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "redshift-ra3-large-integ/VPC/PublicSubnet1" - } - ], - "VpcId": { - "Ref": "VPCB9E5F0B4" - } - } - }, - "VPCPublicSubnet1RouteTableAssociation0B0896DC": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "VPCPublicSubnet1RouteTableFEE4B781" - }, - "SubnetId": { - "Ref": "VPCPublicSubnet1SubnetB4246D30" - } - } - }, - "VPCPublicSubnet1DefaultRoute91CEF279": { - "Type": "AWS::EC2::Route", - "Properties": { - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "VPCIGWB7E252D3" - }, - "RouteTableId": { - "Ref": "VPCPublicSubnet1RouteTableFEE4B781" - } - }, - "DependsOn": [ - "VPCVPCGW99B986DC" - ] - }, - "VPCPublicSubnet1EIP6AD938E8": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "redshift-ra3-large-integ/VPC/PublicSubnet1" - } - ] - } - }, - "VPCPublicSubnet1NATGatewayE0556630": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "AllocationId": { - "Fn::GetAtt": [ - "VPCPublicSubnet1EIP6AD938E8", - "AllocationId" - ] - }, - "SubnetId": { - "Ref": "VPCPublicSubnet1SubnetB4246D30" - }, - "Tags": [ - { - "Key": "Name", - "Value": "redshift-ra3-large-integ/VPC/PublicSubnet1" - } - ] - }, - "DependsOn": [ - "VPCPublicSubnet1DefaultRoute91CEF279", - "VPCPublicSubnet1RouteTableAssociation0B0896DC" - ] - }, - "VPCPublicSubnet2Subnet74179F39": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "AvailabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.64.0/18", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "redshift-ra3-large-integ/VPC/PublicSubnet2" - } - ], - "VpcId": { - "Ref": "VPCB9E5F0B4" - } - } - }, - "VPCPublicSubnet2RouteTable6F1A15F1": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "redshift-ra3-large-integ/VPC/PublicSubnet2" - } - ], - "VpcId": { - "Ref": "VPCB9E5F0B4" - } - } - }, - "VPCPublicSubnet2RouteTableAssociation5A808732": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" - }, - "SubnetId": { - "Ref": "VPCPublicSubnet2Subnet74179F39" - } - } - }, - "VPCPublicSubnet2DefaultRouteB7481BBA": { - "Type": "AWS::EC2::Route", - "Properties": { - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "VPCIGWB7E252D3" - }, - "RouteTableId": { - "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" - } - }, - "DependsOn": [ - "VPCVPCGW99B986DC" - ] - }, - "VPCPublicSubnet2EIP4947BC00": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "redshift-ra3-large-integ/VPC/PublicSubnet2" - } - ] - } - }, - "VPCPublicSubnet2NATGateway3C070193": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "AllocationId": { - "Fn::GetAtt": [ - "VPCPublicSubnet2EIP4947BC00", - "AllocationId" - ] - }, - "SubnetId": { - "Ref": "VPCPublicSubnet2Subnet74179F39" - }, - "Tags": [ - { - "Key": "Name", - "Value": "redshift-ra3-large-integ/VPC/PublicSubnet2" - } - ] - }, - "DependsOn": [ - "VPCPublicSubnet2DefaultRouteB7481BBA", - "VPCPublicSubnet2RouteTableAssociation5A808732" - ] - }, - "VPCPrivateSubnet1Subnet8BCA10E0": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "AvailabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.128.0/18", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "redshift-ra3-large-integ/VPC/PrivateSubnet1" - } - ], - "VpcId": { - "Ref": "VPCB9E5F0B4" - } - } - }, - "VPCPrivateSubnet1RouteTableBE8A6027": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "redshift-ra3-large-integ/VPC/PrivateSubnet1" - } - ], - "VpcId": { - "Ref": "VPCB9E5F0B4" - } - } - }, - "VPCPrivateSubnet1RouteTableAssociation347902D1": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" - }, - "SubnetId": { - "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" - } - } - }, - "VPCPrivateSubnet1DefaultRouteAE1D6490": { - "Type": "AWS::EC2::Route", - "Properties": { - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "VPCPublicSubnet1NATGatewayE0556630" - }, - "RouteTableId": { - "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" - } - } - }, - "VPCPrivateSubnet2SubnetCFCDAA7A": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "AvailabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.192.0/18", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "redshift-ra3-large-integ/VPC/PrivateSubnet2" - } - ], - "VpcId": { - "Ref": "VPCB9E5F0B4" - } - } - }, - "VPCPrivateSubnet2RouteTable0A19E10E": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "redshift-ra3-large-integ/VPC/PrivateSubnet2" - } - ], - "VpcId": { - "Ref": "VPCB9E5F0B4" - } - } - }, - "VPCPrivateSubnet2RouteTableAssociation0C73D413": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" - }, - "SubnetId": { - "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A" - } - } - }, - "VPCPrivateSubnet2DefaultRouteF4F5CFD2": { - "Type": "AWS::EC2::Route", - "Properties": { - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "VPCPublicSubnet2NATGateway3C070193" - }, - "RouteTableId": { - "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" - } - } - }, - "VPCIGWB7E252D3": { - "Type": "AWS::EC2::InternetGateway", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "redshift-ra3-large-integ/VPC" - } - ] - } - }, - "VPCVPCGW99B986DC": { - "Type": "AWS::EC2::VPCGatewayAttachment", - "Properties": { - "InternetGatewayId": { - "Ref": "VPCIGWB7E252D3" - }, - "VpcId": { - "Ref": "VPCB9E5F0B4" - } - } - }, - "RA3LargeClusterSubnets3256497D": { - "Type": "AWS::Redshift::ClusterSubnetGroup", - "Properties": { - "Description": "Subnets for RA3LargeCluster Redshift cluster", - "SubnetIds": [ - { - "Ref": "VPCPublicSubnet1SubnetB4246D30" - }, - { - "Ref": "VPCPublicSubnet2Subnet74179F39" - } - ] - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - }, - "RA3LargeClusterSecurityGroupDEDD1AE1": { - "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": "VPCB9E5F0B4" - } - } - }, - "RA3LargeClusterSecret4A7DB934": { - "Type": "AWS::SecretsManager::Secret", - "Properties": { - "GenerateSecretString": { - "ExcludeCharacters": "\"@/\\ '", - "GenerateStringKey": "password", - "PasswordLength": 30, - "SecretStringTemplate": "{\"username\":\"admin\"}" - } - }, - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - }, - "RA3LargeClusterSecretAttachment853268E7": { - "Type": "AWS::SecretsManager::SecretTargetAttachment", - "Properties": { - "SecretId": { - "Ref": "RA3LargeClusterSecret4A7DB934" - }, - "TargetId": { - "Ref": "RA3LargeClusterCA6C6D40" - }, - "TargetType": "AWS::Redshift::Cluster" - } - }, - "RA3LargeClusterCA6C6D40": { - "Type": "AWS::Redshift::Cluster", - "Properties": { - "AllowVersionUpgrade": true, - "AutomatedSnapshotRetentionPeriod": 1, - "ClusterSubnetGroupName": { - "Ref": "RA3LargeClusterSubnets3256497D" - }, - "ClusterType": "multi-node", - "DBName": "default_db", - "Encrypted": true, - "MasterUserPassword": { - "Fn::Join": [ - "", - [ - "{{resolve:secretsmanager:", - { - "Ref": "RA3LargeClusterSecret4A7DB934" - }, - ":SecretString:password::}}" - ] - ] - }, - "MasterUsername": { - "Fn::Join": [ - "", - [ - "{{resolve:secretsmanager:", - { - "Ref": "RA3LargeClusterSecret4A7DB934" - }, - ":SecretString:username::}}" - ] - ] - }, - "NodeType": "ra3.large", - "NumberOfNodes": 2, - "PubliclyAccessible": false, - "VpcSecurityGroupIds": [ - { - "Fn::GetAtt": [ - "RA3LargeClusterSecurityGroupDEDD1AE1", - "GroupId" - ] - } - ] - }, - "UpdateReplacePolicy": "Retain", - "DeletionPolicy": "Retain" - } - }, - "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-alpha/test/integ.cluster-nodetype.ts.snapshot/tree.json b/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/tree.json deleted file mode 100644 index a1b518727023c..0000000000000 --- a/packages/@aws-cdk/aws-redshift-alpha/test/integ.cluster-nodetype.ts.snapshot/tree.json +++ /dev/null @@ -1,935 +0,0 @@ -{ - "version": "tree-0.1", - "tree": { - "id": "App", - "path": "", - "children": { - "redshift-ra3-large-integ": { - "id": "redshift-ra3-large-integ", - "path": "redshift-ra3-large-integ", - "children": { - "VPC": { - "id": "VPC", - "path": "redshift-ra3-large-integ/VPC", - "children": { - "Resource": { - "id": "Resource", - "path": "redshift-ra3-large-integ/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": "redshift-ra3-large-integ/VPC" - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnVPC", - "version": "0.0.0" - } - }, - "PublicSubnet1": { - "id": "PublicSubnet1", - "path": "redshift-ra3-large-integ/VPC/PublicSubnet1", - "children": { - "Subnet": { - "id": "Subnet", - "path": "redshift-ra3-large-integ/VPC/PublicSubnet1/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "availabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.0.0/18", - "mapPublicIpOnLaunch": true, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Public" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Public" - }, - { - "key": "Name", - "value": "redshift-ra3-large-integ/VPC/PublicSubnet1" - } - ], - "vpcId": { - "Ref": "VPCB9E5F0B4" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "redshift-ra3-large-integ/VPC/PublicSubnet1/Acl", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "redshift-ra3-large-integ/VPC/PublicSubnet1/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "tags": [ - { - "key": "Name", - "value": "redshift-ra3-large-integ/VPC/PublicSubnet1" - } - ], - "vpcId": { - "Ref": "VPCB9E5F0B4" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "redshift-ra3-large-integ/VPC/PublicSubnet1/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "VPCPublicSubnet1RouteTableFEE4B781" - }, - "subnetId": { - "Ref": "VPCPublicSubnet1SubnetB4246D30" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "redshift-ra3-large-integ/VPC/PublicSubnet1/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "destinationCidrBlock": "0.0.0.0/0", - "gatewayId": { - "Ref": "VPCIGWB7E252D3" - }, - "routeTableId": { - "Ref": "VPCPublicSubnet1RouteTableFEE4B781" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", - "version": "0.0.0" - } - }, - "EIP": { - "id": "EIP", - "path": "redshift-ra3-large-integ/VPC/PublicSubnet1/EIP", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::EIP", - "aws:cdk:cloudformation:props": { - "domain": "vpc", - "tags": [ - { - "key": "Name", - "value": "redshift-ra3-large-integ/VPC/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", - "version": "0.0.0" - } - }, - "NATGateway": { - "id": "NATGateway", - "path": "redshift-ra3-large-integ/VPC/PublicSubnet1/NATGateway", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", - "aws:cdk:cloudformation:props": { - "allocationId": { - "Fn::GetAtt": [ - "VPCPublicSubnet1EIP6AD938E8", - "AllocationId" - ] - }, - "subnetId": { - "Ref": "VPCPublicSubnet1SubnetB4246D30" - }, - "tags": [ - { - "key": "Name", - "value": "redshift-ra3-large-integ/VPC/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", - "version": "0.0.0" - } - }, - "PublicSubnet2": { - "id": "PublicSubnet2", - "path": "redshift-ra3-large-integ/VPC/PublicSubnet2", - "children": { - "Subnet": { - "id": "Subnet", - "path": "redshift-ra3-large-integ/VPC/PublicSubnet2/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "availabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.64.0/18", - "mapPublicIpOnLaunch": true, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Public" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Public" - }, - { - "key": "Name", - "value": "redshift-ra3-large-integ/VPC/PublicSubnet2" - } - ], - "vpcId": { - "Ref": "VPCB9E5F0B4" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "redshift-ra3-large-integ/VPC/PublicSubnet2/Acl", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "redshift-ra3-large-integ/VPC/PublicSubnet2/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "tags": [ - { - "key": "Name", - "value": "redshift-ra3-large-integ/VPC/PublicSubnet2" - } - ], - "vpcId": { - "Ref": "VPCB9E5F0B4" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "redshift-ra3-large-integ/VPC/PublicSubnet2/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" - }, - "subnetId": { - "Ref": "VPCPublicSubnet2Subnet74179F39" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "redshift-ra3-large-integ/VPC/PublicSubnet2/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "destinationCidrBlock": "0.0.0.0/0", - "gatewayId": { - "Ref": "VPCIGWB7E252D3" - }, - "routeTableId": { - "Ref": "VPCPublicSubnet2RouteTable6F1A15F1" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", - "version": "0.0.0" - } - }, - "EIP": { - "id": "EIP", - "path": "redshift-ra3-large-integ/VPC/PublicSubnet2/EIP", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::EIP", - "aws:cdk:cloudformation:props": { - "domain": "vpc", - "tags": [ - { - "key": "Name", - "value": "redshift-ra3-large-integ/VPC/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", - "version": "0.0.0" - } - }, - "NATGateway": { - "id": "NATGateway", - "path": "redshift-ra3-large-integ/VPC/PublicSubnet2/NATGateway", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", - "aws:cdk:cloudformation:props": { - "allocationId": { - "Fn::GetAtt": [ - "VPCPublicSubnet2EIP4947BC00", - "AllocationId" - ] - }, - "subnetId": { - "Ref": "VPCPublicSubnet2Subnet74179F39" - }, - "tags": [ - { - "key": "Name", - "value": "redshift-ra3-large-integ/VPC/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", - "version": "0.0.0" - } - }, - "PrivateSubnet1": { - "id": "PrivateSubnet1", - "path": "redshift-ra3-large-integ/VPC/PrivateSubnet1", - "children": { - "Subnet": { - "id": "Subnet", - "path": "redshift-ra3-large-integ/VPC/PrivateSubnet1/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "availabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.128.0/18", - "mapPublicIpOnLaunch": false, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Private" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Private" - }, - { - "key": "Name", - "value": "redshift-ra3-large-integ/VPC/PrivateSubnet1" - } - ], - "vpcId": { - "Ref": "VPCB9E5F0B4" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "redshift-ra3-large-integ/VPC/PrivateSubnet1/Acl", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "redshift-ra3-large-integ/VPC/PrivateSubnet1/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "tags": [ - { - "key": "Name", - "value": "redshift-ra3-large-integ/VPC/PrivateSubnet1" - } - ], - "vpcId": { - "Ref": "VPCB9E5F0B4" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "redshift-ra3-large-integ/VPC/PrivateSubnet1/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" - }, - "subnetId": { - "Ref": "VPCPrivateSubnet1Subnet8BCA10E0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "redshift-ra3-large-integ/VPC/PrivateSubnet1/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "destinationCidrBlock": "0.0.0.0/0", - "natGatewayId": { - "Ref": "VPCPublicSubnet1NATGatewayE0556630" - }, - "routeTableId": { - "Ref": "VPCPrivateSubnet1RouteTableBE8A6027" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", - "version": "0.0.0" - } - }, - "PrivateSubnet2": { - "id": "PrivateSubnet2", - "path": "redshift-ra3-large-integ/VPC/PrivateSubnet2", - "children": { - "Subnet": { - "id": "Subnet", - "path": "redshift-ra3-large-integ/VPC/PrivateSubnet2/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "availabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.192.0/18", - "mapPublicIpOnLaunch": false, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Private" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Private" - }, - { - "key": "Name", - "value": "redshift-ra3-large-integ/VPC/PrivateSubnet2" - } - ], - "vpcId": { - "Ref": "VPCB9E5F0B4" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "redshift-ra3-large-integ/VPC/PrivateSubnet2/Acl", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "redshift-ra3-large-integ/VPC/PrivateSubnet2/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "tags": [ - { - "key": "Name", - "value": "redshift-ra3-large-integ/VPC/PrivateSubnet2" - } - ], - "vpcId": { - "Ref": "VPCB9E5F0B4" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "redshift-ra3-large-integ/VPC/PrivateSubnet2/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" - }, - "subnetId": { - "Ref": "VPCPrivateSubnet2SubnetCFCDAA7A" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "redshift-ra3-large-integ/VPC/PrivateSubnet2/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "destinationCidrBlock": "0.0.0.0/0", - "natGatewayId": { - "Ref": "VPCPublicSubnet2NATGateway3C070193" - }, - "routeTableId": { - "Ref": "VPCPrivateSubnet2RouteTable0A19E10E" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", - "version": "0.0.0" - } - }, - "IGW": { - "id": "IGW", - "path": "redshift-ra3-large-integ/VPC/IGW", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", - "aws:cdk:cloudformation:props": { - "tags": [ - { - "key": "Name", - "value": "redshift-ra3-large-integ/VPC" - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnInternetGateway", - "version": "0.0.0" - } - }, - "VPCGW": { - "id": "VPCGW", - "path": "redshift-ra3-large-integ/VPC/VPCGW", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", - "aws:cdk:cloudformation:props": { - "internetGatewayId": { - "Ref": "VPCIGWB7E252D3" - }, - "vpcId": { - "Ref": "VPCB9E5F0B4" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.Vpc", - "version": "0.0.0" - } - }, - "RA3LargeCluster": { - "id": "RA3LargeCluster", - "path": "redshift-ra3-large-integ/RA3LargeCluster", - "children": { - "Subnets": { - "id": "Subnets", - "path": "redshift-ra3-large-integ/RA3LargeCluster/Subnets", - "children": { - "Default": { - "id": "Default", - "path": "redshift-ra3-large-integ/RA3LargeCluster/Subnets/Default", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Redshift::ClusterSubnetGroup", - "aws:cdk:cloudformation:props": { - "description": "Subnets for RA3LargeCluster Redshift cluster", - "subnetIds": [ - { - "Ref": "VPCPublicSubnet1SubnetB4246D30" - }, - { - "Ref": "VPCPublicSubnet2Subnet74179F39" - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_redshift.CfnClusterSubnetGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-redshift-alpha.ClusterSubnetGroup", - "version": "0.0.0" - } - }, - "SecurityGroup": { - "id": "SecurityGroup", - "path": "redshift-ra3-large-integ/RA3LargeCluster/SecurityGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "redshift-ra3-large-integ/RA3LargeCluster/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": "VPCB9E5F0B4" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.SecurityGroup", - "version": "0.0.0" - } - }, - "Secret": { - "id": "Secret", - "path": "redshift-ra3-large-integ/RA3LargeCluster/Secret", - "children": { - "Resource": { - "id": "Resource", - "path": "redshift-ra3-large-integ/RA3LargeCluster/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-lib.aws_secretsmanager.CfnSecret", - "version": "0.0.0" - } - }, - "Attachment": { - "id": "Attachment", - "path": "redshift-ra3-large-integ/RA3LargeCluster/Secret/Attachment", - "children": { - "Resource": { - "id": "Resource", - "path": "redshift-ra3-large-integ/RA3LargeCluster/Secret/Attachment/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::SecretsManager::SecretTargetAttachment", - "aws:cdk:cloudformation:props": { - "secretId": { - "Ref": "RA3LargeClusterSecret4A7DB934" - }, - "targetId": { - "Ref": "RA3LargeClusterCA6C6D40" - }, - "targetType": "AWS::Redshift::Cluster" - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_secretsmanager.CfnSecretTargetAttachment", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_secretsmanager.SecretTargetAttachment", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-redshift-alpha.DatabaseSecret", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "redshift-ra3-large-integ/RA3LargeCluster/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Redshift::Cluster", - "aws:cdk:cloudformation:props": { - "allowVersionUpgrade": true, - "automatedSnapshotRetentionPeriod": 1, - "clusterSubnetGroupName": { - "Ref": "RA3LargeClusterSubnets3256497D" - }, - "clusterType": "multi-node", - "dbName": "default_db", - "encrypted": true, - "masterUsername": { - "Fn::Join": [ - "", - [ - "{{resolve:secretsmanager:", - { - "Ref": "RA3LargeClusterSecret4A7DB934" - }, - ":SecretString:username::}}" - ] - ] - }, - "masterUserPassword": { - "Fn::Join": [ - "", - [ - "{{resolve:secretsmanager:", - { - "Ref": "RA3LargeClusterSecret4A7DB934" - }, - ":SecretString:password::}}" - ] - ] - }, - "nodeType": "ra3.large", - "numberOfNodes": 2, - "publiclyAccessible": false, - "vpcSecurityGroupIds": [ - { - "Fn::GetAtt": [ - "RA3LargeClusterSecurityGroupDEDD1AE1", - "GroupId" - ] - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_redshift.CfnCluster", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-redshift-alpha.Cluster", - "version": "0.0.0" - } - }, - "BootstrapVersion": { - "id": "BootstrapVersion", - "path": "redshift-ra3-large-integ/BootstrapVersion", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnParameter", - "version": "0.0.0" - } - }, - "CheckBootstrapVersion": { - "id": "CheckBootstrapVersion", - "path": "redshift-ra3-large-integ/CheckBootstrapVersion", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnRule", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.Stack", - "version": "0.0.0" - } - }, - "RA3LargeNodeIntegTest": { - "id": "RA3LargeNodeIntegTest", - "path": "RA3LargeNodeIntegTest", - "children": { - "DefaultTest": { - "id": "DefaultTest", - "path": "RA3LargeNodeIntegTest/DefaultTest", - "children": { - "Default": { - "id": "Default", - "path": "RA3LargeNodeIntegTest/DefaultTest/Default", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.3.0" - } - }, - "DeployAssert": { - "id": "DeployAssert", - "path": "RA3LargeNodeIntegTest/DefaultTest/DeployAssert", - "children": { - "BootstrapVersion": { - "id": "BootstrapVersion", - "path": "RA3LargeNodeIntegTest/DefaultTest/DeployAssert/BootstrapVersion", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnParameter", - "version": "0.0.0" - } - }, - "CheckBootstrapVersion": { - "id": "CheckBootstrapVersion", - "path": "RA3LargeNodeIntegTest/DefaultTest/DeployAssert/CheckBootstrapVersion", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnRule", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.Stack", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "0.0.0" - } - }, - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.3.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.App", - "version": "0.0.0" - } - } -} \ No newline at end of file