From 5ca1bdc692466775b6e10e3271f3076168067c3a Mon Sep 17 00:00:00 2001 From: Stijn Brouwers Date: Wed, 26 Oct 2022 16:34:07 +0200 Subject: [PATCH 1/9] bugfix(opensearch): Don't throw a Az count mismatch when using imported subnets --- .../aws-opensearchservice/lib/domain.ts | 29 +++++++++++++++++-- .../aws-opensearchservice/test/domain.test.ts | 23 ++++++++++++++- 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/packages/@aws-cdk/aws-opensearchservice/lib/domain.ts b/packages/@aws-cdk/aws-opensearchservice/lib/domain.ts index 06d450320890f..a34f5435b4e14 100644 --- a/packages/@aws-cdk/aws-opensearchservice/lib/domain.ts +++ b/packages/@aws-cdk/aws-opensearchservice/lib/domain.ts @@ -1235,8 +1235,11 @@ export class Domain extends DomainBase implements IDomain, ec2.IConnectable { let securityGroups: ec2.ISecurityGroup[] | undefined; let subnets: ec2.ISubnet[] | undefined; + let skipZoneAwarenessCheck:boolean = false; if (props.vpc) { - subnets = selectSubnets(props.vpc, props.vpcSubnets ?? [{ subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS }]); + const subnetSelections = props.vpcSubnets ?? [{ subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS }]; + subnets = selectSubnets(props.vpc, subnetSelections); + skipZoneAwarenessCheck = zoneAwarenessCheckShouldBeSkipped(props.vpc, subnetSelections); securityGroups = props.securityGroups ?? [new ec2.SecurityGroup(this, 'SecurityGroup', { vpc: props.vpc, description: `Security group for domain ${this.node.id}`, @@ -1248,8 +1251,12 @@ export class Domain extends DomainBase implements IDomain, ec2.IConnectable { } } - // If VPC options are supplied ensure that the number of subnets matches the number AZ - if (subnets && zoneAwarenessEnabled && new Set(subnets.map((subnet) => subnet.availabilityZone)).size < availabilityZoneCount) { + // If VPC options are supplied ensure that the number of subnets matches the number AZ (only if the vpc is not imported from another stack) + if (subnets && + zoneAwarenessEnabled && + !skipZoneAwarenessCheck && + new Set(subnets.map((subnet) => subnet.availabilityZone)).size < availabilityZoneCount + ) { throw new Error('When providing vpc options you need to provide a subnet for each AZ you are using'); } @@ -1776,6 +1783,22 @@ function selectSubnets(vpc: ec2.IVpc, vpcSubnets: ec2.SubnetSelection[]): ec2.IS return selected; } +/** + * Check if any of the subnets are pending lookups. If so, the zone awareness check should be skipped, otherwise it will always throw an error + * + * @param vpc The vpc to which the subnets apply + * @param vpcSubnets The vpc subnets that should be checked + * @returns true if there are pending lookups for the subnets + */ +function zoneAwarenessCheckShouldBeSkipped(vpc: ec2.IVpc, vpcSubnets: ec2.SubnetSelection[]): boolean { + for (const selection of vpcSubnets) { + if (vpc.selectSubnets(selection).isPendingLookup) { + return true; + }; + } + return false; +} + /** * Initializes an instance type. * diff --git a/packages/@aws-cdk/aws-opensearchservice/test/domain.test.ts b/packages/@aws-cdk/aws-opensearchservice/test/domain.test.ts index 6260678513600..6e983d88baf7e 100644 --- a/packages/@aws-cdk/aws-opensearchservice/test/domain.test.ts +++ b/packages/@aws-cdk/aws-opensearchservice/test/domain.test.ts @@ -2,7 +2,7 @@ import { Match, Template } from '@aws-cdk/assertions'; import * as acm from '@aws-cdk/aws-certificatemanager'; import { Metric, Statistic } from '@aws-cdk/aws-cloudwatch'; -import { Vpc, EbsDeviceVolumeType, Port, SecurityGroup } from '@aws-cdk/aws-ec2'; +import { Vpc, EbsDeviceVolumeType, Port, SecurityGroup, SubnetType } from '@aws-cdk/aws-ec2'; import * as iam from '@aws-cdk/aws-iam'; import * as kms from '@aws-cdk/aws-kms'; import * as logs from '@aws-cdk/aws-logs'; @@ -1406,6 +1406,27 @@ describe('custom error responses', () => { })).toThrow(/you need to provide a subnet for each AZ you are using/); }); + test('Imported VPC with subnets that are still pending lookup won\'t throw Az count mismatch', () => { + const vpc = Vpc.fromLookup(stack, 'ExampleVpc', { + vpcId: 'vpc-123', + }); + let subnets = vpc.selectSubnets({ + subnetType: SubnetType.PRIVATE_WITH_EGRESS, + }); + + new Domain(stack, 'Domain1', { + version: defaultVersion, + vpc, + vpcSubnets: [subnets], + zoneAwareness: { + enabled: true, + availabilityZoneCount: 3, + }, + }); + + Template.fromStack(stack).resourceCountIs('AWS::OpenSearchService::Domain', 1); + }); + test('error when master, data or Ultra Warm instance types do not end with .search', () => { const error = /instance types must end with ".search"/; expect(() => new Domain(stack, 'Domain1', { From 059269c6f8ca66775cdf65ebeb3f3f8dd76b43da Mon Sep 17 00:00:00 2001 From: Stijn Brouwers Date: Wed, 26 Oct 2022 17:16:18 +0200 Subject: [PATCH 2/9] fix(opensearch): Add ingegration test for imported vpc --- .../test/integ.opensearch.imported-vpc.ts | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts diff --git a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts new file mode 100644 index 0000000000000..f65bc8d23dc40 --- /dev/null +++ b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts @@ -0,0 +1,48 @@ +import * as ec2 from '@aws-cdk/aws-ec2'; +import { IVpc, SubnetType } from '@aws-cdk/aws-ec2'; +import { App, Stack, StackProps, RemovalPolicy, CfnResource } from '@aws-cdk/core'; +import * as integ from '@aws-cdk/integ-tests'; +import { Construct } from 'constructs'; +import * as opensearch from '../lib'; + +class TestStack extends Stack { + constructor(scope: Construct, id: string, props?: StackProps) { + super(scope, id, props); + + const serviceLinkedRole = new CfnResource(this, 'ServiceLinkedRole', { + type: 'AWS::IAM::ServiceLinkedRole', + properties: { + AWSServiceName: 'opensearchservice.amazonaws.com', + Description: 'Role for OpenSearch VPC Test', + }, + }); + + const vpc: IVpc = ec2.Vpc.fromLookup(this, 'Vpc', { + vpcId: 'vpc-123', + }); + const subnets = vpc.selectSubnets({ subnetType: SubnetType.PRIVATE_WITH_EGRESS }); + const domainProps: opensearch.DomainProps = { + version: opensearch.EngineVersion.ELASTICSEARCH_7_1, + removalPolicy: RemovalPolicy.DESTROY, + vpc, + vpcSubnets: [subnets], + zoneAwareness: { + enabled: true, + availabilityZoneCount: 3, + }, + capacity: { + dataNodes: 2, + }, + }; + + const domain = new opensearch.Domain(this, 'Domain', domainProps); + domain.node.addDependency(serviceLinkedRole); + } +} + +const app = new App(); +const testCase = new TestStack(app, 'cdk-integ-opensearch-vpc'); +new integ.IntegTest(app, 'cdk-integ-opensearch-vpc-test', { + testCases: [testCase], +}); +app.synth(); From 3fd2d287da27f7877fcb05a0cbda207d08541686 Mon Sep 17 00:00:00 2001 From: Stijn Brouwers Date: Wed, 26 Oct 2022 18:40:05 +0200 Subject: [PATCH 3/9] bugfix(opensearch): Fix integration test for imported vpc --- .../test/integ.opensearch.imported-vpc.ts | 8 +- .../cdk-integ-opensearch-vpc.assets.json | 20 ++ .../cdk-integ-opensearch-vpc.template.json | 112 +++++++++ .../cdk.out | 1 + ...efaultTestDeployAssertF8864CE2.assets.json | 19 ++ ...aultTestDeployAssertF8864CE2.template.json | 36 +++ .../integ.json | 12 + .../manifest.json | 138 +++++++++++ .../tree.json | 228 ++++++++++++++++++ 9 files changed, 572 insertions(+), 2 deletions(-) create mode 100644 packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdk-integ-opensearch-vpc.assets.json create mode 100644 packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdk-integ-opensearch-vpc.template.json create mode 100644 packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdk.out create mode 100644 packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.assets.json create mode 100644 packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.template.json create mode 100644 packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/integ.json create mode 100644 packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/manifest.json create mode 100644 packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/tree.json diff --git a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts index f65bc8d23dc40..f75348bafe916 100644 --- a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts +++ b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts @@ -18,7 +18,7 @@ class TestStack extends Stack { }); const vpc: IVpc = ec2.Vpc.fromLookup(this, 'Vpc', { - vpcId: 'vpc-123', + isDefault: true, }); const subnets = vpc.selectSubnets({ subnetType: SubnetType.PRIVATE_WITH_EGRESS }); const domainProps: opensearch.DomainProps = { @@ -41,7 +41,11 @@ class TestStack extends Stack { } const app = new App(); -const testCase = new TestStack(app, 'cdk-integ-opensearch-vpc'); +const env = { + account: process.env.CDK_INTEG_ACCOUNT || process.env.CDK_DEFAULT_ACCOUNT, + region: process.env.CDK_INTEG_REGION || process.env.CDK_DEFAULT_REGION, +}; +const testCase = new TestStack(app, 'cdk-integ-opensearch-vpc', { env }); new integ.IntegTest(app, 'cdk-integ-opensearch-vpc-test', { testCases: [testCase], }); diff --git a/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdk-integ-opensearch-vpc.assets.json b/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdk-integ-opensearch-vpc.assets.json new file mode 100644 index 0000000000000..121f0e168d8ef --- /dev/null +++ b/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdk-integ-opensearch-vpc.assets.json @@ -0,0 +1,20 @@ +{ + "version": "21.0.0", + "files": { + "b67c23b91e2fccabfce42e91364a04393a2d67e1f52b2b2a2b9a006fd9394539": { + "source": { + "path": "cdk-integ-opensearch-vpc.template.json", + "packaging": "file" + }, + "destinations": { + "12345678-test-region": { + "bucketName": "cdk-hnb659fds-assets-12345678-test-region", + "objectKey": "b67c23b91e2fccabfce42e91364a04393a2d67e1f52b2b2a2b9a006fd9394539.json", + "region": "test-region", + "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-test-region" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdk-integ-opensearch-vpc.template.json b/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdk-integ-opensearch-vpc.template.json new file mode 100644 index 0000000000000..d4b991891ab26 --- /dev/null +++ b/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdk-integ-opensearch-vpc.template.json @@ -0,0 +1,112 @@ +{ + "Resources": { + "ServiceLinkedRole": { + "Type": "AWS::IAM::ServiceLinkedRole", + "Properties": { + "AWSServiceName": "opensearchservice.amazonaws.com", + "Description": "Role for OpenSearch VPC Test" + } + }, + "DomainSecurityGroup48AA5FD6": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "Security group for domain Domain", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "VpcId": "vpc-12345" + }, + "DependsOn": [ + "ServiceLinkedRole" + ] + }, + "Domain66AC69E0": { + "Type": "AWS::OpenSearchService::Domain", + "Properties": { + "ClusterConfig": { + "DedicatedMasterEnabled": false, + "InstanceCount": 2, + "InstanceType": "r5.large.search", + "ZoneAwarenessConfig": { + "AvailabilityZoneCount": 3 + }, + "ZoneAwarenessEnabled": true + }, + "DomainEndpointOptions": { + "EnforceHTTPS": false, + "TLSSecurityPolicy": "Policy-Min-TLS-1-0-2019-07" + }, + "EBSOptions": { + "EBSEnabled": true, + "VolumeSize": 10, + "VolumeType": "gp2" + }, + "EncryptionAtRestOptions": { + "Enabled": false + }, + "EngineVersion": "Elasticsearch_7.1", + "LogPublishingOptions": {}, + "NodeToNodeEncryptionOptions": { + "Enabled": false + }, + "VPCOptions": { + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "DomainSecurityGroup48AA5FD6", + "GroupId" + ] + } + ], + "SubnetIds": [ + "p-12345", + "p-67890" + ] + } + }, + "DependsOn": [ + "ServiceLinkedRole" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdk.out b/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdk.out new file mode 100644 index 0000000000000..8ecc185e9dbee --- /dev/null +++ b/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"21.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.assets.json b/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.assets.json new file mode 100644 index 0000000000000..a412fc4461c1b --- /dev/null +++ b/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.assets.json @@ -0,0 +1,19 @@ +{ + "version": "21.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.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-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.template.json b/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.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-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/integ.json b/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/integ.json new file mode 100644 index 0000000000000..a4d48a1c8f0fd --- /dev/null +++ b/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "21.0.0", + "testCases": { + "cdk-integ-opensearch-vpc-test/DefaultTest": { + "stacks": [ + "cdk-integ-opensearch-vpc" + ], + "assertionStack": "cdk-integ-opensearch-vpc-test/DefaultTest/DeployAssert", + "assertionStackName": "cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/manifest.json b/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/manifest.json new file mode 100644 index 0000000000000..763916742fed9 --- /dev/null +++ b/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/manifest.json @@ -0,0 +1,138 @@ +{ + "version": "21.0.0", + "artifacts": { + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + }, + "cdk-integ-opensearch-vpc.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "cdk-integ-opensearch-vpc.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "cdk-integ-opensearch-vpc": { + "type": "aws:cloudformation:stack", + "environment": "aws://12345678/test-region", + "properties": { + "templateFile": "cdk-integ-opensearch-vpc.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-deploy-role-12345678-test-region", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-cfn-exec-role-12345678-test-region", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-12345678-test-region/b67c23b91e2fccabfce42e91364a04393a2d67e1f52b2b2a2b9a006fd9394539.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "cdk-integ-opensearch-vpc.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-lookup-role-12345678-test-region", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "cdk-integ-opensearch-vpc.assets" + ], + "metadata": { + "/cdk-integ-opensearch-vpc/ServiceLinkedRole": [ + { + "type": "aws:cdk:logicalId", + "data": "ServiceLinkedRole" + } + ], + "/cdk-integ-opensearch-vpc/Domain/SecurityGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "DomainSecurityGroup48AA5FD6" + } + ], + "/cdk-integ-opensearch-vpc/Domain/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Domain66AC69E0" + } + ], + "/cdk-integ-opensearch-vpc/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/cdk-integ-opensearch-vpc/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "cdk-integ-opensearch-vpc" + }, + "cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.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": [ + "cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.assets" + ], + "metadata": { + "/cdk-integ-opensearch-vpc-test/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/cdk-integ-opensearch-vpc-test/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "cdk-integ-opensearch-vpc-test/DefaultTest/DeployAssert" + } + }, + "missing": [ + { + "key": "vpc-provider:account=12345678:filter.isDefault=true:region=test-region:returnAsymmetricSubnets=true", + "provider": "vpc-provider", + "props": { + "account": "12345678", + "region": "test-region", + "filter": { + "isDefault": "true" + }, + "returnAsymmetricSubnets": true, + "lookupRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-lookup-role-12345678-test-region" + } + } + ] +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/tree.json b/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/tree.json new file mode 100644 index 0000000000000..89237292625fb --- /dev/null +++ b/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/tree.json @@ -0,0 +1,228 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.133" + } + }, + "cdk-integ-opensearch-vpc": { + "id": "cdk-integ-opensearch-vpc", + "path": "cdk-integ-opensearch-vpc", + "children": { + "ServiceLinkedRole": { + "id": "ServiceLinkedRole", + "path": "cdk-integ-opensearch-vpc/ServiceLinkedRole", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnResource", + "version": "0.0.0" + } + }, + "Vpc": { + "id": "Vpc", + "path": "cdk-integ-opensearch-vpc/Vpc", + "children": { + "PublicSubnet1": { + "id": "PublicSubnet1", + "path": "cdk-integ-opensearch-vpc/Vpc/PublicSubnet1", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "PublicSubnet2": { + "id": "PublicSubnet2", + "path": "cdk-integ-opensearch-vpc/Vpc/PublicSubnet2", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "PrivateSubnet1": { + "id": "PrivateSubnet1", + "path": "cdk-integ-opensearch-vpc/Vpc/PrivateSubnet1", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "PrivateSubnet2": { + "id": "PrivateSubnet2", + "path": "cdk-integ-opensearch-vpc/Vpc/PrivateSubnet2", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "IsolatedSubnet1": { + "id": "IsolatedSubnet1", + "path": "cdk-integ-opensearch-vpc/Vpc/IsolatedSubnet1", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "IsolatedSubnet2": { + "id": "IsolatedSubnet2", + "path": "cdk-integ-opensearch-vpc/Vpc/IsolatedSubnet2", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "Domain": { + "id": "Domain", + "path": "cdk-integ-opensearch-vpc/Domain", + "children": { + "SecurityGroup": { + "id": "SecurityGroup", + "path": "cdk-integ-opensearch-vpc/Domain/SecurityGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "cdk-integ-opensearch-vpc/Domain/SecurityGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "Security group for domain Domain", + "securityGroupEgress": [ + { + "cidrIp": "0.0.0.0/0", + "description": "Allow all outbound traffic by default", + "ipProtocol": "-1" + } + ], + "vpcId": "vpc-12345" + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.SecurityGroup", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "cdk-integ-opensearch-vpc/Domain/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::OpenSearchService::Domain", + "aws:cdk:cloudformation:props": { + "clusterConfig": { + "dedicatedMasterEnabled": false, + "instanceCount": 2, + "instanceType": "r5.large.search", + "zoneAwarenessEnabled": true, + "zoneAwarenessConfig": { + "availabilityZoneCount": 3 + } + }, + "domainEndpointOptions": { + "enforceHttps": false, + "tlsSecurityPolicy": "Policy-Min-TLS-1-0-2019-07" + }, + "ebsOptions": { + "ebsEnabled": true, + "volumeSize": 10, + "volumeType": "gp2" + }, + "encryptionAtRestOptions": { + "enabled": false + }, + "engineVersion": "Elasticsearch_7.1", + "logPublishingOptions": {}, + "nodeToNodeEncryptionOptions": { + "enabled": false + }, + "vpcOptions": { + "securityGroupIds": [ + { + "Fn::GetAtt": [ + "DomainSecurityGroup48AA5FD6", + "GroupId" + ] + } + ], + "subnetIds": [ + "p-12345", + "p-67890" + ] + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-opensearchservice.CfnDomain", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-opensearchservice.Domain", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "cdk-integ-opensearch-vpc-test": { + "id": "cdk-integ-opensearch-vpc-test", + "path": "cdk-integ-opensearch-vpc-test", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "cdk-integ-opensearch-vpc-test/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "cdk-integ-opensearch-vpc-test/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.133" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "cdk-integ-opensearch-vpc-test/DefaultTest/DeployAssert", + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests.IntegTest", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" + } + } +} \ No newline at end of file From f67bc43583f0721440258dcd5ca60bebf4ae0e5d Mon Sep 17 00:00:00 2001 From: Stijn Brouwers Date: Wed, 16 Nov 2022 10:10:54 +0100 Subject: [PATCH 4/9] bugfix(opensearch): Fix integration test for imported vpc --- .../StackWithVpc.assets.json | 20 + .../StackWithVpc.template.json | 564 +++++++++++ .../cdk-integ-opensearch-vpc.assets.json | 0 .../cdk-integ-opensearch-vpc.template.json | 0 .../cdk.out | 0 .../integ.json | 14 + .../manifest.json | 256 +++++ .../tree.json | 934 ++++++++++++++++++ .../test/integ.opensearch.imported-vpc.ts | 27 +- ...efaultTestDeployAssertF8864CE2.assets.json | 19 - ...aultTestDeployAssertF8864CE2.template.json | 36 - .../integ.json | 12 - .../manifest.json | 138 --- .../tree.json | 228 ----- 14 files changed, 1808 insertions(+), 440 deletions(-) create mode 100644 packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/StackWithVpc.assets.json create mode 100644 packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/StackWithVpc.template.json rename packages/@aws-cdk/aws-opensearchservice/test/{opensearch.imported-vpc.integ.snapshot => integ.opensearch.imported-vpc.js.snapshot}/cdk-integ-opensearch-vpc.assets.json (100%) rename packages/@aws-cdk/aws-opensearchservice/test/{opensearch.imported-vpc.integ.snapshot => integ.opensearch.imported-vpc.js.snapshot}/cdk-integ-opensearch-vpc.template.json (100%) rename packages/@aws-cdk/aws-opensearchservice/test/{opensearch.imported-vpc.integ.snapshot => integ.opensearch.imported-vpc.js.snapshot}/cdk.out (100%) create mode 100644 packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/integ.json create mode 100644 packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/manifest.json create mode 100644 packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/tree.json delete mode 100644 packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.assets.json delete mode 100644 packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.template.json delete mode 100644 packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/integ.json delete mode 100644 packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/manifest.json delete mode 100644 packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/tree.json diff --git a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/StackWithVpc.assets.json b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/StackWithVpc.assets.json new file mode 100644 index 0000000000000..afda90036e882 --- /dev/null +++ b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/StackWithVpc.assets.json @@ -0,0 +1,20 @@ +{ + "version": "21.0.0", + "files": { + "b723f0bed9ea9a4e8d237408e0debfa443e0a646b76eeeab26215935a74297bf": { + "source": { + "path": "StackWithVpc.template.json", + "packaging": "file" + }, + "destinations": { + "12345678-test-region": { + "bucketName": "cdk-hnb659fds-assets-12345678-test-region", + "objectKey": "b723f0bed9ea9a4e8d237408e0debfa443e0a646b76eeeab26215935a74297bf.json", + "region": "test-region", + "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-test-region" + } + } + } + }, + "dockerImages": {} +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/StackWithVpc.template.json b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/StackWithVpc.template.json new file mode 100644 index 0000000000000..1ac4b082ed672 --- /dev/null +++ b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/StackWithVpc.template.json @@ -0,0 +1,564 @@ +{ + "Resources": { + "MyVpcF9F0CA6F": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "my-vpc-name" + } + ] + } + }, + "MyVpcPublicSubnet1SubnetF6608456": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "AvailabilityZone": "test-region-1a", + "CidrBlock": "10.0.0.0/19", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PublicSubnet1" + } + ] + } + }, + "MyVpcPublicSubnet1RouteTableC46AB2F4": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "Tags": [ + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PublicSubnet1" + } + ] + } + }, + "MyVpcPublicSubnet1RouteTableAssociation2ECEE1CB": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPublicSubnet1RouteTableC46AB2F4" + }, + "SubnetId": { + "Ref": "MyVpcPublicSubnet1SubnetF6608456" + } + } + }, + "MyVpcPublicSubnet1DefaultRoute95FDF9EB": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPublicSubnet1RouteTableC46AB2F4" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "MyVpcIGW5C4A4F63" + } + }, + "DependsOn": [ + "MyVpcVPCGW488ACE0D" + ] + }, + "MyVpcPublicSubnet1EIP096967CB": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PublicSubnet1" + } + ] + } + }, + "MyVpcPublicSubnet1NATGatewayAD3400C1": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "SubnetId": { + "Ref": "MyVpcPublicSubnet1SubnetF6608456" + }, + "AllocationId": { + "Fn::GetAtt": [ + "MyVpcPublicSubnet1EIP096967CB", + "AllocationId" + ] + }, + "Tags": [ + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PublicSubnet1" + } + ] + }, + "DependsOn": [ + "MyVpcPublicSubnet1DefaultRoute95FDF9EB", + "MyVpcPublicSubnet1RouteTableAssociation2ECEE1CB" + ] + }, + "MyVpcPublicSubnet2Subnet492B6BFB": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "AvailabilityZone": "test-region-1b", + "CidrBlock": "10.0.32.0/19", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PublicSubnet2" + } + ] + } + }, + "MyVpcPublicSubnet2RouteTable1DF17386": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "Tags": [ + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PublicSubnet2" + } + ] + } + }, + "MyVpcPublicSubnet2RouteTableAssociation227DE78D": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPublicSubnet2RouteTable1DF17386" + }, + "SubnetId": { + "Ref": "MyVpcPublicSubnet2Subnet492B6BFB" + } + } + }, + "MyVpcPublicSubnet2DefaultRoute052936F6": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPublicSubnet2RouteTable1DF17386" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "MyVpcIGW5C4A4F63" + } + }, + "DependsOn": [ + "MyVpcVPCGW488ACE0D" + ] + }, + "MyVpcPublicSubnet2EIP8CCBA239": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PublicSubnet2" + } + ] + } + }, + "MyVpcPublicSubnet2NATGateway91BFBEC9": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "SubnetId": { + "Ref": "MyVpcPublicSubnet2Subnet492B6BFB" + }, + "AllocationId": { + "Fn::GetAtt": [ + "MyVpcPublicSubnet2EIP8CCBA239", + "AllocationId" + ] + }, + "Tags": [ + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PublicSubnet2" + } + ] + }, + "DependsOn": [ + "MyVpcPublicSubnet2DefaultRoute052936F6", + "MyVpcPublicSubnet2RouteTableAssociation227DE78D" + ] + }, + "MyVpcPublicSubnet3Subnet57EEE236": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "AvailabilityZone": "test-region-1c", + "CidrBlock": "10.0.64.0/19", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PublicSubnet3" + } + ] + } + }, + "MyVpcPublicSubnet3RouteTable15028F08": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "Tags": [ + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PublicSubnet3" + } + ] + } + }, + "MyVpcPublicSubnet3RouteTableAssociation5C27DDA4": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPublicSubnet3RouteTable15028F08" + }, + "SubnetId": { + "Ref": "MyVpcPublicSubnet3Subnet57EEE236" + } + } + }, + "MyVpcPublicSubnet3DefaultRoute3A83AB36": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPublicSubnet3RouteTable15028F08" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "MyVpcIGW5C4A4F63" + } + }, + "DependsOn": [ + "MyVpcVPCGW488ACE0D" + ] + }, + "MyVpcPublicSubnet3EIPC5ACADAB": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PublicSubnet3" + } + ] + } + }, + "MyVpcPublicSubnet3NATGatewayD4B50EBE": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "SubnetId": { + "Ref": "MyVpcPublicSubnet3Subnet57EEE236" + }, + "AllocationId": { + "Fn::GetAtt": [ + "MyVpcPublicSubnet3EIPC5ACADAB", + "AllocationId" + ] + }, + "Tags": [ + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PublicSubnet3" + } + ] + }, + "DependsOn": [ + "MyVpcPublicSubnet3DefaultRoute3A83AB36", + "MyVpcPublicSubnet3RouteTableAssociation5C27DDA4" + ] + }, + "MyVpcPrivateSubnet1Subnet5057CF7E": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "AvailabilityZone": "test-region-1a", + "CidrBlock": "10.0.96.0/19", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PrivateSubnet1" + } + ] + } + }, + "MyVpcPrivateSubnet1RouteTable8819E6E2": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "Tags": [ + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PrivateSubnet1" + } + ] + } + }, + "MyVpcPrivateSubnet1RouteTableAssociation56D38C7E": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPrivateSubnet1RouteTable8819E6E2" + }, + "SubnetId": { + "Ref": "MyVpcPrivateSubnet1Subnet5057CF7E" + } + } + }, + "MyVpcPrivateSubnet1DefaultRouteA8CDE2FA": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPrivateSubnet1RouteTable8819E6E2" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "MyVpcPublicSubnet1NATGatewayAD3400C1" + } + } + }, + "MyVpcPrivateSubnet2Subnet0040C983": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "AvailabilityZone": "test-region-1b", + "CidrBlock": "10.0.128.0/19", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PrivateSubnet2" + } + ] + } + }, + "MyVpcPrivateSubnet2RouteTableCEDCEECE": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "Tags": [ + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PrivateSubnet2" + } + ] + } + }, + "MyVpcPrivateSubnet2RouteTableAssociation86A610DA": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPrivateSubnet2RouteTableCEDCEECE" + }, + "SubnetId": { + "Ref": "MyVpcPrivateSubnet2Subnet0040C983" + } + } + }, + "MyVpcPrivateSubnet2DefaultRoute9CE96294": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPrivateSubnet2RouteTableCEDCEECE" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "MyVpcPublicSubnet2NATGateway91BFBEC9" + } + } + }, + "MyVpcPrivateSubnet3Subnet772D6AD7": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "AvailabilityZone": "test-region-1c", + "CidrBlock": "10.0.160.0/19", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PrivateSubnet3" + } + ] + } + }, + "MyVpcPrivateSubnet3RouteTableB790927C": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "Tags": [ + { + "Key": "Name", + "Value": "StackWithVpc/MyVpc/PrivateSubnet3" + } + ] + } + }, + "MyVpcPrivateSubnet3RouteTableAssociationD951741C": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPrivateSubnet3RouteTableB790927C" + }, + "SubnetId": { + "Ref": "MyVpcPrivateSubnet3Subnet772D6AD7" + } + } + }, + "MyVpcPrivateSubnet3DefaultRouteEC11C0C5": { + "Type": "AWS::EC2::Route", + "Properties": { + "RouteTableId": { + "Ref": "MyVpcPrivateSubnet3RouteTableB790927C" + }, + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "MyVpcPublicSubnet3NATGatewayD4B50EBE" + } + } + }, + "MyVpcIGW5C4A4F63": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "my-vpc-name" + } + ] + } + }, + "MyVpcVPCGW488ACE0D": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "VpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "InternetGatewayId": { + "Ref": "MyVpcIGW5C4A4F63" + } + } + } + }, + "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-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdk-integ-opensearch-vpc.assets.json b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/cdk-integ-opensearch-vpc.assets.json similarity index 100% rename from packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdk-integ-opensearch-vpc.assets.json rename to packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/cdk-integ-opensearch-vpc.assets.json diff --git a/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdk-integ-opensearch-vpc.template.json b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/cdk-integ-opensearch-vpc.template.json similarity index 100% rename from packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdk-integ-opensearch-vpc.template.json rename to packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/cdk-integ-opensearch-vpc.template.json diff --git a/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdk.out b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/cdk.out similarity index 100% rename from packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdk.out rename to packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/cdk.out diff --git a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/integ.json b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/integ.json new file mode 100644 index 0000000000000..791dd91036794 --- /dev/null +++ b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/integ.json @@ -0,0 +1,14 @@ +{ + "version": "21.0.0", + "testCases": { + "integ.opensearch.imported-vpc": { + "stacks": [ + "*" + ], + "diffAssets": false, + "stackUpdateWorkflow": true + } + }, + "synthContext": {}, + "enableLookups": true +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/manifest.json b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/manifest.json new file mode 100644 index 0000000000000..449331d261e48 --- /dev/null +++ b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/manifest.json @@ -0,0 +1,256 @@ +{ + "version": "21.0.0", + "artifacts": { + "StackWithVpc.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "StackWithVpc.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "StackWithVpc": { + "type": "aws:cloudformation:stack", + "environment": "aws://12345678/test-region", + "properties": { + "templateFile": "StackWithVpc.template.json", + "validateOnSynth": false, + "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-deploy-role-12345678-test-region", + "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-cfn-exec-role-12345678-test-region", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-12345678-test-region/b723f0bed9ea9a4e8d237408e0debfa443e0a646b76eeeab26215935a74297bf.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "StackWithVpc.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-lookup-role-12345678-test-region", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "StackWithVpc.assets" + ], + "metadata": { + "/StackWithVpc/MyVpc/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcF9F0CA6F" + } + ], + "/StackWithVpc/MyVpc/PublicSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet1SubnetF6608456" + } + ], + "/StackWithVpc/MyVpc/PublicSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet1RouteTableC46AB2F4" + } + ], + "/StackWithVpc/MyVpc/PublicSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet1RouteTableAssociation2ECEE1CB" + } + ], + "/StackWithVpc/MyVpc/PublicSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet1DefaultRoute95FDF9EB" + } + ], + "/StackWithVpc/MyVpc/PublicSubnet1/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet1EIP096967CB" + } + ], + "/StackWithVpc/MyVpc/PublicSubnet1/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet1NATGatewayAD3400C1" + } + ], + "/StackWithVpc/MyVpc/PublicSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet2Subnet492B6BFB" + } + ], + "/StackWithVpc/MyVpc/PublicSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet2RouteTable1DF17386" + } + ], + "/StackWithVpc/MyVpc/PublicSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet2RouteTableAssociation227DE78D" + } + ], + "/StackWithVpc/MyVpc/PublicSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet2DefaultRoute052936F6" + } + ], + "/StackWithVpc/MyVpc/PublicSubnet2/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet2EIP8CCBA239" + } + ], + "/StackWithVpc/MyVpc/PublicSubnet2/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet2NATGateway91BFBEC9" + } + ], + "/StackWithVpc/MyVpc/PublicSubnet3/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet3Subnet57EEE236" + } + ], + "/StackWithVpc/MyVpc/PublicSubnet3/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet3RouteTable15028F08" + } + ], + "/StackWithVpc/MyVpc/PublicSubnet3/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet3RouteTableAssociation5C27DDA4" + } + ], + "/StackWithVpc/MyVpc/PublicSubnet3/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet3DefaultRoute3A83AB36" + } + ], + "/StackWithVpc/MyVpc/PublicSubnet3/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet3EIPC5ACADAB" + } + ], + "/StackWithVpc/MyVpc/PublicSubnet3/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPublicSubnet3NATGatewayD4B50EBE" + } + ], + "/StackWithVpc/MyVpc/PrivateSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPrivateSubnet1Subnet5057CF7E" + } + ], + "/StackWithVpc/MyVpc/PrivateSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPrivateSubnet1RouteTable8819E6E2" + } + ], + "/StackWithVpc/MyVpc/PrivateSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPrivateSubnet1RouteTableAssociation56D38C7E" + } + ], + "/StackWithVpc/MyVpc/PrivateSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPrivateSubnet1DefaultRouteA8CDE2FA" + } + ], + "/StackWithVpc/MyVpc/PrivateSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPrivateSubnet2Subnet0040C983" + } + ], + "/StackWithVpc/MyVpc/PrivateSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPrivateSubnet2RouteTableCEDCEECE" + } + ], + "/StackWithVpc/MyVpc/PrivateSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPrivateSubnet2RouteTableAssociation86A610DA" + } + ], + "/StackWithVpc/MyVpc/PrivateSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPrivateSubnet2DefaultRoute9CE96294" + } + ], + "/StackWithVpc/MyVpc/PrivateSubnet3/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPrivateSubnet3Subnet772D6AD7" + } + ], + "/StackWithVpc/MyVpc/PrivateSubnet3/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPrivateSubnet3RouteTableB790927C" + } + ], + "/StackWithVpc/MyVpc/PrivateSubnet3/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPrivateSubnet3RouteTableAssociationD951741C" + } + ], + "/StackWithVpc/MyVpc/PrivateSubnet3/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcPrivateSubnet3DefaultRouteEC11C0C5" + } + ], + "/StackWithVpc/MyVpc/IGW": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcIGW5C4A4F63" + } + ], + "/StackWithVpc/MyVpc/VPCGW": [ + { + "type": "aws:cdk:logicalId", + "data": "MyVpcVPCGW488ACE0D" + } + ], + "/StackWithVpc/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/StackWithVpc/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "StackWithVpc" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/tree.json b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/tree.json new file mode 100644 index 0000000000000..4ed6a4f074c9b --- /dev/null +++ b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/tree.json @@ -0,0 +1,934 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "StackWithVpc": { + "id": "StackWithVpc", + "path": "StackWithVpc", + "children": { + "MyVpc": { + "id": "MyVpc", + "path": "StackWithVpc/MyVpc", + "children": { + "Resource": { + "id": "Resource", + "path": "StackWithVpc/MyVpc/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": "my-vpc-name" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnVPC", + "version": "0.0.0" + } + }, + "PublicSubnet1": { + "id": "PublicSubnet1", + "path": "StackWithVpc/MyVpc/PublicSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "StackWithVpc/MyVpc/PublicSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "availabilityZone": "test-region-1a", + "cidrBlock": "10.0.0.0/19", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "StackWithVpc/MyVpc/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "StackWithVpc/MyVpc/PublicSubnet1/Acl", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "StackWithVpc/MyVpc/PublicSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "tags": [ + { + "key": "Name", + "value": "StackWithVpc/MyVpc/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "StackWithVpc/MyVpc/PublicSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "MyVpcPublicSubnet1RouteTableC46AB2F4" + }, + "subnetId": { + "Ref": "MyVpcPublicSubnet1SubnetF6608456" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "StackWithVpc/MyVpc/PublicSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "MyVpcPublicSubnet1RouteTableC46AB2F4" + }, + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "MyVpcIGW5C4A4F63" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRoute", + "version": "0.0.0" + } + }, + "EIP": { + "id": "EIP", + "path": "StackWithVpc/MyVpc/PublicSubnet1/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "StackWithVpc/MyVpc/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnEIP", + "version": "0.0.0" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "StackWithVpc/MyVpc/PublicSubnet1/NATGateway", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", + "aws:cdk:cloudformation:props": { + "subnetId": { + "Ref": "MyVpcPublicSubnet1SubnetF6608456" + }, + "allocationId": { + "Fn::GetAtt": [ + "MyVpcPublicSubnet1EIP096967CB", + "AllocationId" + ] + }, + "tags": [ + { + "key": "Name", + "value": "StackWithVpc/MyVpc/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnNatGateway", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.PublicSubnet", + "version": "0.0.0" + } + }, + "PublicSubnet2": { + "id": "PublicSubnet2", + "path": "StackWithVpc/MyVpc/PublicSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "StackWithVpc/MyVpc/PublicSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "availabilityZone": "test-region-1b", + "cidrBlock": "10.0.32.0/19", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "StackWithVpc/MyVpc/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "StackWithVpc/MyVpc/PublicSubnet2/Acl", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "StackWithVpc/MyVpc/PublicSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "tags": [ + { + "key": "Name", + "value": "StackWithVpc/MyVpc/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "StackWithVpc/MyVpc/PublicSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "MyVpcPublicSubnet2RouteTable1DF17386" + }, + "subnetId": { + "Ref": "MyVpcPublicSubnet2Subnet492B6BFB" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "StackWithVpc/MyVpc/PublicSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "MyVpcPublicSubnet2RouteTable1DF17386" + }, + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "MyVpcIGW5C4A4F63" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRoute", + "version": "0.0.0" + } + }, + "EIP": { + "id": "EIP", + "path": "StackWithVpc/MyVpc/PublicSubnet2/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "StackWithVpc/MyVpc/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnEIP", + "version": "0.0.0" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "StackWithVpc/MyVpc/PublicSubnet2/NATGateway", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", + "aws:cdk:cloudformation:props": { + "subnetId": { + "Ref": "MyVpcPublicSubnet2Subnet492B6BFB" + }, + "allocationId": { + "Fn::GetAtt": [ + "MyVpcPublicSubnet2EIP8CCBA239", + "AllocationId" + ] + }, + "tags": [ + { + "key": "Name", + "value": "StackWithVpc/MyVpc/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnNatGateway", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.PublicSubnet", + "version": "0.0.0" + } + }, + "PublicSubnet3": { + "id": "PublicSubnet3", + "path": "StackWithVpc/MyVpc/PublicSubnet3", + "children": { + "Subnet": { + "id": "Subnet", + "path": "StackWithVpc/MyVpc/PublicSubnet3/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "availabilityZone": "test-region-1c", + "cidrBlock": "10.0.64.0/19", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "StackWithVpc/MyVpc/PublicSubnet3" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "StackWithVpc/MyVpc/PublicSubnet3/Acl", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "StackWithVpc/MyVpc/PublicSubnet3/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "tags": [ + { + "key": "Name", + "value": "StackWithVpc/MyVpc/PublicSubnet3" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "StackWithVpc/MyVpc/PublicSubnet3/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "MyVpcPublicSubnet3RouteTable15028F08" + }, + "subnetId": { + "Ref": "MyVpcPublicSubnet3Subnet57EEE236" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "StackWithVpc/MyVpc/PublicSubnet3/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "MyVpcPublicSubnet3RouteTable15028F08" + }, + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "MyVpcIGW5C4A4F63" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRoute", + "version": "0.0.0" + } + }, + "EIP": { + "id": "EIP", + "path": "StackWithVpc/MyVpc/PublicSubnet3/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "StackWithVpc/MyVpc/PublicSubnet3" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnEIP", + "version": "0.0.0" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "StackWithVpc/MyVpc/PublicSubnet3/NATGateway", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", + "aws:cdk:cloudformation:props": { + "subnetId": { + "Ref": "MyVpcPublicSubnet3Subnet57EEE236" + }, + "allocationId": { + "Fn::GetAtt": [ + "MyVpcPublicSubnet3EIPC5ACADAB", + "AllocationId" + ] + }, + "tags": [ + { + "key": "Name", + "value": "StackWithVpc/MyVpc/PublicSubnet3" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnNatGateway", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.PublicSubnet", + "version": "0.0.0" + } + }, + "PrivateSubnet1": { + "id": "PrivateSubnet1", + "path": "StackWithVpc/MyVpc/PrivateSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "StackWithVpc/MyVpc/PrivateSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "availabilityZone": "test-region-1a", + "cidrBlock": "10.0.96.0/19", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Private" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Private" + }, + { + "key": "Name", + "value": "StackWithVpc/MyVpc/PrivateSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "StackWithVpc/MyVpc/PrivateSubnet1/Acl", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "StackWithVpc/MyVpc/PrivateSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "tags": [ + { + "key": "Name", + "value": "StackWithVpc/MyVpc/PrivateSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "StackWithVpc/MyVpc/PrivateSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "MyVpcPrivateSubnet1RouteTable8819E6E2" + }, + "subnetId": { + "Ref": "MyVpcPrivateSubnet1Subnet5057CF7E" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "StackWithVpc/MyVpc/PrivateSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "MyVpcPrivateSubnet1RouteTable8819E6E2" + }, + "destinationCidrBlock": "0.0.0.0/0", + "natGatewayId": { + "Ref": "MyVpcPublicSubnet1NATGatewayAD3400C1" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "PrivateSubnet2": { + "id": "PrivateSubnet2", + "path": "StackWithVpc/MyVpc/PrivateSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "StackWithVpc/MyVpc/PrivateSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "availabilityZone": "test-region-1b", + "cidrBlock": "10.0.128.0/19", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Private" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Private" + }, + { + "key": "Name", + "value": "StackWithVpc/MyVpc/PrivateSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "StackWithVpc/MyVpc/PrivateSubnet2/Acl", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "StackWithVpc/MyVpc/PrivateSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "tags": [ + { + "key": "Name", + "value": "StackWithVpc/MyVpc/PrivateSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "StackWithVpc/MyVpc/PrivateSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "MyVpcPrivateSubnet2RouteTableCEDCEECE" + }, + "subnetId": { + "Ref": "MyVpcPrivateSubnet2Subnet0040C983" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "StackWithVpc/MyVpc/PrivateSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "MyVpcPrivateSubnet2RouteTableCEDCEECE" + }, + "destinationCidrBlock": "0.0.0.0/0", + "natGatewayId": { + "Ref": "MyVpcPublicSubnet2NATGateway91BFBEC9" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "PrivateSubnet3": { + "id": "PrivateSubnet3", + "path": "StackWithVpc/MyVpc/PrivateSubnet3", + "children": { + "Subnet": { + "id": "Subnet", + "path": "StackWithVpc/MyVpc/PrivateSubnet3/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "availabilityZone": "test-region-1c", + "cidrBlock": "10.0.160.0/19", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Private" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Private" + }, + { + "key": "Name", + "value": "StackWithVpc/MyVpc/PrivateSubnet3" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "StackWithVpc/MyVpc/PrivateSubnet3/Acl", + "constructInfo": { + "fqn": "@aws-cdk/core.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "StackWithVpc/MyVpc/PrivateSubnet3/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "tags": [ + { + "key": "Name", + "value": "StackWithVpc/MyVpc/PrivateSubnet3" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "StackWithVpc/MyVpc/PrivateSubnet3/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "MyVpcPrivateSubnet3RouteTableB790927C" + }, + "subnetId": { + "Ref": "MyVpcPrivateSubnet3Subnet772D6AD7" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "StackWithVpc/MyVpc/PrivateSubnet3/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "MyVpcPrivateSubnet3RouteTableB790927C" + }, + "destinationCidrBlock": "0.0.0.0/0", + "natGatewayId": { + "Ref": "MyVpcPublicSubnet3NATGatewayD4B50EBE" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "IGW": { + "id": "IGW", + "path": "StackWithVpc/MyVpc/IGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "my-vpc-name" + } + ] + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnInternetGateway", + "version": "0.0.0" + } + }, + "VPCGW": { + "id": "VPCGW", + "path": "StackWithVpc/MyVpc/VPCGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", + "aws:cdk:cloudformation:props": { + "vpcId": { + "Ref": "MyVpcF9F0CA6F" + }, + "internetGatewayId": { + "Ref": "MyVpcIGW5C4A4F63" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.CfnVPCGatewayAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.Vpc", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "StackWithVpc/BootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "StackWithVpc/CheckBootstrapVersion", + "constructInfo": { + "fqn": "@aws-cdk/core.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.Stack", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.154" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/core.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts index f75348bafe916..a20f9300221c2 100644 --- a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts +++ b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts @@ -1,10 +1,22 @@ +/// !cdk-integ * pragma:enable-lookups import * as ec2 from '@aws-cdk/aws-ec2'; import { IVpc, SubnetType } from '@aws-cdk/aws-ec2'; import { App, Stack, StackProps, RemovalPolicy, CfnResource } from '@aws-cdk/core'; -import * as integ from '@aws-cdk/integ-tests'; import { Construct } from 'constructs'; import * as opensearch from '../lib'; +const appWithVpc = new App(); +const stack = new Stack(appWithVpc, 'StackWithVpc', { + env: { + account: process.env.CDK_INTEG_ACCOUNT || process.env.CDK_DEFAULT_ACCOUNT, + region: process.env.CDK_INTEG_REGION || process.env.CDK_DEFAULT_REGION, + }, +}); +new ec2.Vpc(stack, 'MyVpc', { + vpcName: 'my-vpc-name', + maxAzs: 2, +}); + class TestStack extends Stack { constructor(scope: Construct, id: string, props?: StackProps) { super(scope, id, props); @@ -17,14 +29,18 @@ class TestStack extends Stack { }, }); + /// !show const vpc: IVpc = ec2.Vpc.fromLookup(this, 'Vpc', { - isDefault: true, + vpcName: 'my-vpc-name', }); + /// !hide + const subnets = vpc.selectSubnets({ subnetType: SubnetType.PRIVATE_WITH_EGRESS }); + const domainProps: opensearch.DomainProps = { version: opensearch.EngineVersion.ELASTICSEARCH_7_1, removalPolicy: RemovalPolicy.DESTROY, - vpc, + vpc: vpc, vpcSubnets: [subnets], zoneAwareness: { enabled: true, @@ -45,8 +61,5 @@ const env = { account: process.env.CDK_INTEG_ACCOUNT || process.env.CDK_DEFAULT_ACCOUNT, region: process.env.CDK_INTEG_REGION || process.env.CDK_DEFAULT_REGION, }; -const testCase = new TestStack(app, 'cdk-integ-opensearch-vpc', { env }); -new integ.IntegTest(app, 'cdk-integ-opensearch-vpc-test', { - testCases: [testCase], -}); +new TestStack(app, 'cdk-integ-opensearch-vpc', { env }); app.synth(); diff --git a/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.assets.json b/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.assets.json deleted file mode 100644 index a412fc4461c1b..0000000000000 --- a/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.assets.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": "21.0.0", - "files": { - "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { - "source": { - "path": "cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.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-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.template.json b/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.template.json deleted file mode 100644 index ad9d0fb73d1dd..0000000000000 --- a/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.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-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/integ.json b/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/integ.json deleted file mode 100644 index a4d48a1c8f0fd..0000000000000 --- a/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/integ.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "version": "21.0.0", - "testCases": { - "cdk-integ-opensearch-vpc-test/DefaultTest": { - "stacks": [ - "cdk-integ-opensearch-vpc" - ], - "assertionStack": "cdk-integ-opensearch-vpc-test/DefaultTest/DeployAssert", - "assertionStackName": "cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/manifest.json b/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/manifest.json deleted file mode 100644 index 763916742fed9..0000000000000 --- a/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/manifest.json +++ /dev/null @@ -1,138 +0,0 @@ -{ - "version": "21.0.0", - "artifacts": { - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - }, - "cdk-integ-opensearch-vpc.assets": { - "type": "cdk:asset-manifest", - "properties": { - "file": "cdk-integ-opensearch-vpc.assets.json", - "requiresBootstrapStackVersion": 6, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" - } - }, - "cdk-integ-opensearch-vpc": { - "type": "aws:cloudformation:stack", - "environment": "aws://12345678/test-region", - "properties": { - "templateFile": "cdk-integ-opensearch-vpc.template.json", - "validateOnSynth": false, - "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-deploy-role-12345678-test-region", - "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-cfn-exec-role-12345678-test-region", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-12345678-test-region/b67c23b91e2fccabfce42e91364a04393a2d67e1f52b2b2a2b9a006fd9394539.json", - "requiresBootstrapStackVersion": 6, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", - "additionalDependencies": [ - "cdk-integ-opensearch-vpc.assets" - ], - "lookupRole": { - "arn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-lookup-role-12345678-test-region", - "requiresBootstrapStackVersion": 8, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" - } - }, - "dependencies": [ - "cdk-integ-opensearch-vpc.assets" - ], - "metadata": { - "/cdk-integ-opensearch-vpc/ServiceLinkedRole": [ - { - "type": "aws:cdk:logicalId", - "data": "ServiceLinkedRole" - } - ], - "/cdk-integ-opensearch-vpc/Domain/SecurityGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "DomainSecurityGroup48AA5FD6" - } - ], - "/cdk-integ-opensearch-vpc/Domain/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "Domain66AC69E0" - } - ], - "/cdk-integ-opensearch-vpc/BootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "BootstrapVersion" - } - ], - "/cdk-integ-opensearch-vpc/CheckBootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "CheckBootstrapVersion" - } - ] - }, - "displayName": "cdk-integ-opensearch-vpc" - }, - "cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.assets": { - "type": "cdk:asset-manifest", - "properties": { - "file": "cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.assets.json", - "requiresBootstrapStackVersion": 6, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" - } - }, - "cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2": { - "type": "aws:cloudformation:stack", - "environment": "aws://unknown-account/unknown-region", - "properties": { - "templateFile": "cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.template.json", - "validateOnSynth": false, - "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", - "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json", - "requiresBootstrapStackVersion": 6, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", - "additionalDependencies": [ - "cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.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": [ - "cdkintegopensearchvpctestDefaultTestDeployAssertF8864CE2.assets" - ], - "metadata": { - "/cdk-integ-opensearch-vpc-test/DefaultTest/DeployAssert/BootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "BootstrapVersion" - } - ], - "/cdk-integ-opensearch-vpc-test/DefaultTest/DeployAssert/CheckBootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "CheckBootstrapVersion" - } - ] - }, - "displayName": "cdk-integ-opensearch-vpc-test/DefaultTest/DeployAssert" - } - }, - "missing": [ - { - "key": "vpc-provider:account=12345678:filter.isDefault=true:region=test-region:returnAsymmetricSubnets=true", - "provider": "vpc-provider", - "props": { - "account": "12345678", - "region": "test-region", - "filter": { - "isDefault": "true" - }, - "returnAsymmetricSubnets": true, - "lookupRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-lookup-role-12345678-test-region" - } - } - ] -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/tree.json b/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/tree.json deleted file mode 100644 index 89237292625fb..0000000000000 --- a/packages/@aws-cdk/aws-opensearchservice/test/opensearch.imported-vpc.integ.snapshot/tree.json +++ /dev/null @@ -1,228 +0,0 @@ -{ - "version": "tree-0.1", - "tree": { - "id": "App", - "path": "", - "children": { - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.133" - } - }, - "cdk-integ-opensearch-vpc": { - "id": "cdk-integ-opensearch-vpc", - "path": "cdk-integ-opensearch-vpc", - "children": { - "ServiceLinkedRole": { - "id": "ServiceLinkedRole", - "path": "cdk-integ-opensearch-vpc/ServiceLinkedRole", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnResource", - "version": "0.0.0" - } - }, - "Vpc": { - "id": "Vpc", - "path": "cdk-integ-opensearch-vpc/Vpc", - "children": { - "PublicSubnet1": { - "id": "PublicSubnet1", - "path": "cdk-integ-opensearch-vpc/Vpc/PublicSubnet1", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "PublicSubnet2": { - "id": "PublicSubnet2", - "path": "cdk-integ-opensearch-vpc/Vpc/PublicSubnet2", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "PrivateSubnet1": { - "id": "PrivateSubnet1", - "path": "cdk-integ-opensearch-vpc/Vpc/PrivateSubnet1", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "PrivateSubnet2": { - "id": "PrivateSubnet2", - "path": "cdk-integ-opensearch-vpc/Vpc/PrivateSubnet2", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "IsolatedSubnet1": { - "id": "IsolatedSubnet1", - "path": "cdk-integ-opensearch-vpc/Vpc/IsolatedSubnet1", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "IsolatedSubnet2": { - "id": "IsolatedSubnet2", - "path": "cdk-integ-opensearch-vpc/Vpc/IsolatedSubnet2", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "Domain": { - "id": "Domain", - "path": "cdk-integ-opensearch-vpc/Domain", - "children": { - "SecurityGroup": { - "id": "SecurityGroup", - "path": "cdk-integ-opensearch-vpc/Domain/SecurityGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "cdk-integ-opensearch-vpc/Domain/SecurityGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", - "aws:cdk:cloudformation:props": { - "groupDescription": "Security group for domain Domain", - "securityGroupEgress": [ - { - "cidrIp": "0.0.0.0/0", - "description": "Allow all outbound traffic by default", - "ipProtocol": "-1" - } - ], - "vpcId": "vpc-12345" - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.SecurityGroup", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "cdk-integ-opensearch-vpc/Domain/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::OpenSearchService::Domain", - "aws:cdk:cloudformation:props": { - "clusterConfig": { - "dedicatedMasterEnabled": false, - "instanceCount": 2, - "instanceType": "r5.large.search", - "zoneAwarenessEnabled": true, - "zoneAwarenessConfig": { - "availabilityZoneCount": 3 - } - }, - "domainEndpointOptions": { - "enforceHttps": false, - "tlsSecurityPolicy": "Policy-Min-TLS-1-0-2019-07" - }, - "ebsOptions": { - "ebsEnabled": true, - "volumeSize": 10, - "volumeType": "gp2" - }, - "encryptionAtRestOptions": { - "enabled": false - }, - "engineVersion": "Elasticsearch_7.1", - "logPublishingOptions": {}, - "nodeToNodeEncryptionOptions": { - "enabled": false - }, - "vpcOptions": { - "securityGroupIds": [ - { - "Fn::GetAtt": [ - "DomainSecurityGroup48AA5FD6", - "GroupId" - ] - } - ], - "subnetIds": [ - "p-12345", - "p-67890" - ] - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-opensearchservice.CfnDomain", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-opensearchservice.Domain", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" - } - }, - "cdk-integ-opensearch-vpc-test": { - "id": "cdk-integ-opensearch-vpc-test", - "path": "cdk-integ-opensearch-vpc-test", - "children": { - "DefaultTest": { - "id": "DefaultTest", - "path": "cdk-integ-opensearch-vpc-test/DefaultTest", - "children": { - "Default": { - "id": "Default", - "path": "cdk-integ-opensearch-vpc-test/DefaultTest/Default", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.133" - } - }, - "DeployAssert": { - "id": "DeployAssert", - "path": "cdk-integ-opensearch-vpc-test/DefaultTest/DeployAssert", - "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.IntegTestCase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests.IntegTest", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.App", - "version": "0.0.0" - } - } -} \ No newline at end of file From b1fec5b67e96cdb029ebdf324cd6abe3885a675a Mon Sep 17 00:00:00 2001 From: Stijn Brouwers Date: Sat, 10 Dec 2022 14:19:01 +0100 Subject: [PATCH 5/9] bugfix(opensearch-imported-vpc): Apply small (semantic) changes --- packages/@aws-cdk/aws-opensearchservice/lib/domain.ts | 2 +- .../test/integ.opensearch.imported-vpc.ts | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/@aws-cdk/aws-opensearchservice/lib/domain.ts b/packages/@aws-cdk/aws-opensearchservice/lib/domain.ts index a34f5435b4e14..7ea759f7e82d0 100644 --- a/packages/@aws-cdk/aws-opensearchservice/lib/domain.ts +++ b/packages/@aws-cdk/aws-opensearchservice/lib/domain.ts @@ -1235,7 +1235,7 @@ export class Domain extends DomainBase implements IDomain, ec2.IConnectable { let securityGroups: ec2.ISecurityGroup[] | undefined; let subnets: ec2.ISubnet[] | undefined; - let skipZoneAwarenessCheck:boolean = false; + let skipZoneAwarenessCheck: boolean = false; if (props.vpc) { const subnetSelections = props.vpcSubnets ?? [{ subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS }]; subnets = selectSubnets(props.vpc, subnetSelections); diff --git a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts index a20f9300221c2..c121553d9df0c 100644 --- a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts +++ b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts @@ -1,9 +1,9 @@ -/// !cdk-integ * pragma:enable-lookups import * as ec2 from '@aws-cdk/aws-ec2'; import { IVpc, SubnetType } from '@aws-cdk/aws-ec2'; import { App, Stack, StackProps, RemovalPolicy, CfnResource } from '@aws-cdk/core'; import { Construct } from 'constructs'; import * as opensearch from '../lib'; +import * as integ from '@aws-cdk/integ-tests'; const appWithVpc = new App(); const stack = new Stack(appWithVpc, 'StackWithVpc', { @@ -61,5 +61,8 @@ const env = { account: process.env.CDK_INTEG_ACCOUNT || process.env.CDK_DEFAULT_ACCOUNT, region: process.env.CDK_INTEG_REGION || process.env.CDK_DEFAULT_REGION, }; -new TestStack(app, 'cdk-integ-opensearch-vpc', { env }); -app.synth(); +const testCase = new TestStack(app, 'cdk-integ-opensearch-vpc', { env }); +new integ.IntegTest(app, 'cdk-integ-opensearch-vpc-test', { + testCases: [testCase], +}); +app.synth(); \ No newline at end of file From 274cbdf34763cf03f0f45e29ccd4375f22e54f92 Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Mon, 12 Dec 2022 09:34:38 +0100 Subject: [PATCH 6/9] Apply suggestions from code review --- .../test/integ.opensearch.imported-vpc.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts index c121553d9df0c..a12ed603d49ec 100644 --- a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts +++ b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts @@ -29,11 +29,9 @@ class TestStack extends Stack { }, }); - /// !show const vpc: IVpc = ec2.Vpc.fromLookup(this, 'Vpc', { vpcName: 'my-vpc-name', }); - /// !hide const subnets = vpc.selectSubnets({ subnetType: SubnetType.PRIVATE_WITH_EGRESS }); @@ -65,4 +63,4 @@ const testCase = new TestStack(app, 'cdk-integ-opensearch-vpc', { env }); new integ.IntegTest(app, 'cdk-integ-opensearch-vpc-test', { testCases: [testCase], }); -app.synth(); \ No newline at end of file +app.synth(); From eaffe2530513145618bc569732381e1a244af48f Mon Sep 17 00:00:00 2001 From: Stijn Brouwers Date: Mon, 12 Dec 2022 11:02:17 +0100 Subject: [PATCH 7/9] bugfix(opensearchservice): Fix build warning --- .../aws-opensearchservice/test/integ.opensearch.imported-vpc.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts index a12ed603d49ec..e2d51a3e66e69 100644 --- a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts +++ b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts @@ -1,9 +1,9 @@ import * as ec2 from '@aws-cdk/aws-ec2'; import { IVpc, SubnetType } from '@aws-cdk/aws-ec2'; import { App, Stack, StackProps, RemovalPolicy, CfnResource } from '@aws-cdk/core'; +import * as integ from '@aws-cdk/integ-tests'; import { Construct } from 'constructs'; import * as opensearch from '../lib'; -import * as integ from '@aws-cdk/integ-tests'; const appWithVpc = new App(); const stack = new Stack(appWithVpc, 'StackWithVpc', { From 7fc68947996d4776929fd38dd81432e9a8307398 Mon Sep 17 00:00:00 2001 From: Stijn Brouwers Date: Mon, 12 Dec 2022 11:50:41 +0100 Subject: [PATCH 8/9] bugfix(opensearchservice): Add integ test dependency --- .../test/integ.opensearch.imported-vpc.ts | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts index e2d51a3e66e69..5128ae4a569ea 100644 --- a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts +++ b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts @@ -5,17 +5,16 @@ import * as integ from '@aws-cdk/integ-tests'; import { Construct } from 'constructs'; import * as opensearch from '../lib'; -const appWithVpc = new App(); -const stack = new Stack(appWithVpc, 'StackWithVpc', { - env: { - account: process.env.CDK_INTEG_ACCOUNT || process.env.CDK_DEFAULT_ACCOUNT, - region: process.env.CDK_INTEG_REGION || process.env.CDK_DEFAULT_REGION, - }, -}); -new ec2.Vpc(stack, 'MyVpc', { - vpcName: 'my-vpc-name', - maxAzs: 2, -}); +class VpcStack extends Stack { + constructor(scope: Construct, id: string, props?: StackProps) { + super(scope, id, props); + + new ec2.Vpc(this, 'MyVpc', { + vpcName: 'my-vpc-name', + maxAzs: 2, + }); + } +} class TestStack extends Stack { constructor(scope: Construct, id: string, props?: StackProps) { @@ -59,7 +58,9 @@ const env = { account: process.env.CDK_INTEG_ACCOUNT || process.env.CDK_DEFAULT_ACCOUNT, region: process.env.CDK_INTEG_REGION || process.env.CDK_DEFAULT_REGION, }; +const StackWithVpc = new VpcStack(app, 'stack-with-vpc', { env }); const testCase = new TestStack(app, 'cdk-integ-opensearch-vpc', { env }); +testCase.addDependency(StackWithVpc); new integ.IntegTest(app, 'cdk-integ-opensearch-vpc-test', { testCases: [testCase], }); From 4fd65e4192666d5d3dc350a4c03adfa040ab4634 Mon Sep 17 00:00:00 2001 From: Stijn Brouwers Date: Mon, 12 Dec 2022 15:25:16 +0100 Subject: [PATCH 9/9] bugfix(opensearchservice): Remove failing integ test due to no support from framework --- .../StackWithVpc.assets.json | 20 - .../StackWithVpc.template.json | 564 ----------- .../cdk-integ-opensearch-vpc.assets.json | 20 - .../cdk-integ-opensearch-vpc.template.json | 112 --- .../cdk.out | 1 - .../integ.json | 14 - .../manifest.json | 256 ----- .../tree.json | 934 ------------------ .../test/integ.opensearch.imported-vpc.ts | 67 -- 9 files changed, 1988 deletions(-) delete mode 100644 packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/StackWithVpc.assets.json delete mode 100644 packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/StackWithVpc.template.json delete mode 100644 packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/cdk-integ-opensearch-vpc.assets.json delete mode 100644 packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/cdk-integ-opensearch-vpc.template.json delete mode 100644 packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/cdk.out delete mode 100644 packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/integ.json delete mode 100644 packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/manifest.json delete mode 100644 packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/tree.json delete mode 100644 packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts diff --git a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/StackWithVpc.assets.json b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/StackWithVpc.assets.json deleted file mode 100644 index afda90036e882..0000000000000 --- a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/StackWithVpc.assets.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": "21.0.0", - "files": { - "b723f0bed9ea9a4e8d237408e0debfa443e0a646b76eeeab26215935a74297bf": { - "source": { - "path": "StackWithVpc.template.json", - "packaging": "file" - }, - "destinations": { - "12345678-test-region": { - "bucketName": "cdk-hnb659fds-assets-12345678-test-region", - "objectKey": "b723f0bed9ea9a4e8d237408e0debfa443e0a646b76eeeab26215935a74297bf.json", - "region": "test-region", - "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-test-region" - } - } - } - }, - "dockerImages": {} -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/StackWithVpc.template.json b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/StackWithVpc.template.json deleted file mode 100644 index 1ac4b082ed672..0000000000000 --- a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/StackWithVpc.template.json +++ /dev/null @@ -1,564 +0,0 @@ -{ - "Resources": { - "MyVpcF9F0CA6F": { - "Type": "AWS::EC2::VPC", - "Properties": { - "CidrBlock": "10.0.0.0/16", - "EnableDnsHostnames": true, - "EnableDnsSupport": true, - "InstanceTenancy": "default", - "Tags": [ - { - "Key": "Name", - "Value": "my-vpc-name" - } - ] - } - }, - "MyVpcPublicSubnet1SubnetF6608456": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "MyVpcF9F0CA6F" - }, - "AvailabilityZone": "test-region-1a", - "CidrBlock": "10.0.0.0/19", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "StackWithVpc/MyVpc/PublicSubnet1" - } - ] - } - }, - "MyVpcPublicSubnet1RouteTableC46AB2F4": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "MyVpcF9F0CA6F" - }, - "Tags": [ - { - "Key": "Name", - "Value": "StackWithVpc/MyVpc/PublicSubnet1" - } - ] - } - }, - "MyVpcPublicSubnet1RouteTableAssociation2ECEE1CB": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "MyVpcPublicSubnet1RouteTableC46AB2F4" - }, - "SubnetId": { - "Ref": "MyVpcPublicSubnet1SubnetF6608456" - } - } - }, - "MyVpcPublicSubnet1DefaultRoute95FDF9EB": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "MyVpcPublicSubnet1RouteTableC46AB2F4" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "MyVpcIGW5C4A4F63" - } - }, - "DependsOn": [ - "MyVpcVPCGW488ACE0D" - ] - }, - "MyVpcPublicSubnet1EIP096967CB": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "StackWithVpc/MyVpc/PublicSubnet1" - } - ] - } - }, - "MyVpcPublicSubnet1NATGatewayAD3400C1": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "MyVpcPublicSubnet1SubnetF6608456" - }, - "AllocationId": { - "Fn::GetAtt": [ - "MyVpcPublicSubnet1EIP096967CB", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "StackWithVpc/MyVpc/PublicSubnet1" - } - ] - }, - "DependsOn": [ - "MyVpcPublicSubnet1DefaultRoute95FDF9EB", - "MyVpcPublicSubnet1RouteTableAssociation2ECEE1CB" - ] - }, - "MyVpcPublicSubnet2Subnet492B6BFB": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "MyVpcF9F0CA6F" - }, - "AvailabilityZone": "test-region-1b", - "CidrBlock": "10.0.32.0/19", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "StackWithVpc/MyVpc/PublicSubnet2" - } - ] - } - }, - "MyVpcPublicSubnet2RouteTable1DF17386": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "MyVpcF9F0CA6F" - }, - "Tags": [ - { - "Key": "Name", - "Value": "StackWithVpc/MyVpc/PublicSubnet2" - } - ] - } - }, - "MyVpcPublicSubnet2RouteTableAssociation227DE78D": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "MyVpcPublicSubnet2RouteTable1DF17386" - }, - "SubnetId": { - "Ref": "MyVpcPublicSubnet2Subnet492B6BFB" - } - } - }, - "MyVpcPublicSubnet2DefaultRoute052936F6": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "MyVpcPublicSubnet2RouteTable1DF17386" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "MyVpcIGW5C4A4F63" - } - }, - "DependsOn": [ - "MyVpcVPCGW488ACE0D" - ] - }, - "MyVpcPublicSubnet2EIP8CCBA239": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "StackWithVpc/MyVpc/PublicSubnet2" - } - ] - } - }, - "MyVpcPublicSubnet2NATGateway91BFBEC9": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "MyVpcPublicSubnet2Subnet492B6BFB" - }, - "AllocationId": { - "Fn::GetAtt": [ - "MyVpcPublicSubnet2EIP8CCBA239", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "StackWithVpc/MyVpc/PublicSubnet2" - } - ] - }, - "DependsOn": [ - "MyVpcPublicSubnet2DefaultRoute052936F6", - "MyVpcPublicSubnet2RouteTableAssociation227DE78D" - ] - }, - "MyVpcPublicSubnet3Subnet57EEE236": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "MyVpcF9F0CA6F" - }, - "AvailabilityZone": "test-region-1c", - "CidrBlock": "10.0.64.0/19", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "StackWithVpc/MyVpc/PublicSubnet3" - } - ] - } - }, - "MyVpcPublicSubnet3RouteTable15028F08": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "MyVpcF9F0CA6F" - }, - "Tags": [ - { - "Key": "Name", - "Value": "StackWithVpc/MyVpc/PublicSubnet3" - } - ] - } - }, - "MyVpcPublicSubnet3RouteTableAssociation5C27DDA4": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "MyVpcPublicSubnet3RouteTable15028F08" - }, - "SubnetId": { - "Ref": "MyVpcPublicSubnet3Subnet57EEE236" - } - } - }, - "MyVpcPublicSubnet3DefaultRoute3A83AB36": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "MyVpcPublicSubnet3RouteTable15028F08" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "MyVpcIGW5C4A4F63" - } - }, - "DependsOn": [ - "MyVpcVPCGW488ACE0D" - ] - }, - "MyVpcPublicSubnet3EIPC5ACADAB": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "StackWithVpc/MyVpc/PublicSubnet3" - } - ] - } - }, - "MyVpcPublicSubnet3NATGatewayD4B50EBE": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "SubnetId": { - "Ref": "MyVpcPublicSubnet3Subnet57EEE236" - }, - "AllocationId": { - "Fn::GetAtt": [ - "MyVpcPublicSubnet3EIPC5ACADAB", - "AllocationId" - ] - }, - "Tags": [ - { - "Key": "Name", - "Value": "StackWithVpc/MyVpc/PublicSubnet3" - } - ] - }, - "DependsOn": [ - "MyVpcPublicSubnet3DefaultRoute3A83AB36", - "MyVpcPublicSubnet3RouteTableAssociation5C27DDA4" - ] - }, - "MyVpcPrivateSubnet1Subnet5057CF7E": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "MyVpcF9F0CA6F" - }, - "AvailabilityZone": "test-region-1a", - "CidrBlock": "10.0.96.0/19", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "StackWithVpc/MyVpc/PrivateSubnet1" - } - ] - } - }, - "MyVpcPrivateSubnet1RouteTable8819E6E2": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "MyVpcF9F0CA6F" - }, - "Tags": [ - { - "Key": "Name", - "Value": "StackWithVpc/MyVpc/PrivateSubnet1" - } - ] - } - }, - "MyVpcPrivateSubnet1RouteTableAssociation56D38C7E": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "MyVpcPrivateSubnet1RouteTable8819E6E2" - }, - "SubnetId": { - "Ref": "MyVpcPrivateSubnet1Subnet5057CF7E" - } - } - }, - "MyVpcPrivateSubnet1DefaultRouteA8CDE2FA": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "MyVpcPrivateSubnet1RouteTable8819E6E2" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "MyVpcPublicSubnet1NATGatewayAD3400C1" - } - } - }, - "MyVpcPrivateSubnet2Subnet0040C983": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "MyVpcF9F0CA6F" - }, - "AvailabilityZone": "test-region-1b", - "CidrBlock": "10.0.128.0/19", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "StackWithVpc/MyVpc/PrivateSubnet2" - } - ] - } - }, - "MyVpcPrivateSubnet2RouteTableCEDCEECE": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "MyVpcF9F0CA6F" - }, - "Tags": [ - { - "Key": "Name", - "Value": "StackWithVpc/MyVpc/PrivateSubnet2" - } - ] - } - }, - "MyVpcPrivateSubnet2RouteTableAssociation86A610DA": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "MyVpcPrivateSubnet2RouteTableCEDCEECE" - }, - "SubnetId": { - "Ref": "MyVpcPrivateSubnet2Subnet0040C983" - } - } - }, - "MyVpcPrivateSubnet2DefaultRoute9CE96294": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "MyVpcPrivateSubnet2RouteTableCEDCEECE" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "MyVpcPublicSubnet2NATGateway91BFBEC9" - } - } - }, - "MyVpcPrivateSubnet3Subnet772D6AD7": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "VpcId": { - "Ref": "MyVpcF9F0CA6F" - }, - "AvailabilityZone": "test-region-1c", - "CidrBlock": "10.0.160.0/19", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "StackWithVpc/MyVpc/PrivateSubnet3" - } - ] - } - }, - "MyVpcPrivateSubnet3RouteTableB790927C": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "VpcId": { - "Ref": "MyVpcF9F0CA6F" - }, - "Tags": [ - { - "Key": "Name", - "Value": "StackWithVpc/MyVpc/PrivateSubnet3" - } - ] - } - }, - "MyVpcPrivateSubnet3RouteTableAssociationD951741C": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "MyVpcPrivateSubnet3RouteTableB790927C" - }, - "SubnetId": { - "Ref": "MyVpcPrivateSubnet3Subnet772D6AD7" - } - } - }, - "MyVpcPrivateSubnet3DefaultRouteEC11C0C5": { - "Type": "AWS::EC2::Route", - "Properties": { - "RouteTableId": { - "Ref": "MyVpcPrivateSubnet3RouteTableB790927C" - }, - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "MyVpcPublicSubnet3NATGatewayD4B50EBE" - } - } - }, - "MyVpcIGW5C4A4F63": { - "Type": "AWS::EC2::InternetGateway", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "my-vpc-name" - } - ] - } - }, - "MyVpcVPCGW488ACE0D": { - "Type": "AWS::EC2::VPCGatewayAttachment", - "Properties": { - "VpcId": { - "Ref": "MyVpcF9F0CA6F" - }, - "InternetGatewayId": { - "Ref": "MyVpcIGW5C4A4F63" - } - } - } - }, - "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-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/cdk-integ-opensearch-vpc.assets.json b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/cdk-integ-opensearch-vpc.assets.json deleted file mode 100644 index 121f0e168d8ef..0000000000000 --- a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/cdk-integ-opensearch-vpc.assets.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": "21.0.0", - "files": { - "b67c23b91e2fccabfce42e91364a04393a2d67e1f52b2b2a2b9a006fd9394539": { - "source": { - "path": "cdk-integ-opensearch-vpc.template.json", - "packaging": "file" - }, - "destinations": { - "12345678-test-region": { - "bucketName": "cdk-hnb659fds-assets-12345678-test-region", - "objectKey": "b67c23b91e2fccabfce42e91364a04393a2d67e1f52b2b2a2b9a006fd9394539.json", - "region": "test-region", - "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-file-publishing-role-12345678-test-region" - } - } - } - }, - "dockerImages": {} -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/cdk-integ-opensearch-vpc.template.json b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/cdk-integ-opensearch-vpc.template.json deleted file mode 100644 index d4b991891ab26..0000000000000 --- a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/cdk-integ-opensearch-vpc.template.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "Resources": { - "ServiceLinkedRole": { - "Type": "AWS::IAM::ServiceLinkedRole", - "Properties": { - "AWSServiceName": "opensearchservice.amazonaws.com", - "Description": "Role for OpenSearch VPC Test" - } - }, - "DomainSecurityGroup48AA5FD6": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "Security group for domain Domain", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "VpcId": "vpc-12345" - }, - "DependsOn": [ - "ServiceLinkedRole" - ] - }, - "Domain66AC69E0": { - "Type": "AWS::OpenSearchService::Domain", - "Properties": { - "ClusterConfig": { - "DedicatedMasterEnabled": false, - "InstanceCount": 2, - "InstanceType": "r5.large.search", - "ZoneAwarenessConfig": { - "AvailabilityZoneCount": 3 - }, - "ZoneAwarenessEnabled": true - }, - "DomainEndpointOptions": { - "EnforceHTTPS": false, - "TLSSecurityPolicy": "Policy-Min-TLS-1-0-2019-07" - }, - "EBSOptions": { - "EBSEnabled": true, - "VolumeSize": 10, - "VolumeType": "gp2" - }, - "EncryptionAtRestOptions": { - "Enabled": false - }, - "EngineVersion": "Elasticsearch_7.1", - "LogPublishingOptions": {}, - "NodeToNodeEncryptionOptions": { - "Enabled": false - }, - "VPCOptions": { - "SecurityGroupIds": [ - { - "Fn::GetAtt": [ - "DomainSecurityGroup48AA5FD6", - "GroupId" - ] - } - ], - "SubnetIds": [ - "p-12345", - "p-67890" - ] - } - }, - "DependsOn": [ - "ServiceLinkedRole" - ], - "UpdateReplacePolicy": "Delete", - "DeletionPolicy": "Delete" - } - }, - "Parameters": { - "BootstrapVersion": { - "Type": "AWS::SSM::Parameter::Value", - "Default": "/cdk-bootstrap/hnb659fds/version", - "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" - } - }, - "Rules": { - "CheckBootstrapVersion": { - "Assertions": [ - { - "Assert": { - "Fn::Not": [ - { - "Fn::Contains": [ - [ - "1", - "2", - "3", - "4", - "5" - ], - { - "Ref": "BootstrapVersion" - } - ] - } - ] - }, - "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." - } - ] - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/cdk.out b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/cdk.out deleted file mode 100644 index 8ecc185e9dbee..0000000000000 --- a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/cdk.out +++ /dev/null @@ -1 +0,0 @@ -{"version":"21.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/integ.json b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/integ.json deleted file mode 100644 index 791dd91036794..0000000000000 --- a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/integ.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "version": "21.0.0", - "testCases": { - "integ.opensearch.imported-vpc": { - "stacks": [ - "*" - ], - "diffAssets": false, - "stackUpdateWorkflow": true - } - }, - "synthContext": {}, - "enableLookups": true -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/manifest.json b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/manifest.json deleted file mode 100644 index 449331d261e48..0000000000000 --- a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/manifest.json +++ /dev/null @@ -1,256 +0,0 @@ -{ - "version": "21.0.0", - "artifacts": { - "StackWithVpc.assets": { - "type": "cdk:asset-manifest", - "properties": { - "file": "StackWithVpc.assets.json", - "requiresBootstrapStackVersion": 6, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" - } - }, - "StackWithVpc": { - "type": "aws:cloudformation:stack", - "environment": "aws://12345678/test-region", - "properties": { - "templateFile": "StackWithVpc.template.json", - "validateOnSynth": false, - "assumeRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-deploy-role-12345678-test-region", - "cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-cfn-exec-role-12345678-test-region", - "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-12345678-test-region/b723f0bed9ea9a4e8d237408e0debfa443e0a646b76eeeab26215935a74297bf.json", - "requiresBootstrapStackVersion": 6, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", - "additionalDependencies": [ - "StackWithVpc.assets" - ], - "lookupRole": { - "arn": "arn:${AWS::Partition}:iam::12345678:role/cdk-hnb659fds-lookup-role-12345678-test-region", - "requiresBootstrapStackVersion": 8, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" - } - }, - "dependencies": [ - "StackWithVpc.assets" - ], - "metadata": { - "/StackWithVpc/MyVpc/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcF9F0CA6F" - } - ], - "/StackWithVpc/MyVpc/PublicSubnet1/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPublicSubnet1SubnetF6608456" - } - ], - "/StackWithVpc/MyVpc/PublicSubnet1/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPublicSubnet1RouteTableC46AB2F4" - } - ], - "/StackWithVpc/MyVpc/PublicSubnet1/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPublicSubnet1RouteTableAssociation2ECEE1CB" - } - ], - "/StackWithVpc/MyVpc/PublicSubnet1/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPublicSubnet1DefaultRoute95FDF9EB" - } - ], - "/StackWithVpc/MyVpc/PublicSubnet1/EIP": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPublicSubnet1EIP096967CB" - } - ], - "/StackWithVpc/MyVpc/PublicSubnet1/NATGateway": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPublicSubnet1NATGatewayAD3400C1" - } - ], - "/StackWithVpc/MyVpc/PublicSubnet2/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPublicSubnet2Subnet492B6BFB" - } - ], - "/StackWithVpc/MyVpc/PublicSubnet2/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPublicSubnet2RouteTable1DF17386" - } - ], - "/StackWithVpc/MyVpc/PublicSubnet2/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPublicSubnet2RouteTableAssociation227DE78D" - } - ], - "/StackWithVpc/MyVpc/PublicSubnet2/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPublicSubnet2DefaultRoute052936F6" - } - ], - "/StackWithVpc/MyVpc/PublicSubnet2/EIP": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPublicSubnet2EIP8CCBA239" - } - ], - "/StackWithVpc/MyVpc/PublicSubnet2/NATGateway": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPublicSubnet2NATGateway91BFBEC9" - } - ], - "/StackWithVpc/MyVpc/PublicSubnet3/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPublicSubnet3Subnet57EEE236" - } - ], - "/StackWithVpc/MyVpc/PublicSubnet3/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPublicSubnet3RouteTable15028F08" - } - ], - "/StackWithVpc/MyVpc/PublicSubnet3/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPublicSubnet3RouteTableAssociation5C27DDA4" - } - ], - "/StackWithVpc/MyVpc/PublicSubnet3/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPublicSubnet3DefaultRoute3A83AB36" - } - ], - "/StackWithVpc/MyVpc/PublicSubnet3/EIP": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPublicSubnet3EIPC5ACADAB" - } - ], - "/StackWithVpc/MyVpc/PublicSubnet3/NATGateway": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPublicSubnet3NATGatewayD4B50EBE" - } - ], - "/StackWithVpc/MyVpc/PrivateSubnet1/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPrivateSubnet1Subnet5057CF7E" - } - ], - "/StackWithVpc/MyVpc/PrivateSubnet1/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPrivateSubnet1RouteTable8819E6E2" - } - ], - "/StackWithVpc/MyVpc/PrivateSubnet1/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPrivateSubnet1RouteTableAssociation56D38C7E" - } - ], - "/StackWithVpc/MyVpc/PrivateSubnet1/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPrivateSubnet1DefaultRouteA8CDE2FA" - } - ], - "/StackWithVpc/MyVpc/PrivateSubnet2/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPrivateSubnet2Subnet0040C983" - } - ], - "/StackWithVpc/MyVpc/PrivateSubnet2/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPrivateSubnet2RouteTableCEDCEECE" - } - ], - "/StackWithVpc/MyVpc/PrivateSubnet2/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPrivateSubnet2RouteTableAssociation86A610DA" - } - ], - "/StackWithVpc/MyVpc/PrivateSubnet2/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPrivateSubnet2DefaultRoute9CE96294" - } - ], - "/StackWithVpc/MyVpc/PrivateSubnet3/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPrivateSubnet3Subnet772D6AD7" - } - ], - "/StackWithVpc/MyVpc/PrivateSubnet3/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPrivateSubnet3RouteTableB790927C" - } - ], - "/StackWithVpc/MyVpc/PrivateSubnet3/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPrivateSubnet3RouteTableAssociationD951741C" - } - ], - "/StackWithVpc/MyVpc/PrivateSubnet3/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcPrivateSubnet3DefaultRouteEC11C0C5" - } - ], - "/StackWithVpc/MyVpc/IGW": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcIGW5C4A4F63" - } - ], - "/StackWithVpc/MyVpc/VPCGW": [ - { - "type": "aws:cdk:logicalId", - "data": "MyVpcVPCGW488ACE0D" - } - ], - "/StackWithVpc/BootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "BootstrapVersion" - } - ], - "/StackWithVpc/CheckBootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "CheckBootstrapVersion" - } - ] - }, - "displayName": "StackWithVpc" - }, - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/tree.json b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/tree.json deleted file mode 100644 index 4ed6a4f074c9b..0000000000000 --- a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.js.snapshot/tree.json +++ /dev/null @@ -1,934 +0,0 @@ -{ - "version": "tree-0.1", - "tree": { - "id": "App", - "path": "", - "children": { - "StackWithVpc": { - "id": "StackWithVpc", - "path": "StackWithVpc", - "children": { - "MyVpc": { - "id": "MyVpc", - "path": "StackWithVpc/MyVpc", - "children": { - "Resource": { - "id": "Resource", - "path": "StackWithVpc/MyVpc/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": "my-vpc-name" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnVPC", - "version": "0.0.0" - } - }, - "PublicSubnet1": { - "id": "PublicSubnet1", - "path": "StackWithVpc/MyVpc/PublicSubnet1", - "children": { - "Subnet": { - "id": "Subnet", - "path": "StackWithVpc/MyVpc/PublicSubnet1/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "MyVpcF9F0CA6F" - }, - "availabilityZone": "test-region-1a", - "cidrBlock": "10.0.0.0/19", - "mapPublicIpOnLaunch": true, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Public" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Public" - }, - { - "key": "Name", - "value": "StackWithVpc/MyVpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "StackWithVpc/MyVpc/PublicSubnet1/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "StackWithVpc/MyVpc/PublicSubnet1/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "MyVpcF9F0CA6F" - }, - "tags": [ - { - "key": "Name", - "value": "StackWithVpc/MyVpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "StackWithVpc/MyVpc/PublicSubnet1/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "MyVpcPublicSubnet1RouteTableC46AB2F4" - }, - "subnetId": { - "Ref": "MyVpcPublicSubnet1SubnetF6608456" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "StackWithVpc/MyVpc/PublicSubnet1/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "MyVpcPublicSubnet1RouteTableC46AB2F4" - }, - "destinationCidrBlock": "0.0.0.0/0", - "gatewayId": { - "Ref": "MyVpcIGW5C4A4F63" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - }, - "EIP": { - "id": "EIP", - "path": "StackWithVpc/MyVpc/PublicSubnet1/EIP", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::EIP", - "aws:cdk:cloudformation:props": { - "domain": "vpc", - "tags": [ - { - "key": "Name", - "value": "StackWithVpc/MyVpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnEIP", - "version": "0.0.0" - } - }, - "NATGateway": { - "id": "NATGateway", - "path": "StackWithVpc/MyVpc/PublicSubnet1/NATGateway", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", - "aws:cdk:cloudformation:props": { - "subnetId": { - "Ref": "MyVpcPublicSubnet1SubnetF6608456" - }, - "allocationId": { - "Fn::GetAtt": [ - "MyVpcPublicSubnet1EIP096967CB", - "AllocationId" - ] - }, - "tags": [ - { - "key": "Name", - "value": "StackWithVpc/MyVpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnNatGateway", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PublicSubnet", - "version": "0.0.0" - } - }, - "PublicSubnet2": { - "id": "PublicSubnet2", - "path": "StackWithVpc/MyVpc/PublicSubnet2", - "children": { - "Subnet": { - "id": "Subnet", - "path": "StackWithVpc/MyVpc/PublicSubnet2/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "MyVpcF9F0CA6F" - }, - "availabilityZone": "test-region-1b", - "cidrBlock": "10.0.32.0/19", - "mapPublicIpOnLaunch": true, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Public" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Public" - }, - { - "key": "Name", - "value": "StackWithVpc/MyVpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "StackWithVpc/MyVpc/PublicSubnet2/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "StackWithVpc/MyVpc/PublicSubnet2/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "MyVpcF9F0CA6F" - }, - "tags": [ - { - "key": "Name", - "value": "StackWithVpc/MyVpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "StackWithVpc/MyVpc/PublicSubnet2/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "MyVpcPublicSubnet2RouteTable1DF17386" - }, - "subnetId": { - "Ref": "MyVpcPublicSubnet2Subnet492B6BFB" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "StackWithVpc/MyVpc/PublicSubnet2/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "MyVpcPublicSubnet2RouteTable1DF17386" - }, - "destinationCidrBlock": "0.0.0.0/0", - "gatewayId": { - "Ref": "MyVpcIGW5C4A4F63" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - }, - "EIP": { - "id": "EIP", - "path": "StackWithVpc/MyVpc/PublicSubnet2/EIP", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::EIP", - "aws:cdk:cloudformation:props": { - "domain": "vpc", - "tags": [ - { - "key": "Name", - "value": "StackWithVpc/MyVpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnEIP", - "version": "0.0.0" - } - }, - "NATGateway": { - "id": "NATGateway", - "path": "StackWithVpc/MyVpc/PublicSubnet2/NATGateway", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", - "aws:cdk:cloudformation:props": { - "subnetId": { - "Ref": "MyVpcPublicSubnet2Subnet492B6BFB" - }, - "allocationId": { - "Fn::GetAtt": [ - "MyVpcPublicSubnet2EIP8CCBA239", - "AllocationId" - ] - }, - "tags": [ - { - "key": "Name", - "value": "StackWithVpc/MyVpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnNatGateway", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PublicSubnet", - "version": "0.0.0" - } - }, - "PublicSubnet3": { - "id": "PublicSubnet3", - "path": "StackWithVpc/MyVpc/PublicSubnet3", - "children": { - "Subnet": { - "id": "Subnet", - "path": "StackWithVpc/MyVpc/PublicSubnet3/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "MyVpcF9F0CA6F" - }, - "availabilityZone": "test-region-1c", - "cidrBlock": "10.0.64.0/19", - "mapPublicIpOnLaunch": true, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Public" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Public" - }, - { - "key": "Name", - "value": "StackWithVpc/MyVpc/PublicSubnet3" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "StackWithVpc/MyVpc/PublicSubnet3/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "StackWithVpc/MyVpc/PublicSubnet3/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "MyVpcF9F0CA6F" - }, - "tags": [ - { - "key": "Name", - "value": "StackWithVpc/MyVpc/PublicSubnet3" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "StackWithVpc/MyVpc/PublicSubnet3/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "MyVpcPublicSubnet3RouteTable15028F08" - }, - "subnetId": { - "Ref": "MyVpcPublicSubnet3Subnet57EEE236" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "StackWithVpc/MyVpc/PublicSubnet3/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "MyVpcPublicSubnet3RouteTable15028F08" - }, - "destinationCidrBlock": "0.0.0.0/0", - "gatewayId": { - "Ref": "MyVpcIGW5C4A4F63" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - }, - "EIP": { - "id": "EIP", - "path": "StackWithVpc/MyVpc/PublicSubnet3/EIP", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::EIP", - "aws:cdk:cloudformation:props": { - "domain": "vpc", - "tags": [ - { - "key": "Name", - "value": "StackWithVpc/MyVpc/PublicSubnet3" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnEIP", - "version": "0.0.0" - } - }, - "NATGateway": { - "id": "NATGateway", - "path": "StackWithVpc/MyVpc/PublicSubnet3/NATGateway", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", - "aws:cdk:cloudformation:props": { - "subnetId": { - "Ref": "MyVpcPublicSubnet3Subnet57EEE236" - }, - "allocationId": { - "Fn::GetAtt": [ - "MyVpcPublicSubnet3EIPC5ACADAB", - "AllocationId" - ] - }, - "tags": [ - { - "key": "Name", - "value": "StackWithVpc/MyVpc/PublicSubnet3" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnNatGateway", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PublicSubnet", - "version": "0.0.0" - } - }, - "PrivateSubnet1": { - "id": "PrivateSubnet1", - "path": "StackWithVpc/MyVpc/PrivateSubnet1", - "children": { - "Subnet": { - "id": "Subnet", - "path": "StackWithVpc/MyVpc/PrivateSubnet1/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "MyVpcF9F0CA6F" - }, - "availabilityZone": "test-region-1a", - "cidrBlock": "10.0.96.0/19", - "mapPublicIpOnLaunch": false, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Private" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Private" - }, - { - "key": "Name", - "value": "StackWithVpc/MyVpc/PrivateSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "StackWithVpc/MyVpc/PrivateSubnet1/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "StackWithVpc/MyVpc/PrivateSubnet1/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "MyVpcF9F0CA6F" - }, - "tags": [ - { - "key": "Name", - "value": "StackWithVpc/MyVpc/PrivateSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "StackWithVpc/MyVpc/PrivateSubnet1/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "MyVpcPrivateSubnet1RouteTable8819E6E2" - }, - "subnetId": { - "Ref": "MyVpcPrivateSubnet1Subnet5057CF7E" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "StackWithVpc/MyVpc/PrivateSubnet1/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "MyVpcPrivateSubnet1RouteTable8819E6E2" - }, - "destinationCidrBlock": "0.0.0.0/0", - "natGatewayId": { - "Ref": "MyVpcPublicSubnet1NATGatewayAD3400C1" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", - "version": "0.0.0" - } - }, - "PrivateSubnet2": { - "id": "PrivateSubnet2", - "path": "StackWithVpc/MyVpc/PrivateSubnet2", - "children": { - "Subnet": { - "id": "Subnet", - "path": "StackWithVpc/MyVpc/PrivateSubnet2/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "MyVpcF9F0CA6F" - }, - "availabilityZone": "test-region-1b", - "cidrBlock": "10.0.128.0/19", - "mapPublicIpOnLaunch": false, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Private" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Private" - }, - { - "key": "Name", - "value": "StackWithVpc/MyVpc/PrivateSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "StackWithVpc/MyVpc/PrivateSubnet2/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "StackWithVpc/MyVpc/PrivateSubnet2/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "MyVpcF9F0CA6F" - }, - "tags": [ - { - "key": "Name", - "value": "StackWithVpc/MyVpc/PrivateSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "StackWithVpc/MyVpc/PrivateSubnet2/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "MyVpcPrivateSubnet2RouteTableCEDCEECE" - }, - "subnetId": { - "Ref": "MyVpcPrivateSubnet2Subnet0040C983" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "StackWithVpc/MyVpc/PrivateSubnet2/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "MyVpcPrivateSubnet2RouteTableCEDCEECE" - }, - "destinationCidrBlock": "0.0.0.0/0", - "natGatewayId": { - "Ref": "MyVpcPublicSubnet2NATGateway91BFBEC9" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", - "version": "0.0.0" - } - }, - "PrivateSubnet3": { - "id": "PrivateSubnet3", - "path": "StackWithVpc/MyVpc/PrivateSubnet3", - "children": { - "Subnet": { - "id": "Subnet", - "path": "StackWithVpc/MyVpc/PrivateSubnet3/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "MyVpcF9F0CA6F" - }, - "availabilityZone": "test-region-1c", - "cidrBlock": "10.0.160.0/19", - "mapPublicIpOnLaunch": false, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Private" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Private" - }, - { - "key": "Name", - "value": "StackWithVpc/MyVpc/PrivateSubnet3" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "StackWithVpc/MyVpc/PrivateSubnet3/Acl", - "constructInfo": { - "fqn": "@aws-cdk/core.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "StackWithVpc/MyVpc/PrivateSubnet3/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "MyVpcF9F0CA6F" - }, - "tags": [ - { - "key": "Name", - "value": "StackWithVpc/MyVpc/PrivateSubnet3" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "StackWithVpc/MyVpc/PrivateSubnet3/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "MyVpcPrivateSubnet3RouteTableB790927C" - }, - "subnetId": { - "Ref": "MyVpcPrivateSubnet3Subnet772D6AD7" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "StackWithVpc/MyVpc/PrivateSubnet3/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "MyVpcPrivateSubnet3RouteTableB790927C" - }, - "destinationCidrBlock": "0.0.0.0/0", - "natGatewayId": { - "Ref": "MyVpcPublicSubnet3NATGatewayD4B50EBE" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnRoute", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.PrivateSubnet", - "version": "0.0.0" - } - }, - "IGW": { - "id": "IGW", - "path": "StackWithVpc/MyVpc/IGW", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", - "aws:cdk:cloudformation:props": { - "tags": [ - { - "key": "Name", - "value": "my-vpc-name" - } - ] - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnInternetGateway", - "version": "0.0.0" - } - }, - "VPCGW": { - "id": "VPCGW", - "path": "StackWithVpc/MyVpc/VPCGW", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", - "aws:cdk:cloudformation:props": { - "vpcId": { - "Ref": "MyVpcF9F0CA6F" - }, - "internetGatewayId": { - "Ref": "MyVpcIGW5C4A4F63" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnVPCGatewayAttachment", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.Vpc", - "version": "0.0.0" - } - }, - "BootstrapVersion": { - "id": "BootstrapVersion", - "path": "StackWithVpc/BootstrapVersion", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnParameter", - "version": "0.0.0" - } - }, - "CheckBootstrapVersion": { - "id": "CheckBootstrapVersion", - "path": "StackWithVpc/CheckBootstrapVersion", - "constructInfo": { - "fqn": "@aws-cdk/core.CfnRule", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.Stack", - "version": "0.0.0" - } - }, - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.1.154" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/core.App", - "version": "0.0.0" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts b/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts deleted file mode 100644 index 5128ae4a569ea..0000000000000 --- a/packages/@aws-cdk/aws-opensearchservice/test/integ.opensearch.imported-vpc.ts +++ /dev/null @@ -1,67 +0,0 @@ -import * as ec2 from '@aws-cdk/aws-ec2'; -import { IVpc, SubnetType } from '@aws-cdk/aws-ec2'; -import { App, Stack, StackProps, RemovalPolicy, CfnResource } from '@aws-cdk/core'; -import * as integ from '@aws-cdk/integ-tests'; -import { Construct } from 'constructs'; -import * as opensearch from '../lib'; - -class VpcStack extends Stack { - constructor(scope: Construct, id: string, props?: StackProps) { - super(scope, id, props); - - new ec2.Vpc(this, 'MyVpc', { - vpcName: 'my-vpc-name', - maxAzs: 2, - }); - } -} - -class TestStack extends Stack { - constructor(scope: Construct, id: string, props?: StackProps) { - super(scope, id, props); - - const serviceLinkedRole = new CfnResource(this, 'ServiceLinkedRole', { - type: 'AWS::IAM::ServiceLinkedRole', - properties: { - AWSServiceName: 'opensearchservice.amazonaws.com', - Description: 'Role for OpenSearch VPC Test', - }, - }); - - const vpc: IVpc = ec2.Vpc.fromLookup(this, 'Vpc', { - vpcName: 'my-vpc-name', - }); - - const subnets = vpc.selectSubnets({ subnetType: SubnetType.PRIVATE_WITH_EGRESS }); - - const domainProps: opensearch.DomainProps = { - version: opensearch.EngineVersion.ELASTICSEARCH_7_1, - removalPolicy: RemovalPolicy.DESTROY, - vpc: vpc, - vpcSubnets: [subnets], - zoneAwareness: { - enabled: true, - availabilityZoneCount: 3, - }, - capacity: { - dataNodes: 2, - }, - }; - - const domain = new opensearch.Domain(this, 'Domain', domainProps); - domain.node.addDependency(serviceLinkedRole); - } -} - -const app = new App(); -const env = { - account: process.env.CDK_INTEG_ACCOUNT || process.env.CDK_DEFAULT_ACCOUNT, - region: process.env.CDK_INTEG_REGION || process.env.CDK_DEFAULT_REGION, -}; -const StackWithVpc = new VpcStack(app, 'stack-with-vpc', { env }); -const testCase = new TestStack(app, 'cdk-integ-opensearch-vpc', { env }); -testCase.addDependency(StackWithVpc); -new integ.IntegTest(app, 'cdk-integ-opensearch-vpc-test', { - testCases: [testCase], -}); -app.synth();