diff --git a/packages/@aws-cdk/aws-ec2/lib/security-group.ts b/packages/@aws-cdk/aws-ec2/lib/security-group.ts index c5c0ad3753df1..e3b63b42f48af 100644 --- a/packages/@aws-cdk/aws-ec2/lib/security-group.ts +++ b/packages/@aws-cdk/aws-ec2/lib/security-group.ts @@ -662,7 +662,7 @@ export class SecurityGroup extends SecurityGroupBase { } else { this.directEgressRules.push({ ipProtocol: '-1', - cidrIp: peer.uniqueId, + cidrIpv6: peer.uniqueId, description, }); } diff --git a/packages/@aws-cdk/aws-ec2/test/instance.integ.snapshot/cdk.out b/packages/@aws-cdk/aws-ec2/test/instance.integ.snapshot/cdk.out index 90bef2e09ad39..8ecc185e9dbee 100644 --- a/packages/@aws-cdk/aws-ec2/test/instance.integ.snapshot/cdk.out +++ b/packages/@aws-cdk/aws-ec2/test/instance.integ.snapshot/cdk.out @@ -1 +1 @@ -{"version":"17.0.0"} \ No newline at end of file +{"version":"21.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ec2/test/instance.integ.snapshot/instancetestDefaultTestDeployAssert5516EAF1.assets.json b/packages/@aws-cdk/aws-ec2/test/instance.integ.snapshot/instancetestDefaultTestDeployAssert5516EAF1.assets.json new file mode 100644 index 0000000000000..1c03bb5dc6a33 --- /dev/null +++ b/packages/@aws-cdk/aws-ec2/test/instance.integ.snapshot/instancetestDefaultTestDeployAssert5516EAF1.assets.json @@ -0,0 +1,19 @@ +{ + "version": "21.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "instancetestDefaultTestDeployAssert5516EAF1.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-ec2/test/instance.integ.snapshot/instancetestDefaultTestDeployAssert5516EAF1.template.json b/packages/@aws-cdk/aws-ec2/test/instance.integ.snapshot/instancetestDefaultTestDeployAssert5516EAF1.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk/aws-ec2/test/instance.integ.snapshot/instancetestDefaultTestDeployAssert5516EAF1.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-ec2/test/instance.integ.snapshot/integ-ec2-instance.assets.json b/packages/@aws-cdk/aws-ec2/test/instance.integ.snapshot/integ-ec2-instance.assets.json new file mode 100644 index 0000000000000..be86270a59992 --- /dev/null +++ b/packages/@aws-cdk/aws-ec2/test/instance.integ.snapshot/integ-ec2-instance.assets.json @@ -0,0 +1,19 @@ +{ + "version": "21.0.0", + "files": { + "07dc2cd10d2741c8de44a54c2c57da82c0dc28b18e74ae53bfdb0eb3d8f26eff": { + "source": { + "path": "integ-ec2-instance.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "07dc2cd10d2741c8de44a54c2c57da82c0dc28b18e74ae53bfdb0eb3d8f26eff.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-ec2/test/instance.integ.snapshot/TestStack.template.json b/packages/@aws-cdk/aws-ec2/test/instance.integ.snapshot/integ-ec2-instance.template.json similarity index 82% rename from packages/@aws-cdk/aws-ec2/test/instance.integ.snapshot/TestStack.template.json rename to packages/@aws-cdk/aws-ec2/test/instance.integ.snapshot/integ-ec2-instance.template.json index 5e91606d937fb..e130a1918900e 100644 --- a/packages/@aws-cdk/aws-ec2/test/instance.integ.snapshot/TestStack.template.json +++ b/packages/@aws-cdk/aws-ec2/test/instance.integ.snapshot/integ-ec2-instance.template.json @@ -10,7 +10,7 @@ "Tags": [ { "Key": "Name", - "Value": "TestStack/VPC" + "Value": "integ-ec2-instance/VPC" } ] } @@ -42,7 +42,7 @@ }, { "Key": "Name", - "Value": "TestStack/VPC/PublicSubnet1" + "Value": "integ-ec2-instance/VPC/PublicSubnet1" } ] } @@ -56,7 +56,7 @@ "Tags": [ { "Key": "Name", - "Value": "TestStack/VPC/PublicSubnet1" + "Value": "integ-ec2-instance/VPC/PublicSubnet1" } ] } @@ -94,7 +94,7 @@ "Tags": [ { "Key": "Name", - "Value": "TestStack/VPC/PublicSubnet1" + "Value": "integ-ec2-instance/VPC/PublicSubnet1" } ] } @@ -114,10 +114,14 @@ "Tags": [ { "Key": "Name", - "Value": "TestStack/VPC/PublicSubnet1" + "Value": "integ-ec2-instance/VPC/PublicSubnet1" } ] - } + }, + "DependsOn": [ + "VPCPublicSubnet1DefaultRoute91CEF279", + "VPCPublicSubnet1RouteTableAssociation0B0896DC" + ] }, "VPCPublicSubnet2Subnet74179F39": { "Type": "AWS::EC2::Subnet", @@ -146,7 +150,7 @@ }, { "Key": "Name", - "Value": "TestStack/VPC/PublicSubnet2" + "Value": "integ-ec2-instance/VPC/PublicSubnet2" } ] } @@ -160,7 +164,7 @@ "Tags": [ { "Key": "Name", - "Value": "TestStack/VPC/PublicSubnet2" + "Value": "integ-ec2-instance/VPC/PublicSubnet2" } ] } @@ -198,7 +202,7 @@ "Tags": [ { "Key": "Name", - "Value": "TestStack/VPC/PublicSubnet2" + "Value": "integ-ec2-instance/VPC/PublicSubnet2" } ] } @@ -218,10 +222,14 @@ "Tags": [ { "Key": "Name", - "Value": "TestStack/VPC/PublicSubnet2" + "Value": "integ-ec2-instance/VPC/PublicSubnet2" } ] - } + }, + "DependsOn": [ + "VPCPublicSubnet2DefaultRouteB7481BBA", + "VPCPublicSubnet2RouteTableAssociation5A808732" + ] }, "VPCPrivateSubnet1Subnet8BCA10E0": { "Type": "AWS::EC2::Subnet", @@ -250,7 +258,7 @@ }, { "Key": "Name", - "Value": "TestStack/VPC/PrivateSubnet1" + "Value": "integ-ec2-instance/VPC/PrivateSubnet1" } ] } @@ -264,7 +272,7 @@ "Tags": [ { "Key": "Name", - "Value": "TestStack/VPC/PrivateSubnet1" + "Value": "integ-ec2-instance/VPC/PrivateSubnet1" } ] } @@ -319,7 +327,7 @@ }, { "Key": "Name", - "Value": "TestStack/VPC/PrivateSubnet2" + "Value": "integ-ec2-instance/VPC/PrivateSubnet2" } ] } @@ -333,7 +341,7 @@ "Tags": [ { "Key": "Name", - "Value": "TestStack/VPC/PrivateSubnet2" + "Value": "integ-ec2-instance/VPC/PrivateSubnet2" } ] } @@ -367,7 +375,7 @@ "Tags": [ { "Key": "Name", - "Value": "TestStack/VPC" + "Value": "integ-ec2-instance/VPC" } ] } @@ -383,15 +391,20 @@ } } }, - "InstanceInstanceSecurityGroupF0E2D5BE": { + "IntegSg68DC2C7E": { "Type": "AWS::EC2::SecurityGroup", "Properties": { - "GroupDescription": "TestStack/Instance/InstanceSecurityGroup", + "GroupDescription": "integ-ec2-instance/IntegSg", "SecurityGroupEgress": [ { "CidrIp": "0.0.0.0/0", "Description": "Allow all outbound traffic by default", "IpProtocol": "-1" + }, + { + "CidrIpv6": "::/0", + "Description": "Allow all outbound ipv6 traffic by default", + "IpProtocol": "-1" } ], "SecurityGroupIngress": [ @@ -403,12 +416,6 @@ "ToPort": -1 } ], - "Tags": [ - { - "Key": "Name", - "Value": "TestStack/Instance" - } - ], "VpcId": { "Ref": "VPCB9E5F0B4" } @@ -442,7 +449,7 @@ "Tags": [ { "Key": "Name", - "Value": "TestStack/Instance" + "Value": "integ-ec2-instance/Instance" } ] } @@ -500,7 +507,7 @@ "SecurityGroupIds": [ { "Fn::GetAtt": [ - "InstanceInstanceSecurityGroupF0E2D5BE", + "IntegSg68DC2C7E", "GroupId" ] } @@ -511,7 +518,7 @@ "Tags": [ { "Key": "Name", - "Value": "TestStack/Instance" + "Value": "integ-ec2-instance/Instance" } ], "UserData": { @@ -528,6 +535,38 @@ "SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amihvmx8664gp2C96584B6F00A464EAD1953AFF4B05118Parameter": { "Type": "AWS::SSM::Parameter::Value", "Default": "/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2" + }, + "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-ec2/test/instance.integ.snapshot/integ.json b/packages/@aws-cdk/aws-ec2/test/instance.integ.snapshot/integ.json index 7243b1ad2fbba..e74e5a37c593c 100644 --- a/packages/@aws-cdk/aws-ec2/test/instance.integ.snapshot/integ.json +++ b/packages/@aws-cdk/aws-ec2/test/instance.integ.snapshot/integ.json @@ -1,14 +1,12 @@ { - "version": "20.0.0", + "version": "21.0.0", "testCases": { - "integ.instance": { + "instance-test/DefaultTest": { "stacks": [ - "*" + "integ-ec2-instance" ], - "diffAssets": false, - "stackUpdateWorkflow": true + "assertionStack": "instance-test/DefaultTest/DeployAssert", + "assertionStackName": "instancetestDefaultTestDeployAssert5516EAF1" } - }, - "synthContext": {}, - "enableLookups": false + } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ec2/test/instance.integ.snapshot/manifest.json b/packages/@aws-cdk/aws-ec2/test/instance.integ.snapshot/manifest.json index c4f4c09ab6224..809d35d6b8f92 100644 --- a/packages/@aws-cdk/aws-ec2/test/instance.integ.snapshot/manifest.json +++ b/packages/@aws-cdk/aws-ec2/test/instance.integ.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "17.0.0", + "version": "21.0.0", "artifacts": { "Tree": { "type": "cdk:tree", @@ -7,190 +7,273 @@ "file": "tree.json" } }, - "TestStack": { + "integ-ec2-instance.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "integ-ec2-instance.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "integ-ec2-instance": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "TestStack.template.json", - "validateOnSynth": false + "templateFile": "integ-ec2-instance.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}/07dc2cd10d2741c8de44a54c2c57da82c0dc28b18e74ae53bfdb0eb3d8f26eff.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "integ-ec2-instance.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": [ + "integ-ec2-instance.assets" + ], "metadata": { - "/TestStack/VPC/Resource": [ + "/integ-ec2-instance/VPC/Resource": [ { "type": "aws:cdk:logicalId", "data": "VPCB9E5F0B4" } ], - "/TestStack/VPC/PublicSubnet1/Subnet": [ + "/integ-ec2-instance/VPC/PublicSubnet1/Subnet": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet1SubnetB4246D30" } ], - "/TestStack/VPC/PublicSubnet1/RouteTable": [ + "/integ-ec2-instance/VPC/PublicSubnet1/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet1RouteTableFEE4B781" } ], - "/TestStack/VPC/PublicSubnet1/RouteTableAssociation": [ + "/integ-ec2-instance/VPC/PublicSubnet1/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet1RouteTableAssociation0B0896DC" } ], - "/TestStack/VPC/PublicSubnet1/DefaultRoute": [ + "/integ-ec2-instance/VPC/PublicSubnet1/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet1DefaultRoute91CEF279" } ], - "/TestStack/VPC/PublicSubnet1/EIP": [ + "/integ-ec2-instance/VPC/PublicSubnet1/EIP": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet1EIP6AD938E8" } ], - "/TestStack/VPC/PublicSubnet1/NATGateway": [ + "/integ-ec2-instance/VPC/PublicSubnet1/NATGateway": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet1NATGatewayE0556630" } ], - "/TestStack/VPC/PublicSubnet2/Subnet": [ + "/integ-ec2-instance/VPC/PublicSubnet2/Subnet": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet2Subnet74179F39" } ], - "/TestStack/VPC/PublicSubnet2/RouteTable": [ + "/integ-ec2-instance/VPC/PublicSubnet2/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet2RouteTable6F1A15F1" } ], - "/TestStack/VPC/PublicSubnet2/RouteTableAssociation": [ + "/integ-ec2-instance/VPC/PublicSubnet2/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet2RouteTableAssociation5A808732" } ], - "/TestStack/VPC/PublicSubnet2/DefaultRoute": [ + "/integ-ec2-instance/VPC/PublicSubnet2/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet2DefaultRouteB7481BBA" } ], - "/TestStack/VPC/PublicSubnet2/EIP": [ + "/integ-ec2-instance/VPC/PublicSubnet2/EIP": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet2EIP4947BC00" } ], - "/TestStack/VPC/PublicSubnet2/NATGateway": [ + "/integ-ec2-instance/VPC/PublicSubnet2/NATGateway": [ { "type": "aws:cdk:logicalId", "data": "VPCPublicSubnet2NATGateway3C070193" } ], - "/TestStack/VPC/PrivateSubnet1/Subnet": [ + "/integ-ec2-instance/VPC/PrivateSubnet1/Subnet": [ { "type": "aws:cdk:logicalId", "data": "VPCPrivateSubnet1Subnet8BCA10E0" } ], - "/TestStack/VPC/PrivateSubnet1/RouteTable": [ + "/integ-ec2-instance/VPC/PrivateSubnet1/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "VPCPrivateSubnet1RouteTableBE8A6027" } ], - "/TestStack/VPC/PrivateSubnet1/RouteTableAssociation": [ + "/integ-ec2-instance/VPC/PrivateSubnet1/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "VPCPrivateSubnet1RouteTableAssociation347902D1" } ], - "/TestStack/VPC/PrivateSubnet1/DefaultRoute": [ + "/integ-ec2-instance/VPC/PrivateSubnet1/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "VPCPrivateSubnet1DefaultRouteAE1D6490" } ], - "/TestStack/VPC/PrivateSubnet2/Subnet": [ + "/integ-ec2-instance/VPC/PrivateSubnet2/Subnet": [ { "type": "aws:cdk:logicalId", "data": "VPCPrivateSubnet2SubnetCFCDAA7A" } ], - "/TestStack/VPC/PrivateSubnet2/RouteTable": [ + "/integ-ec2-instance/VPC/PrivateSubnet2/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "VPCPrivateSubnet2RouteTable0A19E10E" } ], - "/TestStack/VPC/PrivateSubnet2/RouteTableAssociation": [ + "/integ-ec2-instance/VPC/PrivateSubnet2/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "VPCPrivateSubnet2RouteTableAssociation0C73D413" } ], - "/TestStack/VPC/PrivateSubnet2/DefaultRoute": [ + "/integ-ec2-instance/VPC/PrivateSubnet2/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "VPCPrivateSubnet2DefaultRouteF4F5CFD2" } ], - "/TestStack/VPC/IGW": [ + "/integ-ec2-instance/VPC/IGW": [ { "type": "aws:cdk:logicalId", "data": "VPCIGWB7E252D3" } ], - "/TestStack/VPC/VPCGW": [ + "/integ-ec2-instance/VPC/VPCGW": [ { "type": "aws:cdk:logicalId", "data": "VPCVPCGW99B986DC" } ], - "/TestStack/Instance/InstanceSecurityGroup/Resource": [ + "/integ-ec2-instance/IntegSg/Resource": [ { "type": "aws:cdk:logicalId", - "data": "InstanceInstanceSecurityGroupF0E2D5BE" + "data": "IntegSg68DC2C7E" } ], - "/TestStack/Instance/InstanceRole/Resource": [ + "/integ-ec2-instance/Instance/InstanceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "InstanceInstanceRoleE9785DE5" } ], - "/TestStack/Instance/InstanceRole/DefaultPolicy/Resource": [ + "/integ-ec2-instance/Instance/InstanceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "InstanceInstanceRoleDefaultPolicy4ACE9290" } ], - "/TestStack/Instance/InstanceProfile": [ + "/integ-ec2-instance/Instance/InstanceProfile": [ { "type": "aws:cdk:logicalId", "data": "InstanceInstanceProfileAB5AEF02" } ], - "/TestStack/Instance/Resource": [ + "/integ-ec2-instance/Instance/Resource": [ { "type": "aws:cdk:logicalId", "data": "InstanceC1063A87" } ], - "/TestStack/SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ + "/integ-ec2-instance/SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ { "type": "aws:cdk:logicalId", "data": "SsmParameterValueawsserviceamiamazonlinuxlatestamzn2amihvmx8664gp2C96584B6F00A464EAD1953AFF4B05118Parameter" } + ], + "/integ-ec2-instance/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/integ-ec2-instance/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "integ-ec2-instance" + }, + "instancetestDefaultTestDeployAssert5516EAF1.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "instancetestDefaultTestDeployAssert5516EAF1.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "instancetestDefaultTestDeployAssert5516EAF1": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "instancetestDefaultTestDeployAssert5516EAF1.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": [ + "instancetestDefaultTestDeployAssert5516EAF1.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": [ + "instancetestDefaultTestDeployAssert5516EAF1.assets" + ], + "metadata": { + "/instance-test/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/instance-test/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } ] }, - "displayName": "TestStack" + "displayName": "instance-test/DefaultTest/DeployAssert" } } } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-ec2/test/instance.integ.snapshot/tree.json b/packages/@aws-cdk/aws-ec2/test/instance.integ.snapshot/tree.json index 563df0bce0ca7..9392bd3b48595 100644 --- a/packages/@aws-cdk/aws-ec2/test/instance.integ.snapshot/tree.json +++ b/packages/@aws-cdk/aws-ec2/test/instance.integ.snapshot/tree.json @@ -8,21 +8,21 @@ "id": "Tree", "path": "Tree", "constructInfo": { - "fqn": "@aws-cdk/core.Construct", - "version": "0.0.0" + "fqn": "constructs.Construct", + "version": "10.1.123" } }, - "TestStack": { - "id": "TestStack", - "path": "TestStack", + "integ-ec2-instance": { + "id": "integ-ec2-instance", + "path": "integ-ec2-instance", "children": { "VPC": { "id": "VPC", - "path": "TestStack/VPC", + "path": "integ-ec2-instance/VPC", "children": { "Resource": { "id": "Resource", - "path": "TestStack/VPC/Resource", + "path": "integ-ec2-instance/VPC/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::VPC", "aws:cdk:cloudformation:props": { @@ -33,7 +33,7 @@ "tags": [ { "key": "Name", - "value": "TestStack/VPC" + "value": "integ-ec2-instance/VPC" } ] } @@ -45,11 +45,11 @@ }, "PublicSubnet1": { "id": "PublicSubnet1", - "path": "TestStack/VPC/PublicSubnet1", + "path": "integ-ec2-instance/VPC/PublicSubnet1", "children": { "Subnet": { "id": "Subnet", - "path": "TestStack/VPC/PublicSubnet1/Subnet", + "path": "integ-ec2-instance/VPC/PublicSubnet1/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { @@ -77,7 +77,7 @@ }, { "key": "Name", - "value": "TestStack/VPC/PublicSubnet1" + "value": "integ-ec2-instance/VPC/PublicSubnet1" } ] } @@ -89,7 +89,7 @@ }, "Acl": { "id": "Acl", - "path": "TestStack/VPC/PublicSubnet1/Acl", + "path": "integ-ec2-instance/VPC/PublicSubnet1/Acl", "constructInfo": { "fqn": "@aws-cdk/core.Resource", "version": "0.0.0" @@ -97,7 +97,7 @@ }, "RouteTable": { "id": "RouteTable", - "path": "TestStack/VPC/PublicSubnet1/RouteTable", + "path": "integ-ec2-instance/VPC/PublicSubnet1/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { @@ -107,7 +107,7 @@ "tags": [ { "key": "Name", - "value": "TestStack/VPC/PublicSubnet1" + "value": "integ-ec2-instance/VPC/PublicSubnet1" } ] } @@ -119,7 +119,7 @@ }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "TestStack/VPC/PublicSubnet1/RouteTableAssociation", + "path": "integ-ec2-instance/VPC/PublicSubnet1/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -138,7 +138,7 @@ }, "DefaultRoute": { "id": "DefaultRoute", - "path": "TestStack/VPC/PublicSubnet1/DefaultRoute", + "path": "integ-ec2-instance/VPC/PublicSubnet1/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { @@ -158,7 +158,7 @@ }, "EIP": { "id": "EIP", - "path": "TestStack/VPC/PublicSubnet1/EIP", + "path": "integ-ec2-instance/VPC/PublicSubnet1/EIP", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::EIP", "aws:cdk:cloudformation:props": { @@ -166,7 +166,7 @@ "tags": [ { "key": "Name", - "value": "TestStack/VPC/PublicSubnet1" + "value": "integ-ec2-instance/VPC/PublicSubnet1" } ] } @@ -178,7 +178,7 @@ }, "NATGateway": { "id": "NATGateway", - "path": "TestStack/VPC/PublicSubnet1/NATGateway", + "path": "integ-ec2-instance/VPC/PublicSubnet1/NATGateway", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", "aws:cdk:cloudformation:props": { @@ -194,7 +194,7 @@ "tags": [ { "key": "Name", - "value": "TestStack/VPC/PublicSubnet1" + "value": "integ-ec2-instance/VPC/PublicSubnet1" } ] } @@ -212,11 +212,11 @@ }, "PublicSubnet2": { "id": "PublicSubnet2", - "path": "TestStack/VPC/PublicSubnet2", + "path": "integ-ec2-instance/VPC/PublicSubnet2", "children": { "Subnet": { "id": "Subnet", - "path": "TestStack/VPC/PublicSubnet2/Subnet", + "path": "integ-ec2-instance/VPC/PublicSubnet2/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { @@ -244,7 +244,7 @@ }, { "key": "Name", - "value": "TestStack/VPC/PublicSubnet2" + "value": "integ-ec2-instance/VPC/PublicSubnet2" } ] } @@ -256,7 +256,7 @@ }, "Acl": { "id": "Acl", - "path": "TestStack/VPC/PublicSubnet2/Acl", + "path": "integ-ec2-instance/VPC/PublicSubnet2/Acl", "constructInfo": { "fqn": "@aws-cdk/core.Resource", "version": "0.0.0" @@ -264,7 +264,7 @@ }, "RouteTable": { "id": "RouteTable", - "path": "TestStack/VPC/PublicSubnet2/RouteTable", + "path": "integ-ec2-instance/VPC/PublicSubnet2/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { @@ -274,7 +274,7 @@ "tags": [ { "key": "Name", - "value": "TestStack/VPC/PublicSubnet2" + "value": "integ-ec2-instance/VPC/PublicSubnet2" } ] } @@ -286,7 +286,7 @@ }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "TestStack/VPC/PublicSubnet2/RouteTableAssociation", + "path": "integ-ec2-instance/VPC/PublicSubnet2/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -305,7 +305,7 @@ }, "DefaultRoute": { "id": "DefaultRoute", - "path": "TestStack/VPC/PublicSubnet2/DefaultRoute", + "path": "integ-ec2-instance/VPC/PublicSubnet2/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { @@ -325,7 +325,7 @@ }, "EIP": { "id": "EIP", - "path": "TestStack/VPC/PublicSubnet2/EIP", + "path": "integ-ec2-instance/VPC/PublicSubnet2/EIP", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::EIP", "aws:cdk:cloudformation:props": { @@ -333,7 +333,7 @@ "tags": [ { "key": "Name", - "value": "TestStack/VPC/PublicSubnet2" + "value": "integ-ec2-instance/VPC/PublicSubnet2" } ] } @@ -345,7 +345,7 @@ }, "NATGateway": { "id": "NATGateway", - "path": "TestStack/VPC/PublicSubnet2/NATGateway", + "path": "integ-ec2-instance/VPC/PublicSubnet2/NATGateway", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", "aws:cdk:cloudformation:props": { @@ -361,7 +361,7 @@ "tags": [ { "key": "Name", - "value": "TestStack/VPC/PublicSubnet2" + "value": "integ-ec2-instance/VPC/PublicSubnet2" } ] } @@ -379,11 +379,11 @@ }, "PrivateSubnet1": { "id": "PrivateSubnet1", - "path": "TestStack/VPC/PrivateSubnet1", + "path": "integ-ec2-instance/VPC/PrivateSubnet1", "children": { "Subnet": { "id": "Subnet", - "path": "TestStack/VPC/PrivateSubnet1/Subnet", + "path": "integ-ec2-instance/VPC/PrivateSubnet1/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { @@ -411,7 +411,7 @@ }, { "key": "Name", - "value": "TestStack/VPC/PrivateSubnet1" + "value": "integ-ec2-instance/VPC/PrivateSubnet1" } ] } @@ -423,7 +423,7 @@ }, "Acl": { "id": "Acl", - "path": "TestStack/VPC/PrivateSubnet1/Acl", + "path": "integ-ec2-instance/VPC/PrivateSubnet1/Acl", "constructInfo": { "fqn": "@aws-cdk/core.Resource", "version": "0.0.0" @@ -431,7 +431,7 @@ }, "RouteTable": { "id": "RouteTable", - "path": "TestStack/VPC/PrivateSubnet1/RouteTable", + "path": "integ-ec2-instance/VPC/PrivateSubnet1/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { @@ -441,7 +441,7 @@ "tags": [ { "key": "Name", - "value": "TestStack/VPC/PrivateSubnet1" + "value": "integ-ec2-instance/VPC/PrivateSubnet1" } ] } @@ -453,7 +453,7 @@ }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "TestStack/VPC/PrivateSubnet1/RouteTableAssociation", + "path": "integ-ec2-instance/VPC/PrivateSubnet1/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -472,7 +472,7 @@ }, "DefaultRoute": { "id": "DefaultRoute", - "path": "TestStack/VPC/PrivateSubnet1/DefaultRoute", + "path": "integ-ec2-instance/VPC/PrivateSubnet1/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { @@ -498,11 +498,11 @@ }, "PrivateSubnet2": { "id": "PrivateSubnet2", - "path": "TestStack/VPC/PrivateSubnet2", + "path": "integ-ec2-instance/VPC/PrivateSubnet2", "children": { "Subnet": { "id": "Subnet", - "path": "TestStack/VPC/PrivateSubnet2/Subnet", + "path": "integ-ec2-instance/VPC/PrivateSubnet2/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { @@ -530,7 +530,7 @@ }, { "key": "Name", - "value": "TestStack/VPC/PrivateSubnet2" + "value": "integ-ec2-instance/VPC/PrivateSubnet2" } ] } @@ -542,7 +542,7 @@ }, "Acl": { "id": "Acl", - "path": "TestStack/VPC/PrivateSubnet2/Acl", + "path": "integ-ec2-instance/VPC/PrivateSubnet2/Acl", "constructInfo": { "fqn": "@aws-cdk/core.Resource", "version": "0.0.0" @@ -550,7 +550,7 @@ }, "RouteTable": { "id": "RouteTable", - "path": "TestStack/VPC/PrivateSubnet2/RouteTable", + "path": "integ-ec2-instance/VPC/PrivateSubnet2/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { @@ -560,7 +560,7 @@ "tags": [ { "key": "Name", - "value": "TestStack/VPC/PrivateSubnet2" + "value": "integ-ec2-instance/VPC/PrivateSubnet2" } ] } @@ -572,7 +572,7 @@ }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "TestStack/VPC/PrivateSubnet2/RouteTableAssociation", + "path": "integ-ec2-instance/VPC/PrivateSubnet2/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -591,7 +591,7 @@ }, "DefaultRoute": { "id": "DefaultRoute", - "path": "TestStack/VPC/PrivateSubnet2/DefaultRoute", + "path": "integ-ec2-instance/VPC/PrivateSubnet2/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { @@ -617,14 +617,14 @@ }, "IGW": { "id": "IGW", - "path": "TestStack/VPC/IGW", + "path": "integ-ec2-instance/VPC/IGW", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", "aws:cdk:cloudformation:props": { "tags": [ { "key": "Name", - "value": "TestStack/VPC" + "value": "integ-ec2-instance/VPC" } ] } @@ -636,7 +636,7 @@ }, "VPCGW": { "id": "VPCGW", - "path": "TestStack/VPC/VPCGW", + "path": "integ-ec2-instance/VPC/VPCGW", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", "aws:cdk:cloudformation:props": { @@ -659,66 +659,65 @@ "version": "0.0.0" } }, - "Instance": { - "id": "Instance", - "path": "TestStack/Instance", + "IntegSg": { + "id": "IntegSg", + "path": "integ-ec2-instance/IntegSg", "children": { - "InstanceSecurityGroup": { - "id": "InstanceSecurityGroup", - "path": "TestStack/Instance/InstanceSecurityGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "TestStack/Instance/InstanceSecurityGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", - "aws:cdk:cloudformation:props": { - "groupDescription": "TestStack/Instance/InstanceSecurityGroup", - "securityGroupEgress": [ - { - "cidrIp": "0.0.0.0/0", - "description": "Allow all outbound traffic by default", - "ipProtocol": "-1" - } - ], - "securityGroupIngress": [ - { - "cidrIp": "0.0.0.0/0", - "ipProtocol": "icmp", - "fromPort": 8, - "toPort": -1, - "description": "from 0.0.0.0/0:ICMP Type 8" - } - ], - "tags": [ - { - "key": "Name", - "value": "TestStack/Instance" - } - ], - "vpcId": { - "Ref": "VPCB9E5F0B4" - } + "Resource": { + "id": "Resource", + "path": "integ-ec2-instance/IntegSg/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "integ-ec2-instance/IntegSg", + "securityGroupEgress": [ + { + "cidrIp": "0.0.0.0/0", + "description": "Allow all outbound traffic by default", + "ipProtocol": "-1" + }, + { + "ipProtocol": "-1", + "cidrIpv6": "::/0", + "description": "Allow all outbound ipv6 traffic by default" } - }, - "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", - "version": "0.0.0" + ], + "securityGroupIngress": [ + { + "cidrIp": "0.0.0.0/0", + "ipProtocol": "icmp", + "fromPort": 8, + "toPort": -1, + "description": "from 0.0.0.0/0:ICMP Type 8" + } + ], + "vpcId": { + "Ref": "VPCB9E5F0B4" } } }, "constructInfo": { - "fqn": "@aws-cdk/aws-ec2.SecurityGroup", + "fqn": "@aws-cdk/aws-ec2.CfnSecurityGroup", "version": "0.0.0" } - }, + } + }, + "constructInfo": { + "fqn": "@aws-cdk/aws-ec2.SecurityGroup", + "version": "0.0.0" + } + }, + "Instance": { + "id": "Instance", + "path": "integ-ec2-instance/Instance", + "children": { "InstanceRole": { "id": "InstanceRole", - "path": "TestStack/Instance/InstanceRole", + "path": "integ-ec2-instance/Instance/InstanceRole", "children": { "Resource": { "id": "Resource", - "path": "TestStack/Instance/InstanceRole/Resource", + "path": "integ-ec2-instance/Instance/InstanceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -747,7 +746,7 @@ "tags": [ { "key": "Name", - "value": "TestStack/Instance" + "value": "integ-ec2-instance/Instance" } ] } @@ -759,11 +758,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "TestStack/Instance/InstanceRole/DefaultPolicy", + "path": "integ-ec2-instance/Instance/InstanceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "TestStack/Instance/InstanceRole/DefaultPolicy/Resource", + "path": "integ-ec2-instance/Instance/InstanceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -804,7 +803,7 @@ }, "InstanceProfile": { "id": "InstanceProfile", - "path": "TestStack/Instance/InstanceProfile", + "path": "integ-ec2-instance/Instance/InstanceProfile", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::InstanceProfile", "aws:cdk:cloudformation:props": { @@ -822,7 +821,7 @@ }, "Resource": { "id": "Resource", - "path": "TestStack/Instance/Resource", + "path": "integ-ec2-instance/Instance/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Instance", "aws:cdk:cloudformation:props": { @@ -845,7 +844,7 @@ "securityGroupIds": [ { "Fn::GetAtt": [ - "InstanceInstanceSecurityGroupF0E2D5BE", + "IntegSg68DC2C7E", "GroupId" ] } @@ -856,7 +855,7 @@ "tags": [ { "key": "Name", - "value": "TestStack/Instance" + "value": "integ-ec2-instance/Instance" } ], "userData": { @@ -877,7 +876,7 @@ }, "SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": { "id": "SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", - "path": "TestStack/SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", + "path": "integ-ec2-instance/SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", "constructInfo": { "fqn": "@aws-cdk/core.CfnParameter", "version": "0.0.0" @@ -885,7 +884,7 @@ }, "SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118": { "id": "SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118", - "path": "TestStack/SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118", + "path": "integ-ec2-instance/SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn2-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118", "constructInfo": { "fqn": "@aws-cdk/core.Resource", "version": "0.0.0" @@ -896,6 +895,42 @@ "fqn": "@aws-cdk/core.Stack", "version": "0.0.0" } + }, + "instance-test": { + "id": "instance-test", + "path": "instance-test", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "instance-test/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "instance-test/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.1.123" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "instance-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": { diff --git a/packages/@aws-cdk/aws-ec2/test/integ.instance.ts b/packages/@aws-cdk/aws-ec2/test/integ.instance.ts index 1b120c511eaaa..24333b3e32757 100644 --- a/packages/@aws-cdk/aws-ec2/test/integ.instance.ts +++ b/packages/@aws-cdk/aws-ec2/test/integ.instance.ts @@ -1,6 +1,6 @@ -/// !cdk-integ * import { PolicyStatement } from '@aws-cdk/aws-iam'; import * as cdk from '@aws-cdk/core'; +import { IntegTest } from '@aws-cdk/integ-tests'; import * as ec2 from '../lib'; const app = new cdk.App(); @@ -10,9 +10,14 @@ class TestStack extends cdk.Stack { super(scope, id, props); const vpc = new ec2.Vpc(this, 'VPC'); + const securityGroup = new ec2.SecurityGroup(this, 'IntegSg', { + vpc, + allowAllIpv6Outbound: true, + }); const instance = new ec2.Instance(this, 'Instance', { vpc, + securityGroup, instanceType: ec2.InstanceType.of(ec2.InstanceClass.T3, ec2.InstanceSize.NANO), machineImage: new ec2.AmazonLinuxImage({ generation: ec2.AmazonLinuxGeneration.AMAZON_LINUX_2 }), detailedMonitoring: true, @@ -29,6 +34,8 @@ class TestStack extends cdk.Stack { } } -new TestStack(app, 'TestStack'); +const testCase = new TestStack(app, 'integ-ec2-instance'); -app.synth(); +new IntegTest(app, 'instance-test', { + testCases: [testCase], +}); diff --git a/packages/@aws-cdk/aws-ec2/test/security-group.test.ts b/packages/@aws-cdk/aws-ec2/test/security-group.test.ts index bee7ec9cceede..a480c53f58dfa 100644 --- a/packages/@aws-cdk/aws-ec2/test/security-group.test.ts +++ b/packages/@aws-cdk/aws-ec2/test/security-group.test.ts @@ -43,7 +43,7 @@ describe('security group', () => { IpProtocol: '-1', }, { - CidrIp: '::/0', + CidrIpv6: '::/0', Description: 'Allow all outbound ipv6 traffic by default', IpProtocol: '-1', },