From 69e221ab5e2fcf564283f337ab8111196608520e Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Tue, 14 Jul 2020 14:07:09 +0300 Subject: [PATCH] chore: test changes - implicit app for root stacks Add an implicit "App" construct for root stacks --- .../aws-apigateway/test/test.vpc-link.ts | 2 +- .../aws-appmesh/test/test.virtual-node.ts | 2 +- .../test/auto-scaling-group.test.ts | 10 +++--- .../test/scheduled-action.test.ts | 2 +- .../@aws-cdk/aws-backup/test/vault.test.ts | 2 +- .../test/compute-environment.test.ts | 4 +-- .../aws-cloudformation/test/test.deps.ts | 6 ++-- .../test/test.nested-stack.ts | 4 +-- .../aws-codecommit/test/test.codecommit.ts | 2 +- .../test/profiling-group.test.ts | 7 ++-- .../aws-cognito/test/user-pool.test.ts | 4 +-- .../@aws-cdk/aws-docdb/test/cluster.test.ts | 4 +-- .../aws-dynamodb/test/dynamodb.test.ts | 10 +++--- .../@aws-cdk/aws-ec2/test/connections.test.ts | 4 +-- packages/@aws-cdk/aws-ec2/test/volume.test.ts | 32 +++++++++---------- .../aws-ec2/test/vpc-endpoint.test.ts | 2 +- packages/@aws-cdk/aws-ec2/test/vpc.test.ts | 6 ++-- .../aws-ecs-patterns/test/ec2/test.l3s-v2.ts | 10 +++--- .../ec2/test.queue-processing-ecs-service.ts | 4 +-- .../test.load-balanced-fargate-service-v2.ts | 8 ++--- .../test.queue-processing-fargate-service.ts | 4 +-- .../test/ec2/test.ec2-task-definition.ts | 18 +++++------ .../test/fargate/test.fargate-service.ts | 6 ++-- .../fargate/test.fargate-task-definition.ts | 2 +- .../@aws-cdk/aws-ecs/test/test.ecs-cluster.ts | 32 +++++++++---------- .../@aws-cdk/aws-eks/test/test.fargate.ts | 2 +- .../@aws-cdk/aws-eks/test/test.k8s-patch.ts | 2 +- .../test/batch/batch.test.ts | 2 +- .../aws-events/test/test.event-bus.ts | 2 +- .../@aws-cdk/aws-kinesis/test/stream.test.ts | 8 ++--- .../aws-lambda-event-sources/test/test.api.ts | 20 ++++++------ .../test/test.dynamo.ts | 2 +- .../aws-s3-notifications/test/queue.test.ts | 2 +- packages/@aws-cdk/aws-s3/test/test.bucket.ts | 11 +++++-- .../test/test.secret-rotation.ts | 10 +++--- .../test/test.instance.ts | 12 +++---- .../aws-sns-subscriptions/test/subs.test.ts | 12 +++---- .../aws-stepfunctions/test/activity.test.ts | 2 +- 38 files changed, 140 insertions(+), 134 deletions(-) diff --git a/packages/@aws-cdk/aws-apigateway/test/test.vpc-link.ts b/packages/@aws-cdk/aws-apigateway/test/test.vpc-link.ts index 331889ffbdf1e..b619f1fdd4030 100644 --- a/packages/@aws-cdk/aws-apigateway/test/test.vpc-link.ts +++ b/packages/@aws-cdk/aws-apigateway/test/test.vpc-link.ts @@ -47,7 +47,7 @@ export = { // THEN expect(stack).to(haveResourceLike('AWS::ApiGateway::VpcLink', { - Name: 'VpcLink', + Name: 'StackVpcLink0E48D8A7', TargetArns: [ { Ref: 'NLB03D178991' }, { Ref: 'NLB13224D47C' }, diff --git a/packages/@aws-cdk/aws-appmesh/test/test.virtual-node.ts b/packages/@aws-cdk/aws-appmesh/test/test.virtual-node.ts index 82589e2c52ac5..57f86fbb900f3 100644 --- a/packages/@aws-cdk/aws-appmesh/test/test.virtual-node.ts +++ b/packages/@aws-cdk/aws-appmesh/test/test.virtual-node.ts @@ -148,7 +148,7 @@ export = { }, }, }, - VirtualNodeName: 'meshtestnode428A9479', + VirtualNodeName: 'StackmeshtestnodeF42773EB', }), ); diff --git a/packages/@aws-cdk/aws-autoscaling/test/auto-scaling-group.test.ts b/packages/@aws-cdk/aws-autoscaling/test/auto-scaling-group.test.ts index a9056ffc710a6..7320a99f3d0bb 100644 --- a/packages/@aws-cdk/aws-autoscaling/test/auto-scaling-group.test.ts +++ b/packages/@aws-cdk/aws-autoscaling/test/auto-scaling-group.test.ts @@ -32,7 +32,7 @@ nodeunitShim({ 'MyFleetInstanceSecurityGroup774E8234': { 'Type': 'AWS::EC2::SecurityGroup', 'Properties': { - 'GroupDescription': 'MyFleet/InstanceSecurityGroup', + 'GroupDescription': 'TestStack/MyFleet/InstanceSecurityGroup', 'SecurityGroupEgress': [ { 'CidrIp': '0.0.0.0/0', @@ -43,7 +43,7 @@ nodeunitShim({ 'Tags': [ { 'Key': 'Name', - 'Value': 'MyFleet', + 'Value': 'TestStack/MyFleet', }, ], @@ -68,7 +68,7 @@ nodeunitShim({ 'Tags': [ { 'Key': 'Name', - 'Value': 'MyFleet', + 'Value': 'TestStack/MyFleet', }, ], }, @@ -122,7 +122,7 @@ nodeunitShim({ { 'Key': 'Name', 'PropagateAtLaunch': true, - 'Value': 'MyFleet', + 'Value': 'TestStack/MyFleet', }, ], @@ -521,7 +521,7 @@ nodeunitShim({ { Key: 'Name', PropagateAtLaunch: true, - Value: 'MyFleet', + Value: 'TestStack/MyFleet', }, { Key: 'notsuper', diff --git a/packages/@aws-cdk/aws-autoscaling/test/scheduled-action.test.ts b/packages/@aws-cdk/aws-autoscaling/test/scheduled-action.test.ts index b732b7d5373b4..1c14701d2ef81 100644 --- a/packages/@aws-cdk/aws-autoscaling/test/scheduled-action.test.ts +++ b/packages/@aws-cdk/aws-autoscaling/test/scheduled-action.test.ts @@ -70,7 +70,7 @@ nodeunitShim({ { Key: 'Name', PropagateAtLaunch: true, - Value: 'ASG', + Value: 'Stack/ASG', }, ], VPCZoneIdentifier: [ diff --git a/packages/@aws-cdk/aws-backup/test/vault.test.ts b/packages/@aws-cdk/aws-backup/test/vault.test.ts index dd1800c5b831e..1ff956b255567 100644 --- a/packages/@aws-cdk/aws-backup/test/vault.test.ts +++ b/packages/@aws-cdk/aws-backup/test/vault.test.ts @@ -16,7 +16,7 @@ test('create a vault', () => { // THEN expect(stack).toHaveResource('AWS::Backup::BackupVault', { - BackupVaultName: 'Vault', + BackupVaultName: 'StackVault02F737C4', }); }); diff --git a/packages/@aws-cdk/aws-batch/test/compute-environment.test.ts b/packages/@aws-cdk/aws-batch/test/compute-environment.test.ts index 36258615fbf8e..e577b5ade7761 100644 --- a/packages/@aws-cdk/aws-batch/test/compute-environment.test.ts +++ b/packages/@aws-cdk/aws-batch/test/compute-environment.test.ts @@ -237,10 +237,10 @@ describe('Batch Compute Evironment', () => { ], Subnets: [ { - Ref: `${vpc.node.uniqueId}PrivateSubnet1Subnet865FB50A`, + Ref: 'testvpcPrivateSubnet1Subnet865FB50A', }, { - Ref: `${vpc.node.uniqueId}PrivateSubnet2Subnet23D3396F`, + Ref: 'testvpcPrivateSubnet2Subnet23D3396F', }, ], Tags: { diff --git a/packages/@aws-cdk/aws-cloudformation/test/test.deps.ts b/packages/@aws-cdk/aws-cloudformation/test/test.deps.ts index ed87cf1f6c3b3..57f59bbb729b4 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/test.deps.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/test.deps.ts @@ -209,9 +209,9 @@ export = { const nested2 = new NestedStack(nested1, 'Nested2'); // THEN - test.throws(() => nested1.addDependency(root), /Nested stack 'Nested1' cannot depend on a parent stack ''/); - test.throws(() => nested2.addDependency(nested1), /Nested stack 'Nested1\/Nested2' cannot depend on a parent stack 'Nested1'/); - test.throws(() => nested2.addDependency(root), /Nested stack 'Nested1\/Nested2' cannot depend on a parent stack ''/); + test.throws(() => nested1.addDependency(root), /Nested stack 'Stack\/Nested1' cannot depend on a parent stack 'Stack'/); + test.throws(() => nested2.addDependency(nested1), /Nested stack 'Stack\/Nested1\/Nested2' cannot depend on a parent stack 'Stack\/Nested1'/); + test.throws(() => nested2.addDependency(root), /Nested stack 'Stack\/Nested1\/Nested2' cannot depend on a parent stack 'Stack'/); test.done(); }, diff --git a/packages/@aws-cdk/aws-cloudformation/test/test.nested-stack.ts b/packages/@aws-cdk/aws-cloudformation/test/test.nested-stack.ts index bd299efa95cbf..5963661e4316e 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/test.nested-stack.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/test.nested-stack.ts @@ -886,7 +886,7 @@ export = { }, }, Outputs: { - nestedresourceinnested59B1F01CConsumedAttribute: { + StacknestedresourceinnestedE8C78B2EConsumedAttribute: { Value: { 'Fn::GetAtt': [ 'resourceinnested', @@ -900,7 +900,7 @@ export = { ConsumedAttribute: { 'Fn::GetAtt': [ 'nestedNestedStacknestedNestedStackResource3DD143BF', - 'Outputs.nestedresourceinnested59B1F01CConsumedAttribute', + 'Outputs.StacknestedresourceinnestedE8C78B2EConsumedAttribute', ], }, })); diff --git a/packages/@aws-cdk/aws-codecommit/test/test.codecommit.ts b/packages/@aws-cdk/aws-codecommit/test/test.codecommit.ts index bd7a6ac54ec0c..b7a86eaaa9769 100644 --- a/packages/@aws-cdk/aws-codecommit/test/test.codecommit.ts +++ b/packages/@aws-cdk/aws-codecommit/test/test.codecommit.ts @@ -29,7 +29,7 @@ export = { 'all', ], DestinationArn: 'arn:aws:sns:*:123456789012:my_topic', - Name: 'MyRepository/arn:aws:sns:*:123456789012:my_topic', + Name: 'Stack/MyRepository/arn:aws:sns:*:123456789012:my_topic', }, ], }, diff --git a/packages/@aws-cdk/aws-codeguruprofiler/test/profiling-group.test.ts b/packages/@aws-cdk/aws-codeguruprofiler/test/profiling-group.test.ts index 8b26f916d26f1..d4e068a906f3a 100644 --- a/packages/@aws-cdk/aws-codeguruprofiler/test/profiling-group.test.ts +++ b/packages/@aws-cdk/aws-codeguruprofiler/test/profiling-group.test.ts @@ -190,15 +190,14 @@ describe('profiling group', () => { test('default profiling group without name', () => { const stack = new Stack(); - new ProfilingGroup(stack, 'MyProfilingGroup', { - }); + new ProfilingGroup(stack, 'MyProfilingGroup'); expect(stack).toMatch({ 'Resources': { 'MyProfilingGroup829F0507': { 'Type': 'AWS::CodeGuruProfiler::ProfilingGroup', 'Properties': { - 'ProfilingGroupName': 'MyProfilingGroup', + 'ProfilingGroupName': 'StackMyProfilingGroup664763A5', }, }, }, @@ -215,7 +214,7 @@ describe('profiling group', () => { 'MyProfilingGroupWithAReallyLongProfilingGroupNameThatExceedsTheLimitOfProfilingGroupNameSizeInOrderToDoSoTheNameMustBeGreaterThanTwoHundredAndFiftyFiveCharactersInSuchCasesWePickUpTheFirstOneTwentyCharactersFromTheBeginningAndTheEndAndConca4B39908C': { 'Type': 'AWS::CodeGuruProfiler::ProfilingGroup', 'Properties': { - 'ProfilingGroupName': 'MyProfilingGroupWithAReallyLongProfilingGroupNameThatExceedsTheLimitOfProfilingGroupNameSizeInOrderToDoSoTheNameMustBeGrnTwoHundredAndFiftyFiveCharactersInSuchCasesWePickUpTheFirstOneTwentyCharactersFromTheBeginningAndTheEndAndConca2FE009B0', + 'ProfilingGroupName': 'StackMyProfilingGroupWithAReallyLongProfilingGroupNameThatExceedsTheLimitOfProfilingGroupNameSizeInOrderToDoSoTheNameMuserThanTwoHundredAndFiftyFiveCharactersInSuchCasesWePickUpTheFirstOneTwentyCharactersFromTheBeginningAndTheEndAndB7D9636D', }, }, }, diff --git a/packages/@aws-cdk/aws-cognito/test/user-pool.test.ts b/packages/@aws-cdk/aws-cognito/test/user-pool.test.ts index 7693ff3c088ea..128d86cce3423 100644 --- a/packages/@aws-cdk/aws-cognito/test/user-pool.test.ts +++ b/packages/@aws-cdk/aws-cognito/test/user-pool.test.ts @@ -33,7 +33,7 @@ describe('User Pool', () => { SnsCallerArn: { 'Fn::GetAtt': [ 'PoolsmsRoleC3352CE6', 'Arn' ], }, - ExternalId: 'Pool', + ExternalId: 'StackPool7DFA52F5', }, lambdaTriggers: ABSENT, }); @@ -45,7 +45,7 @@ describe('User Pool', () => { Action: 'sts:AssumeRole', Condition: { StringEquals: { - 'sts:ExternalId': 'Pool', + 'sts:ExternalId': 'StackPool7DFA52F5', }, }, Effect: 'Allow', diff --git a/packages/@aws-cdk/aws-docdb/test/cluster.test.ts b/packages/@aws-cdk/aws-docdb/test/cluster.test.ts index 957ea0bd40a85..5ae7d24dfc77a 100644 --- a/packages/@aws-cdk/aws-docdb/test/cluster.test.ts +++ b/packages/@aws-cdk/aws-docdb/test/cluster.test.ts @@ -592,7 +592,7 @@ describe('DatabaseCluster', () => { ], ], }, - functionName: 'DatabaseRotationSingleUser458A45BE', + functionName: 'StackDatabaseRotationSingleUserF00A3AD1', vpcSubnetIds: { 'Fn::Join': [ '', @@ -710,7 +710,7 @@ describe('DatabaseCluster', () => { ], ], }, - functionName: 'DatabaseRotation0D47EBD2', + functionName: 'StackDatabaseRotation6713F62B', vpcSubnetIds: { 'Fn::Join': [ '', diff --git a/packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts b/packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts index 01ff4b73c4c95..9ef8a8017cf6a 100644 --- a/packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts +++ b/packages/@aws-cdk/aws-dynamodb/test/dynamodb.test.ts @@ -723,7 +723,7 @@ test('if an encryption key is included, encrypt/decrypt permissions are also add ], 'Version': '2012-10-17', }, - 'Description': 'Customer-managed key auto-created for encrypting DynamoDB table at Table A', + 'Description': 'Customer-managed key auto-created for encrypting DynamoDB table at Stack/Table A', 'EnableKeyRotation': true, }, 'UpdateReplacePolicy': 'Retain', @@ -1758,7 +1758,7 @@ describe('grants', () => { const user = new iam.User(stack, 'user'); // WHEN - expect(() => table.grantTableListStreams(user)).toThrow(/DynamoDB Streams must be enabled on the table my-table/); + expect(() => table.grantTableListStreams(user)).toThrow(/DynamoDB Streams must be enabled on the table Stack\/my-table/); }); test('"grantTableListStreams" allows principal to list all streams for this table', () => { @@ -1804,7 +1804,7 @@ describe('grants', () => { const user = new iam.User(stack, 'user'); // WHEN - expect(() => table.grantStreamRead(user)).toThrow(/DynamoDB Streams must be enabled on the table my-table/); + expect(() => table.grantStreamRead(user)).toThrow(/DynamoDB Streams must be enabled on the table Stack\/my-table/); }); test('"grantStreamRead" allows principal to read and describe the table stream"', () => { @@ -2268,7 +2268,7 @@ describe('global', () => { ServiceToken: { 'Fn::GetAtt': [ 'awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D', - 'Outputs.awscdkawsdynamodbReplicaProviderframeworkonEventF9504691Arn', + 'Outputs.StackawscdkawsdynamodbReplicaProviderframeworkonEvent27E7BDE8Arn', ], }, TableName: { @@ -2284,7 +2284,7 @@ describe('global', () => { ServiceToken: { 'Fn::GetAtt': [ 'awscdkawsdynamodbReplicaProviderNestedStackawscdkawsdynamodbReplicaProviderNestedStackResource18E3F12D', - 'Outputs.awscdkawsdynamodbReplicaProviderframeworkonEventF9504691Arn', + 'Outputs.StackawscdkawsdynamodbReplicaProviderframeworkonEvent27E7BDE8Arn', ], }, TableName: { diff --git a/packages/@aws-cdk/aws-ec2/test/connections.test.ts b/packages/@aws-cdk/aws-ec2/test/connections.test.ts index 294f405511de3..a8e9544f5e8ec 100644 --- a/packages/@aws-cdk/aws-ec2/test/connections.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/connections.test.ts @@ -78,7 +78,7 @@ nodeunitShim({ // THEN expect(stack).to(haveResource('AWS::EC2::SecurityGroup', { - GroupDescription: 'SecurityGroup1', + GroupDescription: 'Stack/SecurityGroup1', SecurityGroupIngress: [ { Description: 'from 0.0.0.0/0:88', @@ -91,7 +91,7 @@ nodeunitShim({ })); expect(stack).to(haveResource('AWS::EC2::SecurityGroup', { - GroupDescription: 'SecurityGroup2', + GroupDescription: 'Stack/SecurityGroup2', SecurityGroupIngress: [ { Description: 'from 0.0.0.0/0:88', diff --git a/packages/@aws-cdk/aws-ec2/test/volume.test.ts b/packages/@aws-cdk/aws-ec2/test/volume.test.ts index dbe368285fb40..65237726fdca5 100644 --- a/packages/@aws-cdk/aws-ec2/test/volume.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/volume.test.ts @@ -739,7 +739,7 @@ nodeunitShim({ ], Condition: { 'ForAnyValue:StringEquals': { - 'ec2:ResourceTag/VolumeGrantAttach-BD7A9717': 'd9a17c1c9e8ef6866e4dbeef41c741b2', + 'ec2:ResourceTag/VolumeGrantAttach-986A0A5E': '8240681c85c17071be6d87ec6e2930c7', }, }, }], @@ -748,8 +748,8 @@ nodeunitShim({ cdkExpect(stack).to(haveResourceLike('AWS::EC2::Volume', { Tags: [ { - Key: 'VolumeGrantAttach-BD7A9717', - Value: 'd9a17c1c9e8ef6866e4dbeef41c741b2', + Key: 'VolumeGrantAttach-986A0A5E', + Value: '8240681c85c17071be6d87ec6e2930c7', }, ], }, ResourcePart.Properties)); @@ -757,8 +757,8 @@ nodeunitShim({ Tags: [ {}, { - Key: 'VolumeGrantAttach-BD7A9717', - Value: 'd9a17c1c9e8ef6866e4dbeef41c741b2', + Key: 'VolumeGrantAttach-986A0A5E', + Value: '8240681c85c17071be6d87ec6e2930c7', }, ], }, ResourcePart.Properties)); @@ -816,7 +816,7 @@ nodeunitShim({ ], Condition: { 'ForAnyValue:StringEquals': { - 'ec2:ResourceTag/VolumeGrantAttach-TestSuffix': 'd9a17c1c9e8ef6866e4dbeef41c741b2', + 'ec2:ResourceTag/VolumeGrantAttach-TestSuffix': '8240681c85c17071be6d87ec6e2930c7', }, }, }], @@ -826,7 +826,7 @@ nodeunitShim({ Tags: [ { Key: 'VolumeGrantAttach-TestSuffix', - Value: 'd9a17c1c9e8ef6866e4dbeef41c741b2', + Value: '8240681c85c17071be6d87ec6e2930c7', }, ], }, ResourcePart.Properties)); @@ -835,7 +835,7 @@ nodeunitShim({ {}, { Key: 'VolumeGrantAttach-TestSuffix', - Value: 'd9a17c1c9e8ef6866e4dbeef41c741b2', + Value: '8240681c85c17071be6d87ec6e2930c7', }, ], }, ResourcePart.Properties)); @@ -1051,7 +1051,7 @@ nodeunitShim({ ], Condition: { 'ForAnyValue:StringEquals': { - 'ec2:ResourceTag/VolumeGrantDetach-BD7A9717': 'd9a17c1c9e8ef6866e4dbeef41c741b2', + 'ec2:ResourceTag/VolumeGrantDetach-986A0A5E': '8240681c85c17071be6d87ec6e2930c7', }, }, }], @@ -1060,8 +1060,8 @@ nodeunitShim({ cdkExpect(stack).to(haveResourceLike('AWS::EC2::Volume', { Tags: [ { - Key: 'VolumeGrantDetach-BD7A9717', - Value: 'd9a17c1c9e8ef6866e4dbeef41c741b2', + Key: 'VolumeGrantDetach-986A0A5E', + Value: '8240681c85c17071be6d87ec6e2930c7', }, ], }, ResourcePart.Properties)); @@ -1069,8 +1069,8 @@ nodeunitShim({ Tags: [ {}, { - Key: 'VolumeGrantDetach-BD7A9717', - Value: 'd9a17c1c9e8ef6866e4dbeef41c741b2', + Key: 'VolumeGrantDetach-986A0A5E', + Value: '8240681c85c17071be6d87ec6e2930c7', }, ], }, ResourcePart.Properties)); @@ -1128,7 +1128,7 @@ nodeunitShim({ ], Condition: { 'ForAnyValue:StringEquals': { - 'ec2:ResourceTag/VolumeGrantDetach-TestSuffix': 'd9a17c1c9e8ef6866e4dbeef41c741b2', + 'ec2:ResourceTag/VolumeGrantDetach-TestSuffix': '8240681c85c17071be6d87ec6e2930c7', }, }, }], @@ -1138,7 +1138,7 @@ nodeunitShim({ Tags: [ { Key: 'VolumeGrantDetach-TestSuffix', - Value: 'd9a17c1c9e8ef6866e4dbeef41c741b2', + Value: '8240681c85c17071be6d87ec6e2930c7', }, ], }, ResourcePart.Properties)); @@ -1147,7 +1147,7 @@ nodeunitShim({ {}, { Key: 'VolumeGrantDetach-TestSuffix', - Value: 'd9a17c1c9e8ef6866e4dbeef41c741b2', + Value: '8240681c85c17071be6d87ec6e2930c7', }, ], }, ResourcePart.Properties)); diff --git a/packages/@aws-cdk/aws-ec2/test/vpc-endpoint.test.ts b/packages/@aws-cdk/aws-ec2/test/vpc-endpoint.test.ts index b0e63a42a4874..08daf03a4f3b7 100644 --- a/packages/@aws-cdk/aws-ec2/test/vpc-endpoint.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/vpc-endpoint.test.ts @@ -260,7 +260,7 @@ nodeunitShim({ })); expect(stack).to(haveResource('AWS::EC2::SecurityGroup', { - GroupDescription: 'VpcNetwork/EcrDocker/SecurityGroup', + GroupDescription: 'Stack/VpcNetwork/EcrDocker/SecurityGroup', VpcId: { Ref: 'VpcNetworkB258E83A', }, diff --git a/packages/@aws-cdk/aws-ec2/test/vpc.test.ts b/packages/@aws-cdk/aws-ec2/test/vpc.test.ts index ca0db0181fe12..d6d4b45f0a0f4 100644 --- a/packages/@aws-cdk/aws-ec2/test/vpc.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/vpc.test.ts @@ -32,11 +32,11 @@ nodeunitShim({ new Vpc(stack, 'TheVPC'); expect(stack).to( haveResource('AWS::EC2::VPC', - hasTags( [ {Key: 'Name', Value: 'TheVPC'} ])), + hasTags( [ {Key: 'Name', Value: 'TestStack/TheVPC'} ])), ); expect(stack).to( haveResource('AWS::EC2::InternetGateway', - hasTags( [ {Key: 'Name', Value: 'TheVPC'} ])), + hasTags( [ {Key: 'Name', Value: 'TestStack/TheVPC'} ])), ); test.done(); }, @@ -408,7 +408,7 @@ nodeunitShim({ for (let i = 1; i < 4; i++) { expect(stack).to(haveResource('AWS::EC2::Subnet', hasTags([{ Key: 'Name', - Value: `VPC/egressSubnet${i}`, + Value: `TestStack/VPC/egressSubnet${i}`, }, { Key: 'aws-cdk:subnet-name', Value: 'egress', diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.l3s-v2.ts b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.l3s-v2.ts index 745bad2c660fc..31e4c8f247543 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.l3s-v2.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.l3s-v2.ts @@ -222,7 +222,7 @@ export = { 'Arn', ], }, - Family: 'ServiceTaskDef79D79521', + Family: 'StackServiceTaskDef733E80F6', NetworkMode: 'bridge', RequiresCompatibilities: [ 'EC2', @@ -299,7 +299,7 @@ export = { ], }, ], - Family: 'Ec2TaskDef', + Family: 'StackEc2TaskDefF03698CF', NetworkMode: 'bridge', RequiresCompatibilities: [ 'EC2', @@ -916,7 +916,7 @@ export = { 'Arn', ], }, - Family: 'ServiceTaskDef79D79521', + Family: 'StackServiceTaskDef733E80F6', NetworkMode: 'bridge', RequiresCompatibilities: [ 'EC2', @@ -1087,7 +1087,7 @@ export = { 'Arn', ], }, - Family: 'ServiceTaskDef79D79521', + Family: 'StackServiceTaskDef733E80F6', NetworkMode: 'bridge', RequiresCompatibilities: [ 'EC2', @@ -1164,7 +1164,7 @@ export = { ], }, ], - Family: 'Ec2TaskDef', + Family: 'StackEc2TaskDefF03698CF', NetworkMode: 'bridge', RequiresCompatibilities: [ 'EC2', diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.queue-processing-ecs-service.ts b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.queue-processing-ecs-service.ts index 4bfa0732591cb..c0799197cff20 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.queue-processing-ecs-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/test/ec2/test.queue-processing-ecs-service.ts @@ -74,7 +74,7 @@ export = { Memory: 512, }, ], - Family: 'ServiceQueueProcessingTaskDef83DB34F1', + Family: 'StackServiceQueueProcessingTaskDef0CCF68C6', })); test.done(); @@ -149,7 +149,7 @@ export = { Memory: 512, }, ], - Family: 'ServiceQueueProcessingTaskDef83DB34F1', + Family: 'StackServiceQueueProcessingTaskDef0CCF68C6', })); test.done(); diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.load-balanced-fargate-service-v2.ts b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.load-balanced-fargate-service-v2.ts index becc38e6a9fd1..13511b0f2bc79 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.load-balanced-fargate-service-v2.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.load-balanced-fargate-service-v2.ts @@ -71,7 +71,7 @@ export = { 'Arn', ], }, - Family: 'ServiceTaskDef79D79521', + Family: 'StackServiceTaskDef733E80F6', Memory: '512', NetworkMode: 'awsvpc', RequiresCompatibilities: [ @@ -370,7 +370,7 @@ export = { 'Arn', ], }, - Family: 'ServiceTaskDef79D79521', + Family: 'StackServiceTaskDef733E80F6', Memory: '512', NetworkMode: 'awsvpc', RequiresCompatibilities: [ @@ -402,7 +402,7 @@ export = { logDriver: new ecs.AwsLogDriver({ streamPrefix: 'TestStream', }), - family: 'Ec2TaskDef', + family: 'StackServiceTaskDef733E80F6', executionRole: new Role(stack, 'ExecutionRole', { path: '/', assumedBy: new CompositePrincipal( @@ -526,7 +526,7 @@ export = { 'Arn', ], }, - Family: 'Ec2TaskDef', + Family: 'StackServiceTaskDef733E80F6', Memory: '512', NetworkMode: 'awsvpc', RequiresCompatibilities: [ diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.queue-processing-fargate-service.ts b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.queue-processing-fargate-service.ts index 4f0f434ef1f72..2ffb95f2863bd 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.queue-processing-fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.queue-processing-fargate-service.ts @@ -96,7 +96,7 @@ export = { Image: 'test', }, ], - Family: 'ServiceQueueProcessingTaskDef83DB34F1', + Family: 'StackServiceQueueProcessingTaskDef0CCF68C6', })); test.done(); @@ -193,7 +193,7 @@ export = { Image: 'test', }, ], - Family: 'ServiceQueueProcessingTaskDef83DB34F1', + Family: 'StackServiceQueueProcessingTaskDef0CCF68C6', })); test.done(); diff --git a/packages/@aws-cdk/aws-ecs/test/ec2/test.ec2-task-definition.ts b/packages/@aws-cdk/aws-ecs/test/ec2/test.ec2-task-definition.ts index a22c4801fcebb..fa98dbc015b67 100644 --- a/packages/@aws-cdk/aws-ecs/test/ec2/test.ec2-task-definition.ts +++ b/packages/@aws-cdk/aws-ecs/test/ec2/test.ec2-task-definition.ts @@ -18,7 +18,7 @@ export = { // THEN expect(stack).to(haveResource('AWS::ECS::TaskDefinition', { - Family: 'Ec2TaskDef', + Family: 'StackEc2TaskDefF03698CF', NetworkMode: ecs.NetworkMode.BRIDGE, RequiresCompatibilities: ['EC2'], })); @@ -194,7 +194,7 @@ export = { // THEN expect(stack).to(haveResource('AWS::ECS::TaskDefinition', { - Family: 'Ec2TaskDef', + Family: 'StackEc2TaskDefF03698CF', ContainerDefinitions: [{ Essential: true, Memory: 512, @@ -287,7 +287,7 @@ export = { // THEN expect(stack).to(haveResource('AWS::ECS::TaskDefinition', { - Family: 'Ec2TaskDef', + Family: 'StackEc2TaskDefF03698CF', ContainerDefinitions: [ { Command: [ @@ -428,7 +428,7 @@ export = { })); expect(stack).to(haveResource('AWS::ECS::TaskDefinition', { - Family: 'Ec2TaskDef', + Family: 'StackEc2TaskDefF03698CF', ContainerDefinitions: [{ Essential: true, Memory: 512, @@ -557,7 +557,7 @@ export = { // THEN expect(stack).to(haveResource('AWS::ECS::TaskDefinition', { - Family: 'Ec2TaskDef', + Family: 'StackEc2TaskDefF03698CF', ContainerDefinitions: [ { Essential: true, @@ -624,7 +624,7 @@ export = { // THEN expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { - Family: 'Ec2TaskDef', + Family: 'StackEc2TaskDefF03698CF', ContainerDefinitions: [{ MountPoints: [ { @@ -675,7 +675,7 @@ export = { // THEN expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { - Family: 'Ec2TaskDef', + Family: 'StackEc2TaskDefF03698CF', ContainerDefinitions: [{ Name: 'dependency1', }, @@ -858,7 +858,7 @@ export = { // THEN expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { - Family: 'Ec2TaskDef', + Family: 'StackEc2TaskDefF03698CF', ContainerDefinitions: [{ MountPoints: [ { @@ -966,7 +966,7 @@ export = { // THEN expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { - Family: 'Ec2TaskDef', + Family: 'StackEc2TaskDefF03698CF', Volumes: [{ Name: 'scratch', DockerVolumeConfiguration: { diff --git a/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-service.ts b/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-service.ts index 454d904f7592f..5a33ccf0af893 100644 --- a/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-service.ts @@ -66,7 +66,7 @@ export = { })); expect(stack).to(haveResource('AWS::EC2::SecurityGroup', { - GroupDescription: 'FargateService/SecurityGroup', + GroupDescription: 'Stack/FargateService/SecurityGroup', SecurityGroupEgress: [ { CidrIp: '0.0.0.0/0', @@ -897,7 +897,7 @@ export = { protocol: ecs.Protocol.TCP, })], }); - }, /Container 'FargateTaskDef\/MainContainer' has no mapping for port 8001 and protocol tcp. Did you call "container.addPortMappings\(\)"\?/); + }, /Container 'Stack\/FargateTaskDef\/MainContainer' has no mapping for port 8001 and protocol tcp. Did you call "container.addPortMappings\(\)"\?/); test.done(); }, @@ -932,7 +932,7 @@ export = { containerPort: 8002, })], }); - }, /Container 'FargateTaskDef\/MainContainer' has no mapping for port 8002 and protocol tcp. Did you call "container.addPortMappings\(\)"\?/); + }, /Container 'Stack\/FargateTaskDef\/MainContainer' has no mapping for port 8002 and protocol tcp. Did you call "container.addPortMappings\(\)"\?/); test.done(); }, diff --git a/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-task-definition.ts b/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-task-definition.ts index 05e65d48d1730..989c55a6c94cc 100644 --- a/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-task-definition.ts +++ b/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-task-definition.ts @@ -13,7 +13,7 @@ export = { // THEN expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { - Family: 'FargateTaskDef', + Family: 'StackFargateTaskDefF2C9186E', NetworkMode: ecs.NetworkMode.AWS_VPC, RequiresCompatibilities: ['FARGATE'], Cpu: '256', diff --git a/packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts b/packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts index d0be3430ceb50..f484479d0ed79 100644 --- a/packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts +++ b/packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts @@ -26,7 +26,7 @@ export = { Tags: [ { Key: 'Name', - Value: 'EcsCluster/Vpc', + Value: 'Stack/EcsCluster/Vpc', }, ], })); @@ -74,7 +74,7 @@ export = { { Key: 'Name', PropagateAtLaunch: true, - Value: 'EcsCluster/DefaultAutoScalingGroup', + Value: 'Stack/EcsCluster/DefaultAutoScalingGroup', }, ], VPCZoneIdentifier: [ @@ -88,7 +88,7 @@ export = { })); expect(stack).to(haveResource('AWS::EC2::SecurityGroup', { - GroupDescription: 'EcsCluster/DefaultAutoScalingGroup/InstanceSecurityGroup', + GroupDescription: 'Stack/EcsCluster/DefaultAutoScalingGroup/InstanceSecurityGroup', SecurityGroupEgress: [ { CidrIp: '0.0.0.0/0', @@ -99,7 +99,7 @@ export = { Tags: [ { Key: 'Name', - Value: 'EcsCluster/DefaultAutoScalingGroup', + Value: 'Stack/EcsCluster/DefaultAutoScalingGroup', }, ], VpcId: { @@ -171,7 +171,7 @@ export = { Tags: [ { Key: 'Name', - Value: 'MyVpc', + Value: 'Stack/MyVpc', }, ], })); @@ -219,7 +219,7 @@ export = { { Key: 'Name', PropagateAtLaunch: true, - Value: 'EcsCluster/DefaultAutoScalingGroup', + Value: 'Stack/EcsCluster/DefaultAutoScalingGroup', }, ], VPCZoneIdentifier: [ @@ -233,7 +233,7 @@ export = { })); expect(stack).to(haveResource('AWS::EC2::SecurityGroup', { - GroupDescription: 'EcsCluster/DefaultAutoScalingGroup/InstanceSecurityGroup', + GroupDescription: 'Stack/EcsCluster/DefaultAutoScalingGroup/InstanceSecurityGroup', SecurityGroupEgress: [ { CidrIp: '0.0.0.0/0', @@ -244,7 +244,7 @@ export = { Tags: [ { Key: 'Name', - Value: 'EcsCluster/DefaultAutoScalingGroup', + Value: 'Stack/EcsCluster/DefaultAutoScalingGroup', }, ], VpcId: { @@ -471,7 +471,7 @@ export = { Tags: [ { Key: 'Name', - Value: 'MyVpc', + Value: 'Stack/MyVpc', }, ], })); @@ -519,7 +519,7 @@ export = { { Key: 'Name', PropagateAtLaunch: true, - Value: 'EcsCluster/DefaultAutoScalingGroup', + Value: 'Stack/EcsCluster/DefaultAutoScalingGroup', }, ], VPCZoneIdentifier: [ @@ -533,7 +533,7 @@ export = { })); expect(stack).to(haveResource('AWS::EC2::SecurityGroup', { - GroupDescription: 'EcsCluster/DefaultAutoScalingGroup/InstanceSecurityGroup', + GroupDescription: 'Stack/EcsCluster/DefaultAutoScalingGroup/InstanceSecurityGroup', SecurityGroupEgress: [ { CidrIp: '0.0.0.0/0', @@ -544,7 +544,7 @@ export = { Tags: [ { Key: 'Name', - Value: 'EcsCluster/DefaultAutoScalingGroup', + Value: 'Stack/EcsCluster/DefaultAutoScalingGroup', }, ], VpcId: { @@ -1228,7 +1228,7 @@ export = { Tags: [ { Key: 'Name', - Value: 'MyPublicVpc', + Value: 'Stack/MyPublicVpc', }, ], })); @@ -1277,7 +1277,7 @@ export = { { Key: 'Name', PropagateAtLaunch: true, - Value: 'EcsCluster/DefaultAutoScalingGroup', + Value: 'Stack/EcsCluster/DefaultAutoScalingGroup', }, ], VPCZoneIdentifier: [ @@ -1291,7 +1291,7 @@ export = { })); expect(stack).to(haveResource('AWS::EC2::SecurityGroup', { - GroupDescription: 'EcsCluster/DefaultAutoScalingGroup/InstanceSecurityGroup', + GroupDescription: 'Stack/EcsCluster/DefaultAutoScalingGroup/InstanceSecurityGroup', SecurityGroupEgress: [ { CidrIp: '0.0.0.0/0', @@ -1302,7 +1302,7 @@ export = { Tags: [ { Key: 'Name', - Value: 'EcsCluster/DefaultAutoScalingGroup', + Value: 'Stack/EcsCluster/DefaultAutoScalingGroup', }, ], VpcId: { diff --git a/packages/@aws-cdk/aws-eks/test/test.fargate.ts b/packages/@aws-cdk/aws-eks/test/test.fargate.ts index 531b49882b3c3..c168144d06a5d 100644 --- a/packages/@aws-cdk/aws-eks/test/test.fargate.ts +++ b/packages/@aws-cdk/aws-eks/test/test.fargate.ts @@ -281,7 +281,7 @@ export = { Properties: { ServiceToken: { 'Fn::GetAtt': [ 'awscdkawseksClusterResourceProviderNestedStackawscdkawseksClusterResourceProviderNestedStackResource9827C454', - 'Outputs.awscdkawseksClusterResourceProviderframeworkonEventEA97AA31Arn', + 'Outputs.StackawscdkawseksClusterResourceProviderframeworkonEvent9D6CED48Arn', ]}, AssumeRoleArn: { 'Fn::GetAtt': [ 'MyClusterCreationRoleB5FA4FF3', 'Arn' ] }, Config: { diff --git a/packages/@aws-cdk/aws-eks/test/test.k8s-patch.ts b/packages/@aws-cdk/aws-eks/test/test.k8s-patch.ts index b8963aa3a3989..b8a2056e1a749 100644 --- a/packages/@aws-cdk/aws-eks/test/test.k8s-patch.ts +++ b/packages/@aws-cdk/aws-eks/test/test.k8s-patch.ts @@ -25,7 +25,7 @@ export = { ServiceToken: { 'Fn::GetAtt': [ 'awscdkawseksKubectlProviderNestedStackawscdkawseksKubectlProviderNestedStackResourceA7AEBA6B', - 'Outputs.awscdkawseksKubectlProviderframeworkonEvent0A650005Arn', + 'Outputs.StackawscdkawseksKubectlProviderframeworkonEvent8897FD9BArn', ], }, ResourceName: 'myResourceName', diff --git a/packages/@aws-cdk/aws-events-targets/test/batch/batch.test.ts b/packages/@aws-cdk/aws-events-targets/test/batch/batch.test.ts index 7d4ab3b3f685e..2ef65ed0156fc 100644 --- a/packages/@aws-cdk/aws-events-targets/test/batch/batch.test.ts +++ b/packages/@aws-cdk/aws-events-targets/test/batch/batch.test.ts @@ -48,7 +48,7 @@ test('use aws batch job as an eventrule target', () => { }, BatchParameters: { JobDefinition: { Ref: 'MyJob8719E923' }, - JobName: 'Rule', + JobName: 'StackRuleF6E31DD0', }, }, ], diff --git a/packages/@aws-cdk/aws-events/test/test.event-bus.ts b/packages/@aws-cdk/aws-events/test/test.event-bus.ts index c32824884c08e..f68b2b3551386 100644 --- a/packages/@aws-cdk/aws-events/test/test.event-bus.ts +++ b/packages/@aws-cdk/aws-events/test/test.event-bus.ts @@ -14,7 +14,7 @@ export = { // THEN expect(stack).to(haveResource('AWS::Events::EventBus', { - Name: 'Bus', + Name: 'StackBusAA0A1E4B', })); test.done(); diff --git a/packages/@aws-cdk/aws-kinesis/test/stream.test.ts b/packages/@aws-cdk/aws-kinesis/test/stream.test.ts index b9a5216e1b6a6..f4e4733357aef 100644 --- a/packages/@aws-cdk/aws-kinesis/test/stream.test.ts +++ b/packages/@aws-cdk/aws-kinesis/test/stream.test.ts @@ -338,7 +338,7 @@ describe('Kinesis data streams', () => { MyStreamKey76F3300E: { Type: 'AWS::KMS::Key', Properties: { - Description: 'Created by MyStream', + Description: 'Created by Stack/MyStream', KeyPolicy: { Statement: [ { @@ -555,7 +555,7 @@ describe('Kinesis data streams', () => { ], Version: '2012-10-17', }, - Description: 'Created by MyStream', + Description: 'Created by Stack/MyStream', }, UpdateReplacePolicy: 'Retain', DeletionPolicy: 'Retain', @@ -684,7 +684,7 @@ describe('Kinesis data streams', () => { ], Version: '2012-10-17', }, - Description: 'Created by MyStream', + Description: 'Created by Stack/MyStream', }, UpdateReplacePolicy: 'Retain', DeletionPolicy: 'Retain', @@ -753,7 +753,7 @@ describe('Kinesis data streams', () => { MyStreamKey76F3300E: { Type: 'AWS::KMS::Key', Properties: { - Description: 'Created by MyStream', + Description: 'Created by Stack/MyStream', KeyPolicy: { Statement: [ { diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/test.api.ts b/packages/@aws-cdk/aws-lambda-event-sources/test/test.api.ts index 63844bb072e09..4498b64a28e6d 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/test/test.api.ts +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/test.api.ts @@ -20,12 +20,12 @@ export = { // THEN expect(stack).to(haveResource('AWS::ApiGateway::Resource', { PathPart: 'foo', - ParentId: { 'Fn::GetAtt': [ 'MyFuncApiEventSourceA7A86A4FFB3F557C', 'RootResourceId' ] }, + ParentId: { 'Fn::GetAtt': [ 'StackMyFunc9605894BApiEventSourceA7A86A4FA0EF20EE', 'RootResourceId' ] }, })); expect(stack).to(haveResource('AWS::ApiGateway::Method', { HttpMethod: 'GET', - ResourceId: { Ref: 'MyFuncApiEventSourceA7A86A4FfooCA6F87E4' }, + ResourceId: { Ref: 'StackMyFunc9605894BApiEventSourceA7A86A4Ffoo036E62EF' }, })); test.done(); @@ -47,22 +47,22 @@ export = { // THEN expect(stack).to(haveResource('AWS::ApiGateway::Resource', { PathPart: 'foo', - ParentId: { 'Fn::GetAtt': [ 'MyFuncApiEventSourceA7A86A4FFB3F557C', 'RootResourceId' ] }, + ParentId: { 'Fn::GetAtt': [ 'StackMyFunc9605894BApiEventSourceA7A86A4FA0EF20EE', 'RootResourceId' ] }, })); expect(stack).to(haveResource('AWS::ApiGateway::Resource', { PathPart: 'bar', - ParentId: { 'Fn::GetAtt': [ 'MyFuncApiEventSourceA7A86A4FFB3F557C', 'RootResourceId' ] }, + ParentId: { 'Fn::GetAtt': [ 'StackMyFunc9605894BApiEventSourceA7A86A4FA0EF20EE', 'RootResourceId' ] }, })); expect(stack).to(haveResource('AWS::ApiGateway::Method', { HttpMethod: 'GET', - ResourceId: { Ref: 'MyFuncApiEventSourceA7A86A4FfooCA6F87E4' }, + ResourceId: { Ref: 'StackMyFunc9605894BApiEventSourceA7A86A4Ffoo036E62EF' }, })); expect(stack).to(haveResource('AWS::ApiGateway::Method', { HttpMethod: 'POST', - ResourceId: { Ref: 'MyFuncApiEventSourceA7A86A4FbarDFB0F21B' }, + ResourceId: { Ref: 'StackMyFunc9605894BApiEventSourceA7A86A4FbarDB723DC5' }, })); test.done(); @@ -85,22 +85,22 @@ export = { // THEN expect(stack).to(haveResource('AWS::ApiGateway::Resource', { PathPart: 'foo', - ParentId: { 'Fn::GetAtt': [ 'MyFuncApiEventSourceA7A86A4FFB3F557C', 'RootResourceId' ] }, + ParentId: { 'Fn::GetAtt': [ 'StackMyFunc9605894BApiEventSourceA7A86A4FA0EF20EE', 'RootResourceId' ] }, })); expect(stack).to(haveResource('AWS::ApiGateway::Resource', { PathPart: 'bar', - ParentId: { Ref: 'MyFuncApiEventSourceA7A86A4FfooCA6F87E4' }, + ParentId: { Ref: 'StackMyFunc9605894BApiEventSourceA7A86A4Ffoo036E62EF' }, })); expect(stack).to(haveResource('AWS::ApiGateway::Method', { HttpMethod: 'GET', - ResourceId: { Ref: 'MyFuncApiEventSourceA7A86A4FfooCA6F87E4' }, + ResourceId: { Ref: 'StackMyFunc9605894BApiEventSourceA7A86A4Ffoo036E62EF' }, })); expect(stack).to(haveResource('AWS::ApiGateway::Method', { HttpMethod: 'POST', - ResourceId: { Ref: 'MyFuncApiEventSourceA7A86A4Ffoobar028FFFDE' }, + ResourceId: { Ref: 'StackMyFunc9605894BApiEventSourceA7A86A4Ffoobar74614CB9' }, })); test.done(); diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/test.dynamo.ts b/packages/@aws-cdk/aws-lambda-event-sources/test/test.dynamo.ts index 745b016109d30..fc27c6cc74a80 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/test/test.dynamo.ts +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/test.dynamo.ts @@ -127,7 +127,7 @@ export = { test.throws(() => fn.addEventSource(new sources.DynamoEventSource(table, { batchSize: 50, startingPosition: lambda.StartingPosition.LATEST, - })), /DynamoDB Streams must be enabled on the table T/); + })), /DynamoDB Streams must be enabled on the table Stack\/T/); test.done(); }, diff --git a/packages/@aws-cdk/aws-s3-notifications/test/queue.test.ts b/packages/@aws-cdk/aws-s3-notifications/test/queue.test.ts index d1e4f1abf1bc9..d67d634b410aa 100644 --- a/packages/@aws-cdk/aws-s3-notifications/test/queue.test.ts +++ b/packages/@aws-cdk/aws-s3-notifications/test/queue.test.ts @@ -136,6 +136,6 @@ test('if the queue is encrypted with a custom kms key, the key resource policy i ], Version: '2012-10-17', }, - Description: 'Created by Queue', + Description: 'Created by Stack/Queue', }); }); diff --git a/packages/@aws-cdk/aws-s3/test/test.bucket.ts b/packages/@aws-cdk/aws-s3/test/test.bucket.ts index 89bcd0cbdc426..4560c3d0d1a86 100644 --- a/packages/@aws-cdk/aws-s3/test/test.bucket.ts +++ b/packages/@aws-cdk/aws-s3/test/test.bucket.ts @@ -610,13 +610,20 @@ export = { test.done(); }, - 'import can also be used to import arbitrary ARNs'(test: Test) { + 'import does not create any resources'(test: Test) { const stack = new cdk.Stack(); const bucket = s3.Bucket.fromBucketAttributes(stack, 'ImportedBucket', { bucketArn: 'arn:aws:s3:::my-bucket' }); bucket.addToResourcePolicy(new iam.PolicyStatement({ resources: ['*'], actions: ['*'] })); // at this point we technically didn't create any resources in the consuming stack. expect(stack).toMatch({}); + test.done(); + }, + + 'import can also be used to import arbitrary ARNs'(test: Test) { + const stack = new cdk.Stack(); + const bucket = s3.Bucket.fromBucketAttributes(stack, 'ImportedBucket', { bucketArn: 'arn:aws:s3:::my-bucket' }); + bucket.addToResourcePolicy(new iam.PolicyStatement({ resources: ['*'], actions: ['*'] })); // but now we can reference the bucket // you can even use the bucket name, which will be extracted from the arn provided. @@ -867,7 +874,7 @@ export = { 'MyBucketKeyC17130CF': { 'Type': 'AWS::KMS::Key', 'Properties': { - 'Description': 'Created by MyBucket', + 'Description': 'Created by Stack/MyBucket', 'KeyPolicy': { 'Statement': [ { diff --git a/packages/@aws-cdk/aws-secretsmanager/test/test.secret-rotation.ts b/packages/@aws-cdk/aws-secretsmanager/test/test.secret-rotation.ts index 73eed329f232d..9ea54c9a25037 100644 --- a/packages/@aws-cdk/aws-secretsmanager/test/test.secret-rotation.ts +++ b/packages/@aws-cdk/aws-secretsmanager/test/test.secret-rotation.ts @@ -26,7 +26,7 @@ export = { // THEN expect(stack).to(haveResource('AWS::EC2::SecurityGroupIngress', { IpProtocol: 'tcp', - Description: 'from SecretRotationSecurityGroupAEC520AB:3306', + Description: 'from StackSecretRotationSecurityGroup79E4F5FF:3306', FromPort: 3306, GroupId: { 'Fn::GetAtt': [ @@ -59,7 +59,7 @@ export = { })); expect(stack).to(haveResource('AWS::EC2::SecurityGroup', { - GroupDescription: 'SecretRotation/SecurityGroup', + GroupDescription: 'Stack/SecretRotation/SecurityGroup', })); expect(stack).to(haveResource('AWS::Serverless::Application', { @@ -83,7 +83,7 @@ export = { ], ], }, - functionName: 'SecretRotation', + functionName: 'StackSecretRotation369145BF', vpcSecurityGroupIds: { 'Fn::GetAtt': [ 'SecretRotationSecurityGroup9985012B', @@ -182,7 +182,7 @@ export = { ], ], }, - functionName: 'SecretRotation', + functionName: 'StackSecretRotation369145BF', vpcSecurityGroupIds: { 'Fn::GetAtt': [ 'SecretRotationSecurityGroup9985012B', @@ -329,7 +329,7 @@ export = { ], ], }, - functionName: 'RotationSecretRotationSecretRotationSecretRotationSecretRotation', + functionName: 'SecretRotationSecretRotationSecretRotationSecretRotationA7DEE631', vpcSecurityGroupIds: { 'Fn::GetAtt': [ 'SecretRotationSecretRotationSecretRotationSecretRotationSecretRotationSecurityGroupBFCB171A', diff --git a/packages/@aws-cdk/aws-servicediscovery/test/test.instance.ts b/packages/@aws-cdk/aws-servicediscovery/test/test.instance.ts index c06e0a61cccd7..57d207c94a6a9 100644 --- a/packages/@aws-cdk/aws-servicediscovery/test/test.instance.ts +++ b/packages/@aws-cdk/aws-servicediscovery/test/test.instance.ts @@ -37,7 +37,7 @@ export = { 'Id', ], }, - InstanceId: 'MyNamespaceMyServiceIpInstanceBACEB9D2', + InstanceId: 'StackMyNamespaceMyServiceIpInstanceF1B9ABBE', })); test.done(); @@ -75,7 +75,7 @@ export = { 'Id', ], }, - InstanceId: 'MyNamespaceMyServiceIpInstanceBACEB9D2', + InstanceId: 'StackMyNamespaceMyServiceIpInstanceF1B9ABBE', })); test.done(); @@ -115,7 +115,7 @@ export = { 'Id', ], }, - InstanceId: 'MyNamespaceMyServiceIpInstanceBACEB9D2', + InstanceId: 'StackMyNamespaceMyServiceIpInstanceF1B9ABBE', })); test.done(); @@ -273,7 +273,7 @@ export = { 'Id', ], }, - InstanceId: 'MyNamespaceMyServiceLoadbalancerD1112A76', + InstanceId: 'StackMyNamespaceMyServiceLoadbalancer228D42DF', })); test.done(); @@ -355,7 +355,7 @@ export = { 'Id', ], }, - InstanceId: 'MyNamespaceMyServiceCnameInstance0EB1C98D', + InstanceId: 'StackMyNamespaceMyServiceCnameInstance24D3C50C', })); test.done(); @@ -408,7 +408,7 @@ export = { 'Id', ], }, - InstanceId: 'MyNamespaceMyServiceNonIpInstance7EFD703A', + InstanceId: 'StackMyNamespaceMyServiceNonIpInstance990D5FF0', })); test.done(); diff --git a/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts b/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts index 77c38a5259061..51b2e6e5b989e 100644 --- a/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts +++ b/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts @@ -284,7 +284,7 @@ test('queue subscription', () => { ], }, }, - 'MyQueueMyTopic9B00631B': { + 'MyQueueStackMyTopic9EF397EEFDFDC132': { 'Type': 'AWS::SNS::Subscription', 'Properties': { 'Protocol': 'sqs', @@ -361,7 +361,7 @@ test('queue subscription with user provided dlq', () => { ], }, }, - 'MyQueueMyTopic9B00631B': { + 'MyQueueStackMyTopic9EF397EEFDFDC132': { 'Type': 'AWS::SNS::Subscription', 'Properties': { 'Protocol': 'sqs', @@ -518,7 +518,7 @@ test('lambda subscription', () => { 'MyFuncServiceRole54065130', ], }, - 'MyFuncAllowInvokeMyTopicDD0A15B8': { + 'MyFuncAllowInvokeStackMyTopic9EF397EEFE1A035D': { 'Type': 'AWS::Lambda::Permission', 'Properties': { 'Action': 'lambda:InvokeFunction', @@ -781,7 +781,7 @@ test('multiple subscriptions', () => { ], }, }, - 'MyQueueMyTopic9B00631B': { + 'MyQueueStackMyTopic9EF397EEFDFDC132': { 'Type': 'AWS::SNS::Subscription', 'Properties': { 'Protocol': 'sqs', @@ -846,7 +846,7 @@ test('multiple subscriptions', () => { 'MyFuncServiceRole54065130', ], }, - 'MyFuncAllowInvokeMyTopicDD0A15B8': { + 'MyFuncAllowInvokeStackMyTopic9EF397EEFE1A035D': { 'Type': 'AWS::Lambda::Permission', 'Properties': { 'Action': 'lambda:InvokeFunction', @@ -887,7 +887,7 @@ test('throws with mutliple subscriptions of the same subscriber', () => { topic.addSubscription(new subs.SqsSubscription(queue)); expect(() => topic.addSubscription(new subs.SqsSubscription(queue))) - .toThrowError(/A subscription with id \"MyTopic\" already exists under the scope MyQueue/); + .toThrowError(/A subscription with id \"StackMyTopic9EF397EE\" already exists under the scope Stack\/MyQueue/); }); test('with filter policy', () => { diff --git a/packages/@aws-cdk/aws-stepfunctions/test/activity.test.ts b/packages/@aws-cdk/aws-stepfunctions/test/activity.test.ts index b2e8b4dca9b6e..3506ab362f481 100644 --- a/packages/@aws-cdk/aws-stepfunctions/test/activity.test.ts +++ b/packages/@aws-cdk/aws-stepfunctions/test/activity.test.ts @@ -14,7 +14,7 @@ describe('Activity', () => { // THEN expect(stack).toHaveResource('AWS::StepFunctions::Activity', { - Name: 'Activity', + Name: 'StackActivityAACA61A2', }); });