From 942ca1ed78dd058044d8f585da1ace09923f4eae Mon Sep 17 00:00:00 2001 From: Kazuho CryerShinozuka Date: Mon, 25 Dec 2023 22:12:44 +0900 Subject: [PATCH 01/10] chore: addNvidiaImage --- packages/aws-cdk-lib/aws-ecs/lib/amis.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/aws-cdk-lib/aws-ecs/lib/amis.ts b/packages/aws-cdk-lib/aws-ecs/lib/amis.ts index 52fcc44f45210..2c870c14ddb1f 100644 --- a/packages/aws-cdk-lib/aws-ecs/lib/amis.ts +++ b/packages/aws-cdk-lib/aws-ecs/lib/amis.ts @@ -298,8 +298,11 @@ export enum BottlerocketEcsVariant { /** * aws-ecs-1 variant */ - AWS_ECS_1 = 'aws-ecs-1' - + AWS_ECS_1 = 'aws-ecs-1', + /** + * aws-ecs-1-nvidia variant + */ + AWS_ECS_1_NVIDIA = 'aws-ecs-1-nvidia', } /** @@ -308,7 +311,6 @@ export enum BottlerocketEcsVariant { export interface BottleRocketImageProps { /** * The Amazon ECS variant to use. - * Only `aws-ecs-1` is currently available * * @default - BottlerocketEcsVariant.AWS_ECS_1 */ From 8bc9c7a82018898c2017e5e7fbb247adea7e6ca9 Mon Sep 17 00:00:00 2001 From: Kazuho CryerShinozuka Date: Mon, 25 Dec 2023 22:38:11 +0900 Subject: [PATCH 02/10] docs: readme --- packages/aws-cdk-lib/aws-ecs/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/aws-cdk-lib/aws-ecs/README.md b/packages/aws-cdk-lib/aws-ecs/README.md index 134101df92cd8..19eeca0a6a0b2 100644 --- a/packages/aws-cdk-lib/aws-ecs/README.md +++ b/packages/aws-cdk-lib/aws-ecs/README.md @@ -222,6 +222,20 @@ cluster.addCapacity('bottlerocket-asg', { }); ``` +You can also specify an NVIDIA-compatible AMI such as in this example: + +```ts +declare const cluster: ecs.Cluster; + +cluster.addCapacity('bottlerocket-asg', { + minCapacity: 2, + instanceType: new ec2.InstanceType('c5.large'), + machineImage: new ecs.BottleRocketImage({ + variant: ecs.BottlerocketEcsVariant.AWS_ECS_1_NVIDIA, + }), +}); +``` + ### ARM64 (Graviton) Instances To launch instances with ARM64 hardware, you can use the Amazon ECS-optimized From ae9a0c6d5d8dfd4b09e082c186689a24b4113d4b Mon Sep 17 00:00:00 2001 From: Kazuho CryerShinozuka Date: Mon, 25 Dec 2023 23:11:44 +0900 Subject: [PATCH 03/10] test: integ test --- ...-integ-nvidia-bottlerocket-ami.assets.json | 19 + ...nteg-nvidia-bottlerocket-ami.template.json | 965 ++++++++++ ...efaultTestDeployAssert738BB89C.assets.json | 19 + ...aultTestDeployAssert738BB89C.template.json | 36 + .../cdk.out | 1 + .../integ.json | 12 + .../manifest.json | 347 ++++ .../tree.json | 1583 +++++++++++++++++ .../integ.cluster-nvidia-bottlerocket-ami.ts | 26 + 9 files changed, 3008 insertions(+) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/aws-ecs-integ-nvidia-bottlerocket-ami.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/aws-ecs-integ-nvidia-bottlerocket-ami.template.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C.template.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/cdk.out create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/integ.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/manifest.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/tree.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.ts diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/aws-ecs-integ-nvidia-bottlerocket-ami.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/aws-ecs-integ-nvidia-bottlerocket-ami.assets.json new file mode 100644 index 0000000000000..535c1097372f8 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/aws-ecs-integ-nvidia-bottlerocket-ami.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "602e26b0cd1d9acf07d33ab9cf214ebcbfccb55ce2b48db80e802eb4c4ad6307": { + "source": { + "path": "aws-ecs-integ-nvidia-bottlerocket-ami.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "602e26b0cd1d9acf07d33ab9cf214ebcbfccb55ce2b48db80e802eb4c4ad6307.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-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/aws-ecs-integ-nvidia-bottlerocket-ami.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/aws-ecs-integ-nvidia-bottlerocket-ami.template.json new file mode 100644 index 0000000000000..883e86b3d4138 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/aws-ecs-integ-nvidia-bottlerocket-ami.template.json @@ -0,0 +1,965 @@ +{ + "Resources": { + "Vpc8378EB38": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc" + } + ] + } + }, + "VpcPublicSubnet1Subnet5C2D37C4": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.0.0/18", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPublicSubnet1RouteTable6C95E38E": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPublicSubnet1RouteTableAssociation97140677": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcPublicSubnet1RouteTable6C95E38E" + }, + "SubnetId": { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + } + } + }, + "VpcPublicSubnet1DefaultRoute3DA9E72A": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "RouteTableId": { + "Ref": "VpcPublicSubnet1RouteTable6C95E38E" + } + }, + "DependsOn": [ + "VpcVPCGWBF912B6E" + ] + }, + "VpcPublicSubnet1EIPD7E02669": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1" + } + ] + } + }, + "VpcPublicSubnet1NATGateway4D7517AA": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "VpcPublicSubnet1EIPD7E02669", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1" + } + ] + }, + "DependsOn": [ + "VpcPublicSubnet1DefaultRoute3DA9E72A", + "VpcPublicSubnet1RouteTableAssociation97140677" + ] + }, + "VpcPublicSubnet2Subnet691E08A3": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.64.0/18", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPublicSubnet2RouteTable94F7E489": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPublicSubnet2RouteTableAssociationDD5762D8": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcPublicSubnet2RouteTable94F7E489" + }, + "SubnetId": { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + } + } + }, + "VpcPublicSubnet2DefaultRoute97F91067": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "RouteTableId": { + "Ref": "VpcPublicSubnet2RouteTable94F7E489" + } + }, + "DependsOn": [ + "VpcVPCGWBF912B6E" + ] + }, + "VpcPublicSubnet2EIP3C605A87": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2" + } + ] + } + }, + "VpcPublicSubnet2NATGateway9182C01D": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "VpcPublicSubnet2EIP3C605A87", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2" + } + ] + }, + "DependsOn": [ + "VpcPublicSubnet2DefaultRoute97F91067", + "VpcPublicSubnet2RouteTableAssociationDD5762D8" + ] + }, + "VpcPrivateSubnet1Subnet536B997A": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.128.0/18", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPrivateSubnet1RouteTableB2C5B500": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPrivateSubnet1RouteTableAssociation70C59FA6": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcPrivateSubnet1RouteTableB2C5B500" + }, + "SubnetId": { + "Ref": "VpcPrivateSubnet1Subnet536B997A" + } + } + }, + "VpcPrivateSubnet1DefaultRouteBE02A9ED": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "VpcPublicSubnet1NATGateway4D7517AA" + }, + "RouteTableId": { + "Ref": "VpcPrivateSubnet1RouteTableB2C5B500" + } + } + }, + "VpcPrivateSubnet2Subnet3788AAA1": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.192.0/18", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPrivateSubnet2RouteTableA678073B": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPrivateSubnet2RouteTableAssociationA89CAD56": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcPrivateSubnet2RouteTableA678073B" + }, + "SubnetId": { + "Ref": "VpcPrivateSubnet2Subnet3788AAA1" + } + } + }, + "VpcPrivateSubnet2DefaultRoute060D2087": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "VpcPublicSubnet2NATGateway9182C01D" + }, + "RouteTableId": { + "Ref": "VpcPrivateSubnet2RouteTableA678073B" + } + } + }, + "VpcIGWD7BA715C": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc" + } + ] + } + }, + "VpcVPCGWBF912B6E": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "InternetGatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "ClusterEB0386A7": { + "Type": "AWS::ECS::Cluster" + }, + "ClusterbottlerocketasgInstanceSecurityGroupE1EAEF75": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceSecurityGroup", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "ClusterbottlerocketasgInstanceRoleD105ACA5": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/AmazonSSMManagedInstanceCore" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role" + ] + ] + } + ], + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg" + } + ] + } + }, + "ClusterbottlerocketasgInstanceRoleDefaultPolicyBB6119DC": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecs:DeregisterContainerInstance", + "ecs:RegisterContainerInstance", + "ecs:Submit*" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ClusterEB0386A7", + "Arn" + ] + } + }, + { + "Action": [ + "ecs:Poll", + "ecs:StartTelemetrySession" + ], + "Condition": { + "ArnEquals": { + "ecs:cluster": { + "Fn::GetAtt": [ + "ClusterEB0386A7", + "Arn" + ] + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecr:GetAuthorizationToken", + "ecs:DiscoverPollEndpoint", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ClusterbottlerocketasgInstanceRoleDefaultPolicyBB6119DC", + "Roles": [ + { + "Ref": "ClusterbottlerocketasgInstanceRoleD105ACA5" + } + ] + } + }, + "ClusterbottlerocketasgInstanceProfile424C4AC3": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "ClusterbottlerocketasgInstanceRoleD105ACA5" + } + ] + } + }, + "ClusterbottlerocketasgLaunchTemplate45A2FA5C": { + "Type": "AWS::EC2::LaunchTemplate", + "Properties": { + "LaunchTemplateData": { + "IamInstanceProfile": { + "Arn": { + "Fn::GetAtt": [ + "ClusterbottlerocketasgInstanceProfile424C4AC3", + "Arn" + ] + } + }, + "ImageId": { + "Ref": "SsmParameterValueawsservicebottlerocketawsecs1x8664latestimageidC96584B6F00A464EAD1953AFF4B05118Parameter" + }, + "InstanceType": "c5.large", + "Monitoring": { + "Enabled": false + }, + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "ClusterbottlerocketasgInstanceSecurityGroupE1EAEF75", + "GroupId" + ] + } + ], + "TagSpecifications": [ + { + "ResourceType": "instance", + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LaunchTemplate" + } + ] + }, + { + "ResourceType": "volume", + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LaunchTemplate" + } + ] + } + ], + "UserData": { + "Fn::Base64": { + "Fn::Join": [ + "", + [ + "\n[settings.ecs]\ncluster = \"", + { + "Ref": "ClusterEB0386A7" + }, + "\"" + ] + ] + } + } + }, + "TagSpecifications": [ + { + "ResourceType": "launch-template", + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LaunchTemplate" + } + ] + } + ] + }, + "DependsOn": [ + "ClusterbottlerocketasgInstanceRoleDefaultPolicyBB6119DC", + "ClusterbottlerocketasgInstanceRoleD105ACA5" + ] + }, + "ClusterbottlerocketasgASG5424825A": { + "Type": "AWS::AutoScaling::AutoScalingGroup", + "Properties": { + "LaunchTemplate": { + "LaunchTemplateId": { + "Ref": "ClusterbottlerocketasgLaunchTemplate45A2FA5C" + }, + "Version": { + "Fn::GetAtt": [ + "ClusterbottlerocketasgLaunchTemplate45A2FA5C", + "LatestVersionNumber" + ] + } + }, + "MaxSize": "2", + "MinSize": "2", + "Tags": [ + { + "Key": "Name", + "PropagateAtLaunch": true, + "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg" + } + ], + "VPCZoneIdentifier": [ + { + "Ref": "VpcPrivateSubnet1Subnet536B997A" + }, + { + "Ref": "VpcPrivateSubnet2Subnet3788AAA1" + } + ] + }, + "UpdatePolicy": { + "AutoScalingReplacingUpdate": { + "WillReplace": true + }, + "AutoScalingScheduledAction": { + "IgnoreUnmodifiedGroupSizeProperties": true + } + } + }, + "ClusterbottlerocketasgDrainECSHookFunctionServiceRole91B0C3B3": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ], + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg" + } + ] + } + }, + "ClusterbottlerocketasgDrainECSHookFunctionServiceRoleDefaultPolicyBD9C646C": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ec2:DescribeHosts", + "ec2:DescribeInstanceAttribute", + "ec2:DescribeInstanceStatus", + "ec2:DescribeInstances" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "autoscaling:CompleteLifecycleAction", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":autoscaling:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":autoScalingGroup:*:autoScalingGroupName/", + { + "Ref": "ClusterbottlerocketasgASG5424825A" + } + ] + ] + } + }, + { + "Action": [ + "ecs:DescribeContainerInstances", + "ecs:DescribeTasks", + "ecs:ListTasks", + "ecs:UpdateContainerInstancesState" + ], + "Condition": { + "ArnEquals": { + "ecs:cluster": { + "Fn::GetAtt": [ + "ClusterEB0386A7", + "Arn" + ] + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecs:ListContainerInstances", + "ecs:SubmitContainerStateChange", + "ecs:SubmitTaskStateChange" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ClusterEB0386A7", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ClusterbottlerocketasgDrainECSHookFunctionServiceRoleDefaultPolicyBD9C646C", + "Roles": [ + { + "Ref": "ClusterbottlerocketasgDrainECSHookFunctionServiceRole91B0C3B3" + } + ] + } + }, + "ClusterbottlerocketasgDrainECSHookFunctionFEA27227": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "import boto3, json, os, time\n\necs = boto3.client('ecs')\nautoscaling = boto3.client('autoscaling')\n\n\ndef lambda_handler(event, context):\n print(json.dumps(dict(event, ResponseURL='...')))\n cluster = os.environ['CLUSTER']\n snsTopicArn = event['Records'][0]['Sns']['TopicArn']\n lifecycle_event = json.loads(event['Records'][0]['Sns']['Message'])\n instance_id = lifecycle_event.get('EC2InstanceId')\n if not instance_id:\n print('Got event without EC2InstanceId: %s', json.dumps(dict(event, ResponseURL='...')))\n return\n\n instance_arn = container_instance_arn(cluster, instance_id)\n print('Instance %s has container instance ARN %s' % (lifecycle_event['EC2InstanceId'], instance_arn))\n\n if not instance_arn:\n return\n\n task_arns = container_instance_task_arns(cluster, instance_arn)\n\n if task_arns:\n print('Instance ARN %s has task ARNs %s' % (instance_arn, ', '.join(task_arns)))\n\n while has_tasks(cluster, instance_arn, task_arns):\n time.sleep(10)\n\n try:\n print('Terminating instance %s' % instance_id)\n autoscaling.complete_lifecycle_action(\n LifecycleActionResult='CONTINUE',\n **pick(lifecycle_event, 'LifecycleHookName', 'LifecycleActionToken', 'AutoScalingGroupName'))\n except Exception as e:\n # Lifecycle action may have already completed.\n print(str(e))\n\n\ndef container_instance_arn(cluster, instance_id):\n \"\"\"Turn an instance ID into a container instance ARN.\"\"\"\n arns = ecs.list_container_instances(cluster=cluster, filter='ec2InstanceId==' + instance_id)['containerInstanceArns']\n if not arns:\n return None\n return arns[0]\n\ndef container_instance_task_arns(cluster, instance_arn):\n \"\"\"Fetch tasks for a container instance ARN.\"\"\"\n arns = ecs.list_tasks(cluster=cluster, containerInstance=instance_arn)['taskArns']\n return arns\n\ndef has_tasks(cluster, instance_arn, task_arns):\n \"\"\"Return True if the instance is running tasks for the given cluster.\"\"\"\n instances = ecs.describe_container_instances(cluster=cluster, containerInstances=[instance_arn])['containerInstances']\n if not instances:\n return False\n instance = instances[0]\n\n if instance['status'] == 'ACTIVE':\n # Start draining, then try again later\n set_container_instance_to_draining(cluster, instance_arn)\n return True\n\n task_count = None\n\n if task_arns:\n # Fetch details for tasks running on the container instance\n tasks = ecs.describe_tasks(cluster=cluster, tasks=task_arns)['tasks']\n if tasks:\n # Consider any non-stopped tasks as running\n task_count = sum(task['lastStatus'] != 'STOPPED' for task in tasks) + instance['pendingTasksCount']\n\n if not task_count:\n # Fallback to instance task counts if detailed task information is unavailable\n task_count = instance['runningTasksCount'] + instance['pendingTasksCount']\n\n print('Instance %s has %s tasks' % (instance_arn, task_count))\n\n return task_count > 0\n\ndef set_container_instance_to_draining(cluster, instance_arn):\n ecs.update_container_instances_state(\n cluster=cluster,\n containerInstances=[instance_arn], status='DRAINING')\n\n\ndef pick(dct, *keys):\n \"\"\"Pick a subset of a dict.\"\"\"\n return {k: v for k, v in dct.items() if k in keys}\n" + }, + "Environment": { + "Variables": { + "CLUSTER": { + "Ref": "ClusterEB0386A7" + } + } + }, + "Handler": "index.lambda_handler", + "Role": { + "Fn::GetAtt": [ + "ClusterbottlerocketasgDrainECSHookFunctionServiceRole91B0C3B3", + "Arn" + ] + }, + "Runtime": "python3.9", + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg" + } + ], + "Timeout": 310 + }, + "DependsOn": [ + "ClusterbottlerocketasgDrainECSHookFunctionServiceRoleDefaultPolicyBD9C646C", + "ClusterbottlerocketasgDrainECSHookFunctionServiceRole91B0C3B3" + ] + }, + "ClusterbottlerocketasgDrainECSHookFunctionAllowInvokeawsecsintegnvidiabottlerocketamiClusterbottlerocketasgLifecycleHookDrainHookTopic0F834B74E5C20074": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "ClusterbottlerocketasgDrainECSHookFunctionFEA27227", + "Arn" + ] + }, + "Principal": "sns.amazonaws.com", + "SourceArn": { + "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" + } + } + }, + "ClusterbottlerocketasgDrainECSHookFunctionTopicC875173C": { + "Type": "AWS::SNS::Subscription", + "Properties": { + "Endpoint": { + "Fn::GetAtt": [ + "ClusterbottlerocketasgDrainECSHookFunctionFEA27227", + "Arn" + ] + }, + "Protocol": "lambda", + "TopicArn": { + "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" + } + } + }, + "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02": { + "Type": "AWS::SNS::Topic", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg" + } + ] + } + }, + "ClusterbottlerocketasgLifecycleHookDrainHookRole9E2A1D11": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "autoscaling.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg" + } + ] + } + }, + "ClusterbottlerocketasgLifecycleHookDrainHookRoleDefaultPolicy2C98DD9A": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "sns:Publish", + "Effect": "Allow", + "Resource": { + "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ClusterbottlerocketasgLifecycleHookDrainHookRoleDefaultPolicy2C98DD9A", + "Roles": [ + { + "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookRole9E2A1D11" + } + ] + } + }, + "ClusterbottlerocketasgLifecycleHookDrainHook00055B9D": { + "Type": "AWS::AutoScaling::LifecycleHook", + "Properties": { + "AutoScalingGroupName": { + "Ref": "ClusterbottlerocketasgASG5424825A" + }, + "DefaultResult": "CONTINUE", + "HeartbeatTimeout": 300, + "LifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING", + "NotificationTargetARN": { + "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" + }, + "RoleARN": { + "Fn::GetAtt": [ + "ClusterbottlerocketasgLifecycleHookDrainHookRole9E2A1D11", + "Arn" + ] + } + }, + "DependsOn": [ + "ClusterbottlerocketasgLifecycleHookDrainHookRoleDefaultPolicy2C98DD9A", + "ClusterbottlerocketasgLifecycleHookDrainHookRole9E2A1D11" + ] + } + }, + "Parameters": { + "SsmParameterValueawsservicebottlerocketawsecs1x8664latestimageidC96584B6F00A464EAD1953AFF4B05118Parameter": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/aws/service/bottlerocket/aws-ecs-1/x86_64/latest/image_id" + }, + "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-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C.assets.json new file mode 100644 index 0000000000000..f57aca934df68 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C.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-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C.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-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/cdk.out new file mode 100644 index 0000000000000..1f0068d32659a --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"36.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/integ.json new file mode 100644 index 0000000000000..70812ba72bcca --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "36.0.0", + "testCases": { + "aws-ecs-nvidia-bottlerocket-ami/DefaultTest": { + "stacks": [ + "aws-ecs-integ-nvidia-bottlerocket-ami" + ], + "assertionStack": "aws-ecs-nvidia-bottlerocket-ami/DefaultTest/DeployAssert", + "assertionStackName": "awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/manifest.json new file mode 100644 index 0000000000000..8b87eb8b6747b --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/manifest.json @@ -0,0 +1,347 @@ +{ + "version": "36.0.0", + "artifacts": { + "aws-ecs-integ-nvidia-bottlerocket-ami.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "aws-ecs-integ-nvidia-bottlerocket-ami.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "aws-ecs-integ-nvidia-bottlerocket-ami": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "aws-ecs-integ-nvidia-bottlerocket-ami.template.json", + "terminationProtection": false, + "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}/602e26b0cd1d9acf07d33ab9cf214ebcbfccb55ce2b48db80e802eb4c4ad6307.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "aws-ecs-integ-nvidia-bottlerocket-ami.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "aws-ecs-integ-nvidia-bottlerocket-ami.assets" + ], + "metadata": { + "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Vpc8378EB38" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet1Subnet5C2D37C4" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet1RouteTable6C95E38E" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet1RouteTableAssociation97140677" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet1DefaultRoute3DA9E72A" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet1EIPD7E02669" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet1NATGateway4D7517AA" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet2Subnet691E08A3" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet2RouteTable94F7E489" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet2RouteTableAssociationDD5762D8" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet2DefaultRoute97F91067" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet2EIP3C605A87" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet2NATGateway9182C01D" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPrivateSubnet1Subnet536B997A" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPrivateSubnet1RouteTableB2C5B500" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPrivateSubnet1RouteTableAssociation70C59FA6" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPrivateSubnet1DefaultRouteBE02A9ED" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPrivateSubnet2Subnet3788AAA1" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPrivateSubnet2RouteTableA678073B" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPrivateSubnet2RouteTableAssociationA89CAD56" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPrivateSubnet2DefaultRoute060D2087" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/IGW": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcIGWD7BA715C" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/VPCGW": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcVPCGWBF912B6E" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterEB0386A7" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceSecurityGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgInstanceSecurityGroupE1EAEF75" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgInstanceRoleD105ACA5" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgInstanceRoleDefaultPolicyBB6119DC" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceProfile": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgInstanceProfile424C4AC3" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LaunchTemplate/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgLaunchTemplate45A2FA5C" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/ASG": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgASG5424825A" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgDrainECSHookFunctionServiceRole91B0C3B3" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgDrainECSHookFunctionServiceRoleDefaultPolicyBD9C646C" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgDrainECSHookFunctionFEA27227" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/AllowInvoke:awsecsintegnvidiabottlerocketamiClusterbottlerocketasgLifecycleHookDrainHookTopic0F834B74": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgDrainECSHookFunctionAllowInvokeawsecsintegnvidiabottlerocketamiClusterbottlerocketasgLifecycleHookDrainHookTopic0F834B74E5C20074" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/Topic/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgDrainECSHookFunctionTopicC875173C" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Topic/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgLifecycleHookDrainHookRole9E2A1D11" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgLifecycleHookDrainHookRoleDefaultPolicy2C98DD9A" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgLifecycleHookDrainHook00055B9D" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ + { + "type": "aws:cdk:logicalId", + "data": "SsmParameterValueawsservicebottlerocketawsecs1x8664latestimageidC96584B6F00A464EAD1953AFF4B05118Parameter" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/aws-ecs-integ-nvidia-bottlerocket-ami/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "aws-ecs-integ-nvidia-bottlerocket-ami" + }, + "awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C.template.json", + "terminationProtection": false, + "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": [ + "awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C.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": [ + "awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C.assets" + ], + "metadata": { + "/aws-ecs-nvidia-bottlerocket-ami/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/aws-ecs-nvidia-bottlerocket-ami/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "aws-ecs-nvidia-bottlerocket-ami/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/tree.json new file mode 100644 index 0000000000000..083420944120d --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/tree.json @@ -0,0 +1,1583 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "aws-ecs-integ-nvidia-bottlerocket-ami": { + "id": "aws-ecs-integ-nvidia-bottlerocket-ami", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami", + "children": { + "Vpc": { + "id": "Vpc", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPC", + "aws:cdk:cloudformation:props": { + "cidrBlock": "10.0.0.0/16", + "enableDnsHostnames": true, + "enableDnsSupport": true, + "instanceTenancy": "default", + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPC", + "version": "0.0.0" + } + }, + "PublicSubnet1": { + "id": "PublicSubnet1", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.0.0/18", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VpcPublicSubnet1RouteTable6C95E38E" + }, + "subnetId": { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "routeTableId": { + "Ref": "VpcPublicSubnet1RouteTable6C95E38E" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + }, + "EIP": { + "id": "EIP", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", + "version": "0.0.0" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1/NATGateway", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", + "aws:cdk:cloudformation:props": { + "allocationId": { + "Fn::GetAtt": [ + "VpcPublicSubnet1EIPD7E02669", + "AllocationId" + ] + }, + "subnetId": { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", + "version": "0.0.0" + } + }, + "PublicSubnet2": { + "id": "PublicSubnet2", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.64.0/18", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VpcPublicSubnet2RouteTable94F7E489" + }, + "subnetId": { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "routeTableId": { + "Ref": "VpcPublicSubnet2RouteTable94F7E489" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + }, + "EIP": { + "id": "EIP", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", + "version": "0.0.0" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2/NATGateway", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", + "aws:cdk:cloudformation:props": { + "allocationId": { + "Fn::GetAtt": [ + "VpcPublicSubnet2EIP3C605A87", + "AllocationId" + ] + }, + "subnetId": { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", + "version": "0.0.0" + } + }, + "PrivateSubnet1": { + "id": "PrivateSubnet1", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.128.0/18", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Private" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Private" + }, + { + "key": "Name", + "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VpcPrivateSubnet1RouteTableB2C5B500" + }, + "subnetId": { + "Ref": "VpcPrivateSubnet1Subnet536B997A" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "natGatewayId": { + "Ref": "VpcPublicSubnet1NATGateway4D7517AA" + }, + "routeTableId": { + "Ref": "VpcPrivateSubnet1RouteTableB2C5B500" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "PrivateSubnet2": { + "id": "PrivateSubnet2", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.192.0/18", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Private" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Private" + }, + { + "key": "Name", + "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VpcPrivateSubnet2RouteTableA678073B" + }, + "subnetId": { + "Ref": "VpcPrivateSubnet2Subnet3788AAA1" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "natGatewayId": { + "Ref": "VpcPublicSubnet2NATGateway9182C01D" + }, + "routeTableId": { + "Ref": "VpcPrivateSubnet2RouteTableA678073B" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "IGW": { + "id": "IGW", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/IGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnInternetGateway", + "version": "0.0.0" + } + }, + "VPCGW": { + "id": "VPCGW", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/VPCGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", + "aws:cdk:cloudformation:props": { + "internetGatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.Vpc", + "version": "0.0.0" + } + }, + "Cluster": { + "id": "Cluster", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ECS::Cluster", + "aws:cdk:cloudformation:props": {} + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ecs.CfnCluster", + "version": "0.0.0" + } + }, + "bottlerocket-asg": { + "id": "bottlerocket-asg", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg", + "children": { + "InstanceSecurityGroup": { + "id": "InstanceSecurityGroup", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceSecurityGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceSecurityGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceSecurityGroup", + "securityGroupEgress": [ + { + "cidrIp": "0.0.0.0/0", + "description": "Allow all outbound traffic by default", + "ipProtocol": "-1" + } + ], + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.SecurityGroup", + "version": "0.0.0" + } + }, + "InstanceRole": { + "id": "InstanceRole", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceRole", + "children": { + "ImportInstanceRole": { + "id": "ImportInstanceRole", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceRole/ImportInstanceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/AmazonSSMManagedInstanceCore" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role" + ] + ] + } + ], + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": [ + "ecs:DeregisterContainerInstance", + "ecs:RegisterContainerInstance", + "ecs:Submit*" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ClusterEB0386A7", + "Arn" + ] + } + }, + { + "Action": [ + "ecs:Poll", + "ecs:StartTelemetrySession" + ], + "Condition": { + "ArnEquals": { + "ecs:cluster": { + "Fn::GetAtt": [ + "ClusterEB0386A7", + "Arn" + ] + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecr:GetAuthorizationToken", + "ecs:DiscoverPollEndpoint", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "policyName": "ClusterbottlerocketasgInstanceRoleDefaultPolicyBB6119DC", + "roles": [ + { + "Ref": "ClusterbottlerocketasgInstanceRoleD105ACA5" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" + } + }, + "InstanceProfile": { + "id": "InstanceProfile", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceProfile", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::InstanceProfile", + "aws:cdk:cloudformation:props": { + "roles": [ + { + "Ref": "ClusterbottlerocketasgInstanceRoleD105ACA5" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnInstanceProfile", + "version": "0.0.0" + } + }, + "ImportedInstanceProfile": { + "id": "ImportedInstanceProfile", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/ImportedInstanceProfile", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "LaunchTemplate": { + "id": "LaunchTemplate", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LaunchTemplate", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LaunchTemplate/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::LaunchTemplate", + "aws:cdk:cloudformation:props": { + "launchTemplateData": { + "iamInstanceProfile": { + "arn": { + "Fn::GetAtt": [ + "ClusterbottlerocketasgInstanceProfile424C4AC3", + "Arn" + ] + } + }, + "imageId": { + "Ref": "SsmParameterValueawsservicebottlerocketawsecs1x8664latestimageidC96584B6F00A464EAD1953AFF4B05118Parameter" + }, + "instanceType": "c5.large", + "monitoring": { + "enabled": false + }, + "securityGroupIds": [ + { + "Fn::GetAtt": [ + "ClusterbottlerocketasgInstanceSecurityGroupE1EAEF75", + "GroupId" + ] + } + ], + "tagSpecifications": [ + { + "resourceType": "instance", + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LaunchTemplate" + } + ] + }, + { + "resourceType": "volume", + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LaunchTemplate" + } + ] + } + ], + "userData": { + "Fn::Base64": { + "Fn::Join": [ + "", + [ + "\n[settings.ecs]\ncluster = \"", + { + "Ref": "ClusterEB0386A7" + }, + "\"" + ] + ] + } + } + }, + "tagSpecifications": [ + { + "resourceType": "launch-template", + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LaunchTemplate" + } + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnLaunchTemplate", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.LaunchTemplate", + "version": "0.0.0" + } + }, + "ASG": { + "id": "ASG", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/ASG", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::AutoScaling::AutoScalingGroup", + "aws:cdk:cloudformation:props": { + "launchTemplate": { + "launchTemplateId": { + "Ref": "ClusterbottlerocketasgLaunchTemplate45A2FA5C" + }, + "version": { + "Fn::GetAtt": [ + "ClusterbottlerocketasgLaunchTemplate45A2FA5C", + "LatestVersionNumber" + ] + } + }, + "maxSize": "2", + "minSize": "2", + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg", + "propagateAtLaunch": true + } + ], + "vpcZoneIdentifier": [ + { + "Ref": "VpcPrivateSubnet1Subnet536B997A" + }, + { + "Ref": "VpcPrivateSubnet2Subnet3788AAA1" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_autoscaling.CfnAutoScalingGroup", + "version": "0.0.0" + } + }, + "DrainECSHook": { + "id": "DrainECSHook", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook", + "children": { + "Function": { + "id": "Function", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ], + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": [ + "ec2:DescribeHosts", + "ec2:DescribeInstanceAttribute", + "ec2:DescribeInstanceStatus", + "ec2:DescribeInstances" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "autoscaling:CompleteLifecycleAction", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":autoscaling:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":autoScalingGroup:*:autoScalingGroupName/", + { + "Ref": "ClusterbottlerocketasgASG5424825A" + } + ] + ] + } + }, + { + "Action": [ + "ecs:DescribeContainerInstances", + "ecs:DescribeTasks", + "ecs:ListTasks", + "ecs:UpdateContainerInstancesState" + ], + "Condition": { + "ArnEquals": { + "ecs:cluster": { + "Fn::GetAtt": [ + "ClusterEB0386A7", + "Arn" + ] + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecs:ListContainerInstances", + "ecs:SubmitContainerStateChange", + "ecs:SubmitTaskStateChange" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ClusterEB0386A7", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "policyName": "ClusterbottlerocketasgDrainECSHookFunctionServiceRoleDefaultPolicyBD9C646C", + "roles": [ + { + "Ref": "ClusterbottlerocketasgDrainECSHookFunctionServiceRole91B0C3B3" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "zipFile": "import boto3, json, os, time\n\necs = boto3.client('ecs')\nautoscaling = boto3.client('autoscaling')\n\n\ndef lambda_handler(event, context):\n print(json.dumps(dict(event, ResponseURL='...')))\n cluster = os.environ['CLUSTER']\n snsTopicArn = event['Records'][0]['Sns']['TopicArn']\n lifecycle_event = json.loads(event['Records'][0]['Sns']['Message'])\n instance_id = lifecycle_event.get('EC2InstanceId')\n if not instance_id:\n print('Got event without EC2InstanceId: %s', json.dumps(dict(event, ResponseURL='...')))\n return\n\n instance_arn = container_instance_arn(cluster, instance_id)\n print('Instance %s has container instance ARN %s' % (lifecycle_event['EC2InstanceId'], instance_arn))\n\n if not instance_arn:\n return\n\n task_arns = container_instance_task_arns(cluster, instance_arn)\n\n if task_arns:\n print('Instance ARN %s has task ARNs %s' % (instance_arn, ', '.join(task_arns)))\n\n while has_tasks(cluster, instance_arn, task_arns):\n time.sleep(10)\n\n try:\n print('Terminating instance %s' % instance_id)\n autoscaling.complete_lifecycle_action(\n LifecycleActionResult='CONTINUE',\n **pick(lifecycle_event, 'LifecycleHookName', 'LifecycleActionToken', 'AutoScalingGroupName'))\n except Exception as e:\n # Lifecycle action may have already completed.\n print(str(e))\n\n\ndef container_instance_arn(cluster, instance_id):\n \"\"\"Turn an instance ID into a container instance ARN.\"\"\"\n arns = ecs.list_container_instances(cluster=cluster, filter='ec2InstanceId==' + instance_id)['containerInstanceArns']\n if not arns:\n return None\n return arns[0]\n\ndef container_instance_task_arns(cluster, instance_arn):\n \"\"\"Fetch tasks for a container instance ARN.\"\"\"\n arns = ecs.list_tasks(cluster=cluster, containerInstance=instance_arn)['taskArns']\n return arns\n\ndef has_tasks(cluster, instance_arn, task_arns):\n \"\"\"Return True if the instance is running tasks for the given cluster.\"\"\"\n instances = ecs.describe_container_instances(cluster=cluster, containerInstances=[instance_arn])['containerInstances']\n if not instances:\n return False\n instance = instances[0]\n\n if instance['status'] == 'ACTIVE':\n # Start draining, then try again later\n set_container_instance_to_draining(cluster, instance_arn)\n return True\n\n task_count = None\n\n if task_arns:\n # Fetch details for tasks running on the container instance\n tasks = ecs.describe_tasks(cluster=cluster, tasks=task_arns)['tasks']\n if tasks:\n # Consider any non-stopped tasks as running\n task_count = sum(task['lastStatus'] != 'STOPPED' for task in tasks) + instance['pendingTasksCount']\n\n if not task_count:\n # Fallback to instance task counts if detailed task information is unavailable\n task_count = instance['runningTasksCount'] + instance['pendingTasksCount']\n\n print('Instance %s has %s tasks' % (instance_arn, task_count))\n\n return task_count > 0\n\ndef set_container_instance_to_draining(cluster, instance_arn):\n ecs.update_container_instances_state(\n cluster=cluster,\n containerInstances=[instance_arn], status='DRAINING')\n\n\ndef pick(dct, *keys):\n \"\"\"Pick a subset of a dict.\"\"\"\n return {k: v for k, v in dct.items() if k in keys}\n" + }, + "environment": { + "variables": { + "CLUSTER": { + "Ref": "ClusterEB0386A7" + } + } + }, + "handler": "index.lambda_handler", + "role": { + "Fn::GetAtt": [ + "ClusterbottlerocketasgDrainECSHookFunctionServiceRole91B0C3B3", + "Arn" + ] + }, + "runtime": "python3.9", + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg" + } + ], + "timeout": 310 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", + "version": "0.0.0" + } + }, + "AllowInvoke:awsecsintegnvidiabottlerocketamiClusterbottlerocketasgLifecycleHookDrainHookTopic0F834B74": { + "id": "AllowInvoke:awsecsintegnvidiabottlerocketamiClusterbottlerocketasgLifecycleHookDrainHookTopic0F834B74", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/AllowInvoke:awsecsintegnvidiabottlerocketamiClusterbottlerocketasgLifecycleHookDrainHookTopic0F834B74", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", + "aws:cdk:cloudformation:props": { + "action": "lambda:InvokeFunction", + "functionName": { + "Fn::GetAtt": [ + "ClusterbottlerocketasgDrainECSHookFunctionFEA27227", + "Arn" + ] + }, + "principal": "sns.amazonaws.com", + "sourceArn": { + "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", + "version": "0.0.0" + } + }, + "Topic": { + "id": "Topic", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/Topic", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/Topic/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SNS::Subscription", + "aws:cdk:cloudformation:props": { + "endpoint": { + "Fn::GetAtt": [ + "ClusterbottlerocketasgDrainECSHookFunctionFEA27227", + "Arn" + ] + }, + "protocol": "lambda", + "topicArn": { + "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sns.CfnSubscription", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sns.Subscription", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.Function", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "LifecycleHookDrainHook": { + "id": "LifecycleHookDrainHook", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook", + "children": { + "Topic": { + "id": "Topic", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Topic", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Topic/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SNS::Topic", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sns.CfnTopic", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sns.Topic", + "version": "0.0.0" + } + }, + "Role": { + "id": "Role", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role", + "children": { + "ImportRole": { + "id": "ImportRole", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/ImportRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "autoscaling.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "sns:Publish", + "Effect": "Allow", + "Resource": { + "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" + } + } + ], + "Version": "2012-10-17" + }, + "policyName": "ClusterbottlerocketasgLifecycleHookDrainHookRoleDefaultPolicy2C98DD9A", + "roles": [ + { + "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookRole9E2A1D11" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::AutoScaling::LifecycleHook", + "aws:cdk:cloudformation:props": { + "autoScalingGroupName": { + "Ref": "ClusterbottlerocketasgASG5424825A" + }, + "defaultResult": "CONTINUE", + "heartbeatTimeout": 300, + "lifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING", + "notificationTargetArn": { + "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" + }, + "roleArn": { + "Fn::GetAtt": [ + "ClusterbottlerocketasgLifecycleHookDrainHookRole9E2A1D11", + "Arn" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_autoscaling.CfnLifecycleHook", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_autoscaling.LifecycleHook", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_autoscaling.AutoScalingGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ecs.Cluster", + "version": "0.0.0" + } + }, + "SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": { + "id": "SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118": { + "id": "SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-ecs-integ-nvidia-bottlerocket-ami/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + }, + "aws-ecs-nvidia-bottlerocket-ami": { + "id": "aws-ecs-nvidia-bottlerocket-ami", + "path": "aws-ecs-nvidia-bottlerocket-ami", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "aws-ecs-nvidia-bottlerocket-ami/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "aws-ecs-nvidia-bottlerocket-ami/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "aws-ecs-nvidia-bottlerocket-ami/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-ecs-nvidia-bottlerocket-ami/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-ecs-nvidia-bottlerocket-ami/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.ts new file mode 100644 index 0000000000000..e43b4eee730d1 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.ts @@ -0,0 +1,26 @@ +import * as ec2 from 'aws-cdk-lib/aws-ec2'; +import * as cdk from 'aws-cdk-lib'; +import * as ecs from 'aws-cdk-lib/aws-ecs'; +import * as integ from '@aws-cdk/integ-tests-alpha'; + +const app = new cdk.App(); +const stack = new cdk.Stack(app, 'aws-ecs-integ-nvidia-bottlerocket-ami'); + +const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false }); + +const cluster = new ecs.Cluster(stack, 'Cluster', { + vpc, +}); +cluster.addCapacity('bottlerocket-asg', { + minCapacity: 2, + instanceType: new ec2.InstanceType('c5.large'), + machineImage: new ecs.BottleRocketImage({ + variant: ecs.BottlerocketEcsVariant.AWS_ECS_1_NVIDIA, + }), +}); + +new integ.IntegTest(app, 'aws-ecs-nvidia-bottlerocket-ami', { + testCases: [stack], +}); + +app.synth(); From fbddd7182c04e59c3d15267e320b104875dfe917 Mon Sep 17 00:00:00 2001 From: Kazuho CryerShinozuka Date: Mon, 25 Dec 2023 23:39:42 +0900 Subject: [PATCH 04/10] test: unit test --- .../aws-cdk-lib/aws-ecs/test/amis.test.ts | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 packages/aws-cdk-lib/aws-ecs/test/amis.test.ts diff --git a/packages/aws-cdk-lib/aws-ecs/test/amis.test.ts b/packages/aws-cdk-lib/aws-ecs/test/amis.test.ts new file mode 100644 index 0000000000000..4988005cba851 --- /dev/null +++ b/packages/aws-cdk-lib/aws-ecs/test/amis.test.ts @@ -0,0 +1,25 @@ +import { Template } from '../../assertions'; +import { testFixtureNoVpc } from '../../aws-eks/test/util'; +import * as cdk from '../../core'; +import * as ecs from '../lib'; + +describe('amis', () => { + test('BottleRocketImage with NVIDIA variant', () => { + // GIVEN + const app = new cdk.App(); + const stack = new cdk.Stack(app); + + // WHEN + new ecs.BottleRocketImage({ + variant: ecs.BottlerocketEcsVariant.AWS_ECS_1_NVIDIA, + }).getImage(stack); + + /// THEN + const assembly = app.synth(); + const parameters = assembly.getStackByName(stack.stackName).template.Parameters; + expect(Object.entries(parameters).some( + ([k, v]) => k.startsWith('SsmParameterValueawsservicebottlerocketawsecs1nvidiax8664') && + (v as any).Default.includes('/bottlerocket/aws-ecs-1-nvidia/x86_64/'), + )).toEqual(true); + }); +}); From a34034ca2db1dbfbd7737d7c4dedce1aa9c9fc9c Mon Sep 17 00:00:00 2001 From: Kazuho CryerShinozuka Date: Mon, 25 Dec 2023 23:41:40 +0900 Subject: [PATCH 05/10] fix: remove unused lines --- packages/aws-cdk-lib/aws-ecs/test/amis.test.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/aws-cdk-lib/aws-ecs/test/amis.test.ts b/packages/aws-cdk-lib/aws-ecs/test/amis.test.ts index 4988005cba851..59e2568d55cec 100644 --- a/packages/aws-cdk-lib/aws-ecs/test/amis.test.ts +++ b/packages/aws-cdk-lib/aws-ecs/test/amis.test.ts @@ -1,5 +1,3 @@ -import { Template } from '../../assertions'; -import { testFixtureNoVpc } from '../../aws-eks/test/util'; import * as cdk from '../../core'; import * as ecs from '../lib'; From 01866ebab7548c8f0df4d54f94f436fd5dbd1345 Mon Sep 17 00:00:00 2001 From: Kazuho CryerShinozuka Date: Tue, 26 Dec 2023 00:30:59 +0900 Subject: [PATCH 06/10] fix: integ test --- ...integ-bottlerocket-nvidia-ami.assets.json} | 6 +- ...teg-bottlerocket-nvidia-ami.template.json} | 58 ++--- ...faultTestDeployAssert682D6B79.assets.json} | 2 +- ...ultTestDeployAssert682D6B79.template.json} | 0 .../cdk.out | 0 .../integ.json | 12 + .../manifest.json | 122 +++++----- .../tree.json | 228 +++++++++--------- ... integ.cluster-bottlerocket-nvidia-ami.ts} | 4 +- .../integ.json | 12 - 10 files changed, 222 insertions(+), 222 deletions(-) rename packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/{integ.cluster-nvidia-bottlerocket-ami.js.snapshot/aws-ecs-integ-nvidia-bottlerocket-ami.assets.json => integ.cluster-bottlerocket-nvidia-ami.js.snapshot/aws-ecs-integ-bottlerocket-nvidia-ami.assets.json} (65%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/{integ.cluster-nvidia-bottlerocket-ami.js.snapshot/aws-ecs-integ-nvidia-bottlerocket-ami.template.json => integ.cluster-bottlerocket-nvidia-ami.js.snapshot/aws-ecs-integ-bottlerocket-nvidia-ami.template.json} (91%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/{integ.cluster-nvidia-bottlerocket-ami.js.snapshot/awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C.assets.json => integ.cluster-bottlerocket-nvidia-ami.js.snapshot/awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.assets.json} (86%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/{integ.cluster-nvidia-bottlerocket-ami.js.snapshot/awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C.template.json => integ.cluster-bottlerocket-nvidia-ami.js.snapshot/awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.template.json} (100%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/{integ.cluster-nvidia-bottlerocket-ami.js.snapshot => integ.cluster-bottlerocket-nvidia-ami.js.snapshot}/cdk.out (100%) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/integ.json rename packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/{integ.cluster-nvidia-bottlerocket-ami.js.snapshot => integ.cluster-bottlerocket-nvidia-ami.js.snapshot}/manifest.json (69%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/{integ.cluster-nvidia-bottlerocket-ami.js.snapshot => integ.cluster-bottlerocket-nvidia-ami.js.snapshot}/tree.json (86%) rename packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/{integ.cluster-nvidia-bottlerocket-ami.ts => integ.cluster-bottlerocket-nvidia-ami.ts} (81%) delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/integ.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/aws-ecs-integ-nvidia-bottlerocket-ami.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/aws-ecs-integ-bottlerocket-nvidia-ami.assets.json similarity index 65% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/aws-ecs-integ-nvidia-bottlerocket-ami.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/aws-ecs-integ-bottlerocket-nvidia-ami.assets.json index 535c1097372f8..fba612a996800 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/aws-ecs-integ-nvidia-bottlerocket-ami.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/aws-ecs-integ-bottlerocket-nvidia-ami.assets.json @@ -1,15 +1,15 @@ { "version": "36.0.0", "files": { - "602e26b0cd1d9acf07d33ab9cf214ebcbfccb55ce2b48db80e802eb4c4ad6307": { + "74efa183853b81974f787effec394bf0dd778a217e64ee9e08b13eebb968e69a": { "source": { - "path": "aws-ecs-integ-nvidia-bottlerocket-ami.template.json", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami.template.json", "packaging": "file" }, "destinations": { "current_account-current_region": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "602e26b0cd1d9acf07d33ab9cf214ebcbfccb55ce2b48db80e802eb4c4ad6307.json", + "objectKey": "74efa183853b81974f787effec394bf0dd778a217e64ee9e08b13eebb968e69a.json", "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}" } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/aws-ecs-integ-nvidia-bottlerocket-ami.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/aws-ecs-integ-bottlerocket-nvidia-ami.template.json similarity index 91% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/aws-ecs-integ-nvidia-bottlerocket-ami.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/aws-ecs-integ-bottlerocket-nvidia-ami.template.json index 883e86b3d4138..8c595513366a2 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/aws-ecs-integ-nvidia-bottlerocket-ami.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/aws-ecs-integ-bottlerocket-nvidia-ami.template.json @@ -10,7 +10,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc" + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc" } ] } @@ -39,7 +39,7 @@ }, { "Key": "Name", - "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1" + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1" } ], "VpcId": { @@ -53,7 +53,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1" + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1" } ], "VpcId": { @@ -94,7 +94,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1" + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1" } ] } @@ -114,7 +114,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1" + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1" } ] }, @@ -147,7 +147,7 @@ }, { "Key": "Name", - "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2" + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2" } ], "VpcId": { @@ -161,7 +161,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2" + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2" } ], "VpcId": { @@ -202,7 +202,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2" + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2" } ] } @@ -222,7 +222,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2" + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2" } ] }, @@ -255,7 +255,7 @@ }, { "Key": "Name", - "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1" + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1" } ], "VpcId": { @@ -269,7 +269,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1" + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1" } ], "VpcId": { @@ -324,7 +324,7 @@ }, { "Key": "Name", - "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2" + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2" } ], "VpcId": { @@ -338,7 +338,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2" + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2" } ], "VpcId": { @@ -375,7 +375,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc" + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc" } ] } @@ -397,7 +397,7 @@ "ClusterbottlerocketasgInstanceSecurityGroupE1EAEF75": { "Type": "AWS::EC2::SecurityGroup", "Properties": { - "GroupDescription": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceSecurityGroup", + "GroupDescription": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceSecurityGroup", "SecurityGroupEgress": [ { "CidrIp": "0.0.0.0/0", @@ -408,7 +408,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg" + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" } ], "VpcId": { @@ -460,7 +460,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg" + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" } ] } @@ -546,7 +546,7 @@ } }, "ImageId": { - "Ref": "SsmParameterValueawsservicebottlerocketawsecs1x8664latestimageidC96584B6F00A464EAD1953AFF4B05118Parameter" + "Ref": "SsmParameterValueawsservicebottlerocketawsecs1nvidiax8664latestimageidC96584B6F00A464EAD1953AFF4B05118Parameter" }, "InstanceType": "c5.large", "Monitoring": { @@ -566,7 +566,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LaunchTemplate" + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LaunchTemplate" } ] }, @@ -575,7 +575,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LaunchTemplate" + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LaunchTemplate" } ] } @@ -601,7 +601,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LaunchTemplate" + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LaunchTemplate" } ] } @@ -632,7 +632,7 @@ { "Key": "Name", "PropagateAtLaunch": true, - "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg" + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" } ], "VPCZoneIdentifier": [ @@ -685,7 +685,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg" + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" } ] } @@ -801,7 +801,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg" + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" } ], "Timeout": 310 @@ -811,7 +811,7 @@ "ClusterbottlerocketasgDrainECSHookFunctionServiceRole91B0C3B3" ] }, - "ClusterbottlerocketasgDrainECSHookFunctionAllowInvokeawsecsintegnvidiabottlerocketamiClusterbottlerocketasgLifecycleHookDrainHookTopic0F834B74E5C20074": { + "ClusterbottlerocketasgDrainECSHookFunctionAllowInvokeawsecsintegbottlerocketnvidiaamiClusterbottlerocketasgLifecycleHookDrainHookTopic46897984C264A0A5": { "Type": "AWS::Lambda::Permission", "Properties": { "Action": "lambda:InvokeFunction", @@ -848,7 +848,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg" + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" } ] } @@ -871,7 +871,7 @@ "Tags": [ { "Key": "Name", - "Value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg" + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" } ] } @@ -925,9 +925,9 @@ } }, "Parameters": { - "SsmParameterValueawsservicebottlerocketawsecs1x8664latestimageidC96584B6F00A464EAD1953AFF4B05118Parameter": { + "SsmParameterValueawsservicebottlerocketawsecs1nvidiax8664latestimageidC96584B6F00A464EAD1953AFF4B05118Parameter": { "Type": "AWS::SSM::Parameter::Value", - "Default": "/aws/service/bottlerocket/aws-ecs-1/x86_64/latest/image_id" + "Default": "/aws/service/bottlerocket/aws-ecs-1-nvidia/x86_64/latest/image_id" }, "BootstrapVersion": { "Type": "AWS::SSM::Parameter::Value", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.assets.json similarity index 86% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C.assets.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.assets.json index f57aca934df68..6a67204f0bdff 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.assets.json @@ -3,7 +3,7 @@ "files": { "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { "source": { - "path": "awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C.template.json", + "path": "awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.template.json", "packaging": "file" }, "destinations": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.template.json similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C.template.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.template.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/cdk.out similarity index 100% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/cdk.out rename to packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/cdk.out diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/integ.json new file mode 100644 index 0000000000000..a6bfe4d8bc3ff --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "36.0.0", + "testCases": { + "aws-ecs-bottlerocket-nvidia-ami/DefaultTest": { + "stacks": [ + "aws-ecs-integ-bottlerocket-nvidia-ami" + ], + "assertionStack": "aws-ecs-bottlerocket-nvidia-ami/DefaultTest/DeployAssert", + "assertionStackName": "awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/manifest.json similarity index 69% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/manifest.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/manifest.json index 8b87eb8b6747b..808ad701b7db8 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/manifest.json @@ -1,28 +1,28 @@ { "version": "36.0.0", "artifacts": { - "aws-ecs-integ-nvidia-bottlerocket-ami.assets": { + "aws-ecs-integ-bottlerocket-nvidia-ami.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "aws-ecs-integ-nvidia-bottlerocket-ami.assets.json", + "file": "aws-ecs-integ-bottlerocket-nvidia-ami.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "aws-ecs-integ-nvidia-bottlerocket-ami": { + "aws-ecs-integ-bottlerocket-nvidia-ami": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "aws-ecs-integ-nvidia-bottlerocket-ami.template.json", + "templateFile": "aws-ecs-integ-bottlerocket-nvidia-ami.template.json", "terminationProtection": false, "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}/602e26b0cd1d9acf07d33ab9cf214ebcbfccb55ce2b48db80e802eb4c4ad6307.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/74efa183853b81974f787effec394bf0dd778a217e64ee9e08b13eebb968e69a.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "aws-ecs-integ-nvidia-bottlerocket-ami.assets" + "aws-ecs-integ-bottlerocket-nvidia-ami.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", @@ -31,277 +31,277 @@ } }, "dependencies": [ - "aws-ecs-integ-nvidia-bottlerocket-ami.assets" + "aws-ecs-integ-bottlerocket-nvidia-ami.assets" ], "metadata": { - "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/Resource": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/Resource": [ { "type": "aws:cdk:logicalId", "data": "Vpc8378EB38" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1/Subnet": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/Subnet": [ { "type": "aws:cdk:logicalId", "data": "VpcPublicSubnet1Subnet5C2D37C4" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1/RouteTable": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "VpcPublicSubnet1RouteTable6C95E38E" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1/RouteTableAssociation": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "VpcPublicSubnet1RouteTableAssociation97140677" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1/DefaultRoute": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "VpcPublicSubnet1DefaultRoute3DA9E72A" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1/EIP": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/EIP": [ { "type": "aws:cdk:logicalId", "data": "VpcPublicSubnet1EIPD7E02669" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1/NATGateway": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/NATGateway": [ { "type": "aws:cdk:logicalId", "data": "VpcPublicSubnet1NATGateway4D7517AA" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2/Subnet": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/Subnet": [ { "type": "aws:cdk:logicalId", "data": "VpcPublicSubnet2Subnet691E08A3" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2/RouteTable": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "VpcPublicSubnet2RouteTable94F7E489" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2/RouteTableAssociation": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "VpcPublicSubnet2RouteTableAssociationDD5762D8" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2/DefaultRoute": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "VpcPublicSubnet2DefaultRoute97F91067" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2/EIP": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/EIP": [ { "type": "aws:cdk:logicalId", "data": "VpcPublicSubnet2EIP3C605A87" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2/NATGateway": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/NATGateway": [ { "type": "aws:cdk:logicalId", "data": "VpcPublicSubnet2NATGateway9182C01D" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1/Subnet": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1/Subnet": [ { "type": "aws:cdk:logicalId", "data": "VpcPrivateSubnet1Subnet536B997A" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1/RouteTable": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "VpcPrivateSubnet1RouteTableB2C5B500" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1/RouteTableAssociation": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "VpcPrivateSubnet1RouteTableAssociation70C59FA6" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1/DefaultRoute": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "VpcPrivateSubnet1DefaultRouteBE02A9ED" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2/Subnet": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2/Subnet": [ { "type": "aws:cdk:logicalId", "data": "VpcPrivateSubnet2Subnet3788AAA1" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2/RouteTable": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2/RouteTable": [ { "type": "aws:cdk:logicalId", "data": "VpcPrivateSubnet2RouteTableA678073B" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2/RouteTableAssociation": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2/RouteTableAssociation": [ { "type": "aws:cdk:logicalId", "data": "VpcPrivateSubnet2RouteTableAssociationA89CAD56" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2/DefaultRoute": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2/DefaultRoute": [ { "type": "aws:cdk:logicalId", "data": "VpcPrivateSubnet2DefaultRoute060D2087" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/IGW": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/IGW": [ { "type": "aws:cdk:logicalId", "data": "VpcIGWD7BA715C" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/VPCGW": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/VPCGW": [ { "type": "aws:cdk:logicalId", "data": "VpcVPCGWBF912B6E" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/Resource": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterEB0386A7" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceSecurityGroup/Resource": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceSecurityGroup/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterbottlerocketasgInstanceSecurityGroupE1EAEF75" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceRole/Resource": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterbottlerocketasgInstanceRoleD105ACA5" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceRole/DefaultPolicy/Resource": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterbottlerocketasgInstanceRoleDefaultPolicyBB6119DC" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceProfile": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceProfile": [ { "type": "aws:cdk:logicalId", "data": "ClusterbottlerocketasgInstanceProfile424C4AC3" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LaunchTemplate/Resource": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LaunchTemplate/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterbottlerocketasgLaunchTemplate45A2FA5C" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/ASG": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/ASG": [ { "type": "aws:cdk:logicalId", "data": "ClusterbottlerocketasgASG5424825A" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/Resource": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterbottlerocketasgDrainECSHookFunctionServiceRole91B0C3B3" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/DefaultPolicy/Resource": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterbottlerocketasgDrainECSHookFunctionServiceRoleDefaultPolicyBD9C646C" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/Resource": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterbottlerocketasgDrainECSHookFunctionFEA27227" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/AllowInvoke:awsecsintegnvidiabottlerocketamiClusterbottlerocketasgLifecycleHookDrainHookTopic0F834B74": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/AllowInvoke:awsecsintegbottlerocketnvidiaamiClusterbottlerocketasgLifecycleHookDrainHookTopic46897984": [ { "type": "aws:cdk:logicalId", - "data": "ClusterbottlerocketasgDrainECSHookFunctionAllowInvokeawsecsintegnvidiabottlerocketamiClusterbottlerocketasgLifecycleHookDrainHookTopic0F834B74E5C20074" + "data": "ClusterbottlerocketasgDrainECSHookFunctionAllowInvokeawsecsintegbottlerocketnvidiaamiClusterbottlerocketasgLifecycleHookDrainHookTopic46897984C264A0A5" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/Topic/Resource": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/Topic/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterbottlerocketasgDrainECSHookFunctionTopicC875173C" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Topic/Resource": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Topic/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/Resource": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterbottlerocketasgLifecycleHookDrainHookRole9E2A1D11" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/DefaultPolicy/Resource": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/DefaultPolicy/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterbottlerocketasgLifecycleHookDrainHookRoleDefaultPolicy2C98DD9A" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Resource": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Resource": [ { "type": "aws:cdk:logicalId", "data": "ClusterbottlerocketasgLifecycleHookDrainHook00055B9D" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1-nvidia--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ { "type": "aws:cdk:logicalId", - "data": "SsmParameterValueawsservicebottlerocketawsecs1x8664latestimageidC96584B6F00A464EAD1953AFF4B05118Parameter" + "data": "SsmParameterValueawsservicebottlerocketawsecs1nvidiax8664latestimageidC96584B6F00A464EAD1953AFF4B05118Parameter" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/BootstrapVersion": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/aws-ecs-integ-nvidia-bottlerocket-ami/CheckBootstrapVersion": [ + "/aws-ecs-integ-bottlerocket-nvidia-ami/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "aws-ecs-integ-nvidia-bottlerocket-ami" + "displayName": "aws-ecs-integ-bottlerocket-nvidia-ami" }, - "awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C.assets": { + "awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.assets": { "type": "cdk:asset-manifest", "properties": { - "file": "awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C.assets.json", + "file": "awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.assets.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" } }, - "awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C": { + "awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79": { "type": "aws:cloudformation:stack", "environment": "aws://unknown-account/unknown-region", "properties": { - "templateFile": "awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C.template.json", + "templateFile": "awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.template.json", "terminationProtection": false, "validateOnSynth": false, "assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}", @@ -310,7 +310,7 @@ "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ - "awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C.assets" + "awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.assets" ], "lookupRole": { "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", @@ -319,23 +319,23 @@ } }, "dependencies": [ - "awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C.assets" + "awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.assets" ], "metadata": { - "/aws-ecs-nvidia-bottlerocket-ami/DefaultTest/DeployAssert/BootstrapVersion": [ + "/aws-ecs-bottlerocket-nvidia-ami/DefaultTest/DeployAssert/BootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "BootstrapVersion" } ], - "/aws-ecs-nvidia-bottlerocket-ami/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + "/aws-ecs-bottlerocket-nvidia-ami/DefaultTest/DeployAssert/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", "data": "CheckBootstrapVersion" } ] }, - "displayName": "aws-ecs-nvidia-bottlerocket-ami/DefaultTest/DeployAssert" + "displayName": "aws-ecs-bottlerocket-nvidia-ami/DefaultTest/DeployAssert" }, "Tree": { "type": "cdk:tree", diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/tree.json similarity index 86% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/tree.json rename to packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/tree.json index 083420944120d..093ac5989e660 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/tree.json @@ -4,17 +4,17 @@ "id": "App", "path": "", "children": { - "aws-ecs-integ-nvidia-bottlerocket-ami": { - "id": "aws-ecs-integ-nvidia-bottlerocket-ami", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami", + "aws-ecs-integ-bottlerocket-nvidia-ami": { + "id": "aws-ecs-integ-bottlerocket-nvidia-ami", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami", "children": { "Vpc": { "id": "Vpc", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc", "children": { "Resource": { "id": "Resource", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::VPC", "aws:cdk:cloudformation:props": { @@ -25,7 +25,7 @@ "tags": [ { "key": "Name", - "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc" + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc" } ] } @@ -37,11 +37,11 @@ }, "PublicSubnet1": { "id": "PublicSubnet1", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1", "children": { "Subnet": { "id": "Subnet", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1/Subnet", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { @@ -66,7 +66,7 @@ }, { "key": "Name", - "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1" + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1" } ], "vpcId": { @@ -81,7 +81,7 @@ }, "Acl": { "id": "Acl", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1/Acl", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/Acl", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -89,14 +89,14 @@ }, "RouteTable": { "id": "RouteTable", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1/RouteTable", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { "tags": [ { "key": "Name", - "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1" + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1" } ], "vpcId": { @@ -111,7 +111,7 @@ }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1/RouteTableAssociation", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -130,7 +130,7 @@ }, "DefaultRoute": { "id": "DefaultRoute", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1/DefaultRoute", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { @@ -150,7 +150,7 @@ }, "EIP": { "id": "EIP", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1/EIP", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/EIP", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::EIP", "aws:cdk:cloudformation:props": { @@ -158,7 +158,7 @@ "tags": [ { "key": "Name", - "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1" + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1" } ] } @@ -170,7 +170,7 @@ }, "NATGateway": { "id": "NATGateway", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1/NATGateway", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/NATGateway", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", "aws:cdk:cloudformation:props": { @@ -186,7 +186,7 @@ "tags": [ { "key": "Name", - "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet1" + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1" } ] } @@ -204,11 +204,11 @@ }, "PublicSubnet2": { "id": "PublicSubnet2", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2", "children": { "Subnet": { "id": "Subnet", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2/Subnet", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { @@ -233,7 +233,7 @@ }, { "key": "Name", - "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2" + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2" } ], "vpcId": { @@ -248,7 +248,7 @@ }, "Acl": { "id": "Acl", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2/Acl", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/Acl", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -256,14 +256,14 @@ }, "RouteTable": { "id": "RouteTable", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2/RouteTable", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { "tags": [ { "key": "Name", - "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2" + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2" } ], "vpcId": { @@ -278,7 +278,7 @@ }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2/RouteTableAssociation", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -297,7 +297,7 @@ }, "DefaultRoute": { "id": "DefaultRoute", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2/DefaultRoute", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { @@ -317,7 +317,7 @@ }, "EIP": { "id": "EIP", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2/EIP", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/EIP", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::EIP", "aws:cdk:cloudformation:props": { @@ -325,7 +325,7 @@ "tags": [ { "key": "Name", - "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2" + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2" } ] } @@ -337,7 +337,7 @@ }, "NATGateway": { "id": "NATGateway", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2/NATGateway", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/NATGateway", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", "aws:cdk:cloudformation:props": { @@ -353,7 +353,7 @@ "tags": [ { "key": "Name", - "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PublicSubnet2" + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2" } ] } @@ -371,11 +371,11 @@ }, "PrivateSubnet1": { "id": "PrivateSubnet1", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1", "children": { "Subnet": { "id": "Subnet", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1/Subnet", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { @@ -400,7 +400,7 @@ }, { "key": "Name", - "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1" + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1" } ], "vpcId": { @@ -415,7 +415,7 @@ }, "Acl": { "id": "Acl", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1/Acl", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1/Acl", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -423,14 +423,14 @@ }, "RouteTable": { "id": "RouteTable", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1/RouteTable", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { "tags": [ { "key": "Name", - "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1" + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1" } ], "vpcId": { @@ -445,7 +445,7 @@ }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1/RouteTableAssociation", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -464,7 +464,7 @@ }, "DefaultRoute": { "id": "DefaultRoute", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet1/DefaultRoute", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { @@ -490,11 +490,11 @@ }, "PrivateSubnet2": { "id": "PrivateSubnet2", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2", "children": { "Subnet": { "id": "Subnet", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2/Subnet", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2/Subnet", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", "aws:cdk:cloudformation:props": { @@ -519,7 +519,7 @@ }, { "key": "Name", - "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2" + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2" } ], "vpcId": { @@ -534,7 +534,7 @@ }, "Acl": { "id": "Acl", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2/Acl", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2/Acl", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -542,14 +542,14 @@ }, "RouteTable": { "id": "RouteTable", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2/RouteTable", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2/RouteTable", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", "aws:cdk:cloudformation:props": { "tags": [ { "key": "Name", - "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2" + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2" } ], "vpcId": { @@ -564,7 +564,7 @@ }, "RouteTableAssociation": { "id": "RouteTableAssociation", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2/RouteTableAssociation", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2/RouteTableAssociation", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", "aws:cdk:cloudformation:props": { @@ -583,7 +583,7 @@ }, "DefaultRoute": { "id": "DefaultRoute", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/PrivateSubnet2/DefaultRoute", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2/DefaultRoute", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::Route", "aws:cdk:cloudformation:props": { @@ -609,14 +609,14 @@ }, "IGW": { "id": "IGW", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/IGW", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/IGW", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", "aws:cdk:cloudformation:props": { "tags": [ { "key": "Name", - "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc" + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc" } ] } @@ -628,7 +628,7 @@ }, "VPCGW": { "id": "VPCGW", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Vpc/VPCGW", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/VPCGW", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", "aws:cdk:cloudformation:props": { @@ -653,11 +653,11 @@ }, "Cluster": { "id": "Cluster", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster", "children": { "Resource": { "id": "Resource", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::ECS::Cluster", "aws:cdk:cloudformation:props": {} @@ -669,19 +669,19 @@ }, "bottlerocket-asg": { "id": "bottlerocket-asg", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg", "children": { "InstanceSecurityGroup": { "id": "InstanceSecurityGroup", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceSecurityGroup", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceSecurityGroup", "children": { "Resource": { "id": "Resource", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceSecurityGroup/Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceSecurityGroup/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", "aws:cdk:cloudformation:props": { - "groupDescription": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceSecurityGroup", + "groupDescription": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceSecurityGroup", "securityGroupEgress": [ { "cidrIp": "0.0.0.0/0", @@ -692,7 +692,7 @@ "tags": [ { "key": "Name", - "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg" + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" } ], "vpcId": { @@ -713,11 +713,11 @@ }, "InstanceRole": { "id": "InstanceRole", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceRole", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceRole", "children": { "ImportInstanceRole": { "id": "ImportInstanceRole", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceRole/ImportInstanceRole", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceRole/ImportInstanceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -725,7 +725,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceRole/Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -770,7 +770,7 @@ "tags": [ { "key": "Name", - "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg" + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" } ] } @@ -782,11 +782,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceRole/DefaultPolicy", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceRole/DefaultPolicy/Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -864,7 +864,7 @@ }, "InstanceProfile": { "id": "InstanceProfile", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/InstanceProfile", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceProfile", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::InstanceProfile", "aws:cdk:cloudformation:props": { @@ -882,7 +882,7 @@ }, "ImportedInstanceProfile": { "id": "ImportedInstanceProfile", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/ImportedInstanceProfile", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/ImportedInstanceProfile", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -890,11 +890,11 @@ }, "LaunchTemplate": { "id": "LaunchTemplate", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LaunchTemplate", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LaunchTemplate", "children": { "Resource": { "id": "Resource", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LaunchTemplate/Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LaunchTemplate/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::EC2::LaunchTemplate", "aws:cdk:cloudformation:props": { @@ -908,7 +908,7 @@ } }, "imageId": { - "Ref": "SsmParameterValueawsservicebottlerocketawsecs1x8664latestimageidC96584B6F00A464EAD1953AFF4B05118Parameter" + "Ref": "SsmParameterValueawsservicebottlerocketawsecs1nvidiax8664latestimageidC96584B6F00A464EAD1953AFF4B05118Parameter" }, "instanceType": "c5.large", "monitoring": { @@ -928,7 +928,7 @@ "tags": [ { "key": "Name", - "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LaunchTemplate" + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LaunchTemplate" } ] }, @@ -937,7 +937,7 @@ "tags": [ { "key": "Name", - "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LaunchTemplate" + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LaunchTemplate" } ] } @@ -963,7 +963,7 @@ "tags": [ { "key": "Name", - "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LaunchTemplate" + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LaunchTemplate" } ] } @@ -983,7 +983,7 @@ }, "ASG": { "id": "ASG", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/ASG", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/ASG", "attributes": { "aws:cdk:cloudformation:type": "AWS::AutoScaling::AutoScalingGroup", "aws:cdk:cloudformation:props": { @@ -1003,7 +1003,7 @@ "tags": [ { "key": "Name", - "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg", + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg", "propagateAtLaunch": true } ], @@ -1024,19 +1024,19 @@ }, "DrainECSHook": { "id": "DrainECSHook", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook", "children": { "Function": { "id": "Function", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function", "children": { "ServiceRole": { "id": "ServiceRole", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole", "children": { "ImportServiceRole": { "id": "ImportServiceRole", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/ImportServiceRole", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/ImportServiceRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -1044,7 +1044,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1077,7 +1077,7 @@ "tags": [ { "key": "Name", - "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg" + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" } ] } @@ -1089,11 +1089,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/DefaultPolicy", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/DefaultPolicy/Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1200,7 +1200,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Function", "aws:cdk:cloudformation:props": { @@ -1225,7 +1225,7 @@ "tags": [ { "key": "Name", - "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg" + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" } ], "timeout": 310 @@ -1236,9 +1236,9 @@ "version": "0.0.0" } }, - "AllowInvoke:awsecsintegnvidiabottlerocketamiClusterbottlerocketasgLifecycleHookDrainHookTopic0F834B74": { - "id": "AllowInvoke:awsecsintegnvidiabottlerocketamiClusterbottlerocketasgLifecycleHookDrainHookTopic0F834B74", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/AllowInvoke:awsecsintegnvidiabottlerocketamiClusterbottlerocketasgLifecycleHookDrainHookTopic0F834B74", + "AllowInvoke:awsecsintegbottlerocketnvidiaamiClusterbottlerocketasgLifecycleHookDrainHookTopic46897984": { + "id": "AllowInvoke:awsecsintegbottlerocketnvidiaamiClusterbottlerocketasgLifecycleHookDrainHookTopic46897984", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/AllowInvoke:awsecsintegbottlerocketnvidiaamiClusterbottlerocketasgLifecycleHookDrainHookTopic46897984", "attributes": { "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", "aws:cdk:cloudformation:props": { @@ -1262,11 +1262,11 @@ }, "Topic": { "id": "Topic", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/Topic", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/Topic", "children": { "Resource": { "id": "Resource", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/Topic/Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/Topic/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::SNS::Subscription", "aws:cdk:cloudformation:props": { @@ -1307,22 +1307,22 @@ }, "LifecycleHookDrainHook": { "id": "LifecycleHookDrainHook", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook", "children": { "Topic": { "id": "Topic", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Topic", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Topic", "children": { "Resource": { "id": "Resource", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Topic/Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Topic/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::SNS::Topic", "aws:cdk:cloudformation:props": { "tags": [ { "key": "Name", - "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg" + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" } ] } @@ -1340,11 +1340,11 @@ }, "Role": { "id": "Role", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role", "children": { "ImportRole": { "id": "ImportRole", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/ImportRole", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/ImportRole", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -1352,7 +1352,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Role", "aws:cdk:cloudformation:props": { @@ -1371,7 +1371,7 @@ "tags": [ { "key": "Name", - "value": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg" + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" } ] } @@ -1383,11 +1383,11 @@ }, "DefaultPolicy": { "id": "DefaultPolicy", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/DefaultPolicy", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/DefaultPolicy", "children": { "Resource": { "id": "Resource", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/DefaultPolicy/Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/DefaultPolicy/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::IAM::Policy", "aws:cdk:cloudformation:props": { @@ -1430,7 +1430,7 @@ }, "Resource": { "id": "Resource", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Resource", "attributes": { "aws:cdk:cloudformation:type": "AWS::AutoScaling::LifecycleHook", "aws:cdk:cloudformation:props": { @@ -1474,17 +1474,17 @@ "version": "0.0.0" } }, - "SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": { - "id": "SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", + "SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1-nvidia--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": { + "id": "SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1-nvidia--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1-nvidia--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" } }, - "SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118": { - "id": "SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", + "SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1-nvidia--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118": { + "id": "SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1-nvidia--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1-nvidia--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", "constructInfo": { "fqn": "aws-cdk-lib.Resource", "version": "0.0.0" @@ -1492,7 +1492,7 @@ }, "BootstrapVersion": { "id": "BootstrapVersion", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/BootstrapVersion", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -1500,7 +1500,7 @@ }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "aws-ecs-integ-nvidia-bottlerocket-ami/CheckBootstrapVersion", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" @@ -1512,17 +1512,17 @@ "version": "0.0.0" } }, - "aws-ecs-nvidia-bottlerocket-ami": { - "id": "aws-ecs-nvidia-bottlerocket-ami", - "path": "aws-ecs-nvidia-bottlerocket-ami", + "aws-ecs-bottlerocket-nvidia-ami": { + "id": "aws-ecs-bottlerocket-nvidia-ami", + "path": "aws-ecs-bottlerocket-nvidia-ami", "children": { "DefaultTest": { "id": "DefaultTest", - "path": "aws-ecs-nvidia-bottlerocket-ami/DefaultTest", + "path": "aws-ecs-bottlerocket-nvidia-ami/DefaultTest", "children": { "Default": { "id": "Default", - "path": "aws-ecs-nvidia-bottlerocket-ami/DefaultTest/Default", + "path": "aws-ecs-bottlerocket-nvidia-ami/DefaultTest/Default", "constructInfo": { "fqn": "constructs.Construct", "version": "10.3.0" @@ -1530,11 +1530,11 @@ }, "DeployAssert": { "id": "DeployAssert", - "path": "aws-ecs-nvidia-bottlerocket-ami/DefaultTest/DeployAssert", + "path": "aws-ecs-bottlerocket-nvidia-ami/DefaultTest/DeployAssert", "children": { "BootstrapVersion": { "id": "BootstrapVersion", - "path": "aws-ecs-nvidia-bottlerocket-ami/DefaultTest/DeployAssert/BootstrapVersion", + "path": "aws-ecs-bottlerocket-nvidia-ami/DefaultTest/DeployAssert/BootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnParameter", "version": "0.0.0" @@ -1542,7 +1542,7 @@ }, "CheckBootstrapVersion": { "id": "CheckBootstrapVersion", - "path": "aws-ecs-nvidia-bottlerocket-ami/DefaultTest/DeployAssert/CheckBootstrapVersion", + "path": "aws-ecs-bottlerocket-nvidia-ami/DefaultTest/DeployAssert/CheckBootstrapVersion", "constructInfo": { "fqn": "aws-cdk-lib.CfnRule", "version": "0.0.0" diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.ts similarity index 81% rename from packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.ts rename to packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.ts index e43b4eee730d1..778a889baff00 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.ts @@ -4,7 +4,7 @@ import * as ecs from 'aws-cdk-lib/aws-ecs'; import * as integ from '@aws-cdk/integ-tests-alpha'; const app = new cdk.App(); -const stack = new cdk.Stack(app, 'aws-ecs-integ-nvidia-bottlerocket-ami'); +const stack = new cdk.Stack(app, 'aws-ecs-integ-bottlerocket-nvidia-ami'); const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false }); @@ -19,7 +19,7 @@ cluster.addCapacity('bottlerocket-asg', { }), }); -new integ.IntegTest(app, 'aws-ecs-nvidia-bottlerocket-ami', { +new integ.IntegTest(app, 'aws-ecs-bottlerocket-nvidia-ami', { testCases: [stack], }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/integ.json deleted file mode 100644 index 70812ba72bcca..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-nvidia-bottlerocket-ami.js.snapshot/integ.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "version": "36.0.0", - "testCases": { - "aws-ecs-nvidia-bottlerocket-ami/DefaultTest": { - "stacks": [ - "aws-ecs-integ-nvidia-bottlerocket-ami" - ], - "assertionStack": "aws-ecs-nvidia-bottlerocket-ami/DefaultTest/DeployAssert", - "assertionStackName": "awsecsnvidiabottlerocketamiDefaultTestDeployAssert738BB89C" - } - } -} \ No newline at end of file From b8905ef2b3db13eb9c11970785179660be56c2aa Mon Sep 17 00:00:00 2001 From: Kazuho CryerShinozuka Date: Wed, 27 Dec 2023 13:53:51 +0900 Subject: [PATCH 07/10] feat: addEcs2Ami --- packages/aws-cdk-lib/aws-ecs/lib/amis.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/aws-cdk-lib/aws-ecs/lib/amis.ts b/packages/aws-cdk-lib/aws-ecs/lib/amis.ts index 2c870c14ddb1f..66addf36879cb 100644 --- a/packages/aws-cdk-lib/aws-ecs/lib/amis.ts +++ b/packages/aws-cdk-lib/aws-ecs/lib/amis.ts @@ -303,6 +303,14 @@ export enum BottlerocketEcsVariant { * aws-ecs-1-nvidia variant */ AWS_ECS_1_NVIDIA = 'aws-ecs-1-nvidia', + /** + * aws-ecs-2 variant + */ + AWS_ECS_2 = 'aws-ecs-2', + /** + * aws-ecs-2-nvidia variant + */ + AWS_ECS_2_NVIDIA = 'aws-ecs-2-nvidia', } /** From 9ff8283ec4131e24171198070192c1dcb9277aff Mon Sep 17 00:00:00 2001 From: Kazuho CryerShinozuka Date: Wed, 27 Dec 2023 20:18:03 +0900 Subject: [PATCH 08/10] test: unit test --- ...-integ-bottlerocket-nvidia-ami.assets.json | 19 - ...nteg-bottlerocket-nvidia-ami.template.json | 965 ---------- ...efaultTestDeployAssert682D6B79.assets.json | 19 - ...aultTestDeployAssert682D6B79.template.json | 36 - .../cdk.out | 1 - .../integ.json | 12 - .../manifest.json | 347 ---- .../tree.json | 1583 ----------------- .../integ.cluster-bottlerocket-nvidia-ami.ts | 2 +- .../aws-cdk-lib/aws-ecs/test/amis.test.ts | 14 +- 10 files changed, 10 insertions(+), 2988 deletions(-) delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/aws-ecs-integ-bottlerocket-nvidia-ami.assets.json delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/aws-ecs-integ-bottlerocket-nvidia-ami.template.json delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.assets.json delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.template.json delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/cdk.out delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/integ.json delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/manifest.json delete mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/tree.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/aws-ecs-integ-bottlerocket-nvidia-ami.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/aws-ecs-integ-bottlerocket-nvidia-ami.assets.json deleted file mode 100644 index fba612a996800..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/aws-ecs-integ-bottlerocket-nvidia-ami.assets.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": "36.0.0", - "files": { - "74efa183853b81974f787effec394bf0dd778a217e64ee9e08b13eebb968e69a": { - "source": { - "path": "aws-ecs-integ-bottlerocket-nvidia-ami.template.json", - "packaging": "file" - }, - "destinations": { - "current_account-current_region": { - "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "74efa183853b81974f787effec394bf0dd778a217e64ee9e08b13eebb968e69a.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-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/aws-ecs-integ-bottlerocket-nvidia-ami.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/aws-ecs-integ-bottlerocket-nvidia-ami.template.json deleted file mode 100644 index 8c595513366a2..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/aws-ecs-integ-bottlerocket-nvidia-ami.template.json +++ /dev/null @@ -1,965 +0,0 @@ -{ - "Resources": { - "Vpc8378EB38": { - "Type": "AWS::EC2::VPC", - "Properties": { - "CidrBlock": "10.0.0.0/16", - "EnableDnsHostnames": true, - "EnableDnsSupport": true, - "InstanceTenancy": "default", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc" - } - ] - } - }, - "VpcPublicSubnet1Subnet5C2D37C4": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "AvailabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.0.0/18", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "VpcPublicSubnet1RouteTable6C95E38E": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "VpcPublicSubnet1RouteTableAssociation97140677": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "VpcPublicSubnet1RouteTable6C95E38E" - }, - "SubnetId": { - "Ref": "VpcPublicSubnet1Subnet5C2D37C4" - } - } - }, - "VpcPublicSubnet1DefaultRoute3DA9E72A": { - "Type": "AWS::EC2::Route", - "Properties": { - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "VpcIGWD7BA715C" - }, - "RouteTableId": { - "Ref": "VpcPublicSubnet1RouteTable6C95E38E" - } - }, - "DependsOn": [ - "VpcVPCGWBF912B6E" - ] - }, - "VpcPublicSubnet1EIPD7E02669": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1" - } - ] - } - }, - "VpcPublicSubnet1NATGateway4D7517AA": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "AllocationId": { - "Fn::GetAtt": [ - "VpcPublicSubnet1EIPD7E02669", - "AllocationId" - ] - }, - "SubnetId": { - "Ref": "VpcPublicSubnet1Subnet5C2D37C4" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1" - } - ] - }, - "DependsOn": [ - "VpcPublicSubnet1DefaultRoute3DA9E72A", - "VpcPublicSubnet1RouteTableAssociation97140677" - ] - }, - "VpcPublicSubnet2Subnet691E08A3": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "AvailabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.64.0/18", - "MapPublicIpOnLaunch": true, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Public" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Public" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "VpcPublicSubnet2RouteTable94F7E489": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "VpcPublicSubnet2RouteTableAssociationDD5762D8": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "VpcPublicSubnet2RouteTable94F7E489" - }, - "SubnetId": { - "Ref": "VpcPublicSubnet2Subnet691E08A3" - } - } - }, - "VpcPublicSubnet2DefaultRoute97F91067": { - "Type": "AWS::EC2::Route", - "Properties": { - "DestinationCidrBlock": "0.0.0.0/0", - "GatewayId": { - "Ref": "VpcIGWD7BA715C" - }, - "RouteTableId": { - "Ref": "VpcPublicSubnet2RouteTable94F7E489" - } - }, - "DependsOn": [ - "VpcVPCGWBF912B6E" - ] - }, - "VpcPublicSubnet2EIP3C605A87": { - "Type": "AWS::EC2::EIP", - "Properties": { - "Domain": "vpc", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2" - } - ] - } - }, - "VpcPublicSubnet2NATGateway9182C01D": { - "Type": "AWS::EC2::NatGateway", - "Properties": { - "AllocationId": { - "Fn::GetAtt": [ - "VpcPublicSubnet2EIP3C605A87", - "AllocationId" - ] - }, - "SubnetId": { - "Ref": "VpcPublicSubnet2Subnet691E08A3" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2" - } - ] - }, - "DependsOn": [ - "VpcPublicSubnet2DefaultRoute97F91067", - "VpcPublicSubnet2RouteTableAssociationDD5762D8" - ] - }, - "VpcPrivateSubnet1Subnet536B997A": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "AvailabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.128.0/18", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "VpcPrivateSubnet1RouteTableB2C5B500": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "VpcPrivateSubnet1RouteTableAssociation70C59FA6": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "VpcPrivateSubnet1RouteTableB2C5B500" - }, - "SubnetId": { - "Ref": "VpcPrivateSubnet1Subnet536B997A" - } - } - }, - "VpcPrivateSubnet1DefaultRouteBE02A9ED": { - "Type": "AWS::EC2::Route", - "Properties": { - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "VpcPublicSubnet1NATGateway4D7517AA" - }, - "RouteTableId": { - "Ref": "VpcPrivateSubnet1RouteTableB2C5B500" - } - } - }, - "VpcPrivateSubnet2Subnet3788AAA1": { - "Type": "AWS::EC2::Subnet", - "Properties": { - "AvailabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "CidrBlock": "10.0.192.0/18", - "MapPublicIpOnLaunch": false, - "Tags": [ - { - "Key": "aws-cdk:subnet-name", - "Value": "Private" - }, - { - "Key": "aws-cdk:subnet-type", - "Value": "Private" - }, - { - "Key": "Name", - "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "VpcPrivateSubnet2RouteTableA678073B": { - "Type": "AWS::EC2::RouteTable", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "VpcPrivateSubnet2RouteTableAssociationA89CAD56": { - "Type": "AWS::EC2::SubnetRouteTableAssociation", - "Properties": { - "RouteTableId": { - "Ref": "VpcPrivateSubnet2RouteTableA678073B" - }, - "SubnetId": { - "Ref": "VpcPrivateSubnet2Subnet3788AAA1" - } - } - }, - "VpcPrivateSubnet2DefaultRoute060D2087": { - "Type": "AWS::EC2::Route", - "Properties": { - "DestinationCidrBlock": "0.0.0.0/0", - "NatGatewayId": { - "Ref": "VpcPublicSubnet2NATGateway9182C01D" - }, - "RouteTableId": { - "Ref": "VpcPrivateSubnet2RouteTableA678073B" - } - } - }, - "VpcIGWD7BA715C": { - "Type": "AWS::EC2::InternetGateway", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc" - } - ] - } - }, - "VpcVPCGWBF912B6E": { - "Type": "AWS::EC2::VPCGatewayAttachment", - "Properties": { - "InternetGatewayId": { - "Ref": "VpcIGWD7BA715C" - }, - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "ClusterEB0386A7": { - "Type": "AWS::ECS::Cluster" - }, - "ClusterbottlerocketasgInstanceSecurityGroupE1EAEF75": { - "Type": "AWS::EC2::SecurityGroup", - "Properties": { - "GroupDescription": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceSecurityGroup", - "SecurityGroupEgress": [ - { - "CidrIp": "0.0.0.0/0", - "Description": "Allow all outbound traffic by default", - "IpProtocol": "-1" - } - ], - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" - } - ], - "VpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "ClusterbottlerocketasgInstanceRoleD105ACA5": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ec2.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/AmazonSSMManagedInstanceCore" - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role" - ] - ] - } - ], - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" - } - ] - } - }, - "ClusterbottlerocketasgInstanceRoleDefaultPolicyBB6119DC": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ecs:DeregisterContainerInstance", - "ecs:RegisterContainerInstance", - "ecs:Submit*" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "ClusterEB0386A7", - "Arn" - ] - } - }, - { - "Action": [ - "ecs:Poll", - "ecs:StartTelemetrySession" - ], - "Condition": { - "ArnEquals": { - "ecs:cluster": { - "Fn::GetAtt": [ - "ClusterEB0386A7", - "Arn" - ] - } - } - }, - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "ecr:GetAuthorizationToken", - "ecs:DiscoverPollEndpoint", - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ClusterbottlerocketasgInstanceRoleDefaultPolicyBB6119DC", - "Roles": [ - { - "Ref": "ClusterbottlerocketasgInstanceRoleD105ACA5" - } - ] - } - }, - "ClusterbottlerocketasgInstanceProfile424C4AC3": { - "Type": "AWS::IAM::InstanceProfile", - "Properties": { - "Roles": [ - { - "Ref": "ClusterbottlerocketasgInstanceRoleD105ACA5" - } - ] - } - }, - "ClusterbottlerocketasgLaunchTemplate45A2FA5C": { - "Type": "AWS::EC2::LaunchTemplate", - "Properties": { - "LaunchTemplateData": { - "IamInstanceProfile": { - "Arn": { - "Fn::GetAtt": [ - "ClusterbottlerocketasgInstanceProfile424C4AC3", - "Arn" - ] - } - }, - "ImageId": { - "Ref": "SsmParameterValueawsservicebottlerocketawsecs1nvidiax8664latestimageidC96584B6F00A464EAD1953AFF4B05118Parameter" - }, - "InstanceType": "c5.large", - "Monitoring": { - "Enabled": false - }, - "SecurityGroupIds": [ - { - "Fn::GetAtt": [ - "ClusterbottlerocketasgInstanceSecurityGroupE1EAEF75", - "GroupId" - ] - } - ], - "TagSpecifications": [ - { - "ResourceType": "instance", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LaunchTemplate" - } - ] - }, - { - "ResourceType": "volume", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LaunchTemplate" - } - ] - } - ], - "UserData": { - "Fn::Base64": { - "Fn::Join": [ - "", - [ - "\n[settings.ecs]\ncluster = \"", - { - "Ref": "ClusterEB0386A7" - }, - "\"" - ] - ] - } - } - }, - "TagSpecifications": [ - { - "ResourceType": "launch-template", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LaunchTemplate" - } - ] - } - ] - }, - "DependsOn": [ - "ClusterbottlerocketasgInstanceRoleDefaultPolicyBB6119DC", - "ClusterbottlerocketasgInstanceRoleD105ACA5" - ] - }, - "ClusterbottlerocketasgASG5424825A": { - "Type": "AWS::AutoScaling::AutoScalingGroup", - "Properties": { - "LaunchTemplate": { - "LaunchTemplateId": { - "Ref": "ClusterbottlerocketasgLaunchTemplate45A2FA5C" - }, - "Version": { - "Fn::GetAtt": [ - "ClusterbottlerocketasgLaunchTemplate45A2FA5C", - "LatestVersionNumber" - ] - } - }, - "MaxSize": "2", - "MinSize": "2", - "Tags": [ - { - "Key": "Name", - "PropagateAtLaunch": true, - "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" - } - ], - "VPCZoneIdentifier": [ - { - "Ref": "VpcPrivateSubnet1Subnet536B997A" - }, - { - "Ref": "VpcPrivateSubnet2Subnet3788AAA1" - } - ] - }, - "UpdatePolicy": { - "AutoScalingReplacingUpdate": { - "WillReplace": true - }, - "AutoScalingScheduledAction": { - "IgnoreUnmodifiedGroupSizeProperties": true - } - } - }, - "ClusterbottlerocketasgDrainECSHookFunctionServiceRole91B0C3B3": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ], - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" - } - ] - } - }, - "ClusterbottlerocketasgDrainECSHookFunctionServiceRoleDefaultPolicyBD9C646C": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": [ - "ec2:DescribeHosts", - "ec2:DescribeInstanceAttribute", - "ec2:DescribeInstanceStatus", - "ec2:DescribeInstances" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": "autoscaling:CompleteLifecycleAction", - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":autoscaling:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":autoScalingGroup:*:autoScalingGroupName/", - { - "Ref": "ClusterbottlerocketasgASG5424825A" - } - ] - ] - } - }, - { - "Action": [ - "ecs:DescribeContainerInstances", - "ecs:DescribeTasks", - "ecs:ListTasks", - "ecs:UpdateContainerInstancesState" - ], - "Condition": { - "ArnEquals": { - "ecs:cluster": { - "Fn::GetAtt": [ - "ClusterEB0386A7", - "Arn" - ] - } - } - }, - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "ecs:ListContainerInstances", - "ecs:SubmitContainerStateChange", - "ecs:SubmitTaskStateChange" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "ClusterEB0386A7", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ClusterbottlerocketasgDrainECSHookFunctionServiceRoleDefaultPolicyBD9C646C", - "Roles": [ - { - "Ref": "ClusterbottlerocketasgDrainECSHookFunctionServiceRole91B0C3B3" - } - ] - } - }, - "ClusterbottlerocketasgDrainECSHookFunctionFEA27227": { - "Type": "AWS::Lambda::Function", - "Properties": { - "Code": { - "ZipFile": "import boto3, json, os, time\n\necs = boto3.client('ecs')\nautoscaling = boto3.client('autoscaling')\n\n\ndef lambda_handler(event, context):\n print(json.dumps(dict(event, ResponseURL='...')))\n cluster = os.environ['CLUSTER']\n snsTopicArn = event['Records'][0]['Sns']['TopicArn']\n lifecycle_event = json.loads(event['Records'][0]['Sns']['Message'])\n instance_id = lifecycle_event.get('EC2InstanceId')\n if not instance_id:\n print('Got event without EC2InstanceId: %s', json.dumps(dict(event, ResponseURL='...')))\n return\n\n instance_arn = container_instance_arn(cluster, instance_id)\n print('Instance %s has container instance ARN %s' % (lifecycle_event['EC2InstanceId'], instance_arn))\n\n if not instance_arn:\n return\n\n task_arns = container_instance_task_arns(cluster, instance_arn)\n\n if task_arns:\n print('Instance ARN %s has task ARNs %s' % (instance_arn, ', '.join(task_arns)))\n\n while has_tasks(cluster, instance_arn, task_arns):\n time.sleep(10)\n\n try:\n print('Terminating instance %s' % instance_id)\n autoscaling.complete_lifecycle_action(\n LifecycleActionResult='CONTINUE',\n **pick(lifecycle_event, 'LifecycleHookName', 'LifecycleActionToken', 'AutoScalingGroupName'))\n except Exception as e:\n # Lifecycle action may have already completed.\n print(str(e))\n\n\ndef container_instance_arn(cluster, instance_id):\n \"\"\"Turn an instance ID into a container instance ARN.\"\"\"\n arns = ecs.list_container_instances(cluster=cluster, filter='ec2InstanceId==' + instance_id)['containerInstanceArns']\n if not arns:\n return None\n return arns[0]\n\ndef container_instance_task_arns(cluster, instance_arn):\n \"\"\"Fetch tasks for a container instance ARN.\"\"\"\n arns = ecs.list_tasks(cluster=cluster, containerInstance=instance_arn)['taskArns']\n return arns\n\ndef has_tasks(cluster, instance_arn, task_arns):\n \"\"\"Return True if the instance is running tasks for the given cluster.\"\"\"\n instances = ecs.describe_container_instances(cluster=cluster, containerInstances=[instance_arn])['containerInstances']\n if not instances:\n return False\n instance = instances[0]\n\n if instance['status'] == 'ACTIVE':\n # Start draining, then try again later\n set_container_instance_to_draining(cluster, instance_arn)\n return True\n\n task_count = None\n\n if task_arns:\n # Fetch details for tasks running on the container instance\n tasks = ecs.describe_tasks(cluster=cluster, tasks=task_arns)['tasks']\n if tasks:\n # Consider any non-stopped tasks as running\n task_count = sum(task['lastStatus'] != 'STOPPED' for task in tasks) + instance['pendingTasksCount']\n\n if not task_count:\n # Fallback to instance task counts if detailed task information is unavailable\n task_count = instance['runningTasksCount'] + instance['pendingTasksCount']\n\n print('Instance %s has %s tasks' % (instance_arn, task_count))\n\n return task_count > 0\n\ndef set_container_instance_to_draining(cluster, instance_arn):\n ecs.update_container_instances_state(\n cluster=cluster,\n containerInstances=[instance_arn], status='DRAINING')\n\n\ndef pick(dct, *keys):\n \"\"\"Pick a subset of a dict.\"\"\"\n return {k: v for k, v in dct.items() if k in keys}\n" - }, - "Environment": { - "Variables": { - "CLUSTER": { - "Ref": "ClusterEB0386A7" - } - } - }, - "Handler": "index.lambda_handler", - "Role": { - "Fn::GetAtt": [ - "ClusterbottlerocketasgDrainECSHookFunctionServiceRole91B0C3B3", - "Arn" - ] - }, - "Runtime": "python3.9", - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" - } - ], - "Timeout": 310 - }, - "DependsOn": [ - "ClusterbottlerocketasgDrainECSHookFunctionServiceRoleDefaultPolicyBD9C646C", - "ClusterbottlerocketasgDrainECSHookFunctionServiceRole91B0C3B3" - ] - }, - "ClusterbottlerocketasgDrainECSHookFunctionAllowInvokeawsecsintegbottlerocketnvidiaamiClusterbottlerocketasgLifecycleHookDrainHookTopic46897984C264A0A5": { - "Type": "AWS::Lambda::Permission", - "Properties": { - "Action": "lambda:InvokeFunction", - "FunctionName": { - "Fn::GetAtt": [ - "ClusterbottlerocketasgDrainECSHookFunctionFEA27227", - "Arn" - ] - }, - "Principal": "sns.amazonaws.com", - "SourceArn": { - "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" - } - } - }, - "ClusterbottlerocketasgDrainECSHookFunctionTopicC875173C": { - "Type": "AWS::SNS::Subscription", - "Properties": { - "Endpoint": { - "Fn::GetAtt": [ - "ClusterbottlerocketasgDrainECSHookFunctionFEA27227", - "Arn" - ] - }, - "Protocol": "lambda", - "TopicArn": { - "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" - } - } - }, - "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02": { - "Type": "AWS::SNS::Topic", - "Properties": { - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" - } - ] - } - }, - "ClusterbottlerocketasgLifecycleHookDrainHookRole9E2A1D11": { - "Type": "AWS::IAM::Role", - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "autoscaling.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "Tags": [ - { - "Key": "Name", - "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" - } - ] - } - }, - "ClusterbottlerocketasgLifecycleHookDrainHookRoleDefaultPolicy2C98DD9A": { - "Type": "AWS::IAM::Policy", - "Properties": { - "PolicyDocument": { - "Statement": [ - { - "Action": "sns:Publish", - "Effect": "Allow", - "Resource": { - "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" - } - } - ], - "Version": "2012-10-17" - }, - "PolicyName": "ClusterbottlerocketasgLifecycleHookDrainHookRoleDefaultPolicy2C98DD9A", - "Roles": [ - { - "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookRole9E2A1D11" - } - ] - } - }, - "ClusterbottlerocketasgLifecycleHookDrainHook00055B9D": { - "Type": "AWS::AutoScaling::LifecycleHook", - "Properties": { - "AutoScalingGroupName": { - "Ref": "ClusterbottlerocketasgASG5424825A" - }, - "DefaultResult": "CONTINUE", - "HeartbeatTimeout": 300, - "LifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING", - "NotificationTargetARN": { - "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" - }, - "RoleARN": { - "Fn::GetAtt": [ - "ClusterbottlerocketasgLifecycleHookDrainHookRole9E2A1D11", - "Arn" - ] - } - }, - "DependsOn": [ - "ClusterbottlerocketasgLifecycleHookDrainHookRoleDefaultPolicy2C98DD9A", - "ClusterbottlerocketasgLifecycleHookDrainHookRole9E2A1D11" - ] - } - }, - "Parameters": { - "SsmParameterValueawsservicebottlerocketawsecs1nvidiax8664latestimageidC96584B6F00A464EAD1953AFF4B05118Parameter": { - "Type": "AWS::SSM::Parameter::Value", - "Default": "/aws/service/bottlerocket/aws-ecs-1-nvidia/x86_64/latest/image_id" - }, - "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-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.assets.json deleted file mode 100644 index 6a67204f0bdff..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.assets.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "version": "36.0.0", - "files": { - "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { - "source": { - "path": "awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.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-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.template.json deleted file mode 100644 index ad9d0fb73d1dd..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.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-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/cdk.out deleted file mode 100644 index 1f0068d32659a..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/cdk.out +++ /dev/null @@ -1 +0,0 @@ -{"version":"36.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/integ.json deleted file mode 100644 index a6bfe4d8bc3ff..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/integ.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "version": "36.0.0", - "testCases": { - "aws-ecs-bottlerocket-nvidia-ami/DefaultTest": { - "stacks": [ - "aws-ecs-integ-bottlerocket-nvidia-ami" - ], - "assertionStack": "aws-ecs-bottlerocket-nvidia-ami/DefaultTest/DeployAssert", - "assertionStackName": "awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/manifest.json deleted file mode 100644 index 808ad701b7db8..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/manifest.json +++ /dev/null @@ -1,347 +0,0 @@ -{ - "version": "36.0.0", - "artifacts": { - "aws-ecs-integ-bottlerocket-nvidia-ami.assets": { - "type": "cdk:asset-manifest", - "properties": { - "file": "aws-ecs-integ-bottlerocket-nvidia-ami.assets.json", - "requiresBootstrapStackVersion": 6, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" - } - }, - "aws-ecs-integ-bottlerocket-nvidia-ami": { - "type": "aws:cloudformation:stack", - "environment": "aws://unknown-account/unknown-region", - "properties": { - "templateFile": "aws-ecs-integ-bottlerocket-nvidia-ami.template.json", - "terminationProtection": false, - "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}/74efa183853b81974f787effec394bf0dd778a217e64ee9e08b13eebb968e69a.json", - "requiresBootstrapStackVersion": 6, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", - "additionalDependencies": [ - "aws-ecs-integ-bottlerocket-nvidia-ami.assets" - ], - "lookupRole": { - "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", - "requiresBootstrapStackVersion": 8, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" - } - }, - "dependencies": [ - "aws-ecs-integ-bottlerocket-nvidia-ami.assets" - ], - "metadata": { - "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "Vpc8378EB38" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcPublicSubnet1Subnet5C2D37C4" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcPublicSubnet1RouteTable6C95E38E" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcPublicSubnet1RouteTableAssociation97140677" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcPublicSubnet1DefaultRoute3DA9E72A" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/EIP": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcPublicSubnet1EIPD7E02669" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/NATGateway": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcPublicSubnet1NATGateway4D7517AA" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcPublicSubnet2Subnet691E08A3" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcPublicSubnet2RouteTable94F7E489" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcPublicSubnet2RouteTableAssociationDD5762D8" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcPublicSubnet2DefaultRoute97F91067" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/EIP": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcPublicSubnet2EIP3C605A87" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/NATGateway": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcPublicSubnet2NATGateway9182C01D" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcPrivateSubnet1Subnet536B997A" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcPrivateSubnet1RouteTableB2C5B500" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcPrivateSubnet1RouteTableAssociation70C59FA6" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcPrivateSubnet1DefaultRouteBE02A9ED" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2/Subnet": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcPrivateSubnet2Subnet3788AAA1" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2/RouteTable": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcPrivateSubnet2RouteTableA678073B" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2/RouteTableAssociation": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcPrivateSubnet2RouteTableAssociationA89CAD56" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2/DefaultRoute": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcPrivateSubnet2DefaultRoute060D2087" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/IGW": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcIGWD7BA715C" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/VPCGW": [ - { - "type": "aws:cdk:logicalId", - "data": "VpcVPCGWBF912B6E" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterEB0386A7" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceSecurityGroup/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterbottlerocketasgInstanceSecurityGroupE1EAEF75" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterbottlerocketasgInstanceRoleD105ACA5" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceRole/DefaultPolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterbottlerocketasgInstanceRoleDefaultPolicyBB6119DC" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceProfile": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterbottlerocketasgInstanceProfile424C4AC3" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LaunchTemplate/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterbottlerocketasgLaunchTemplate45A2FA5C" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/ASG": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterbottlerocketasgASG5424825A" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterbottlerocketasgDrainECSHookFunctionServiceRole91B0C3B3" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/DefaultPolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterbottlerocketasgDrainECSHookFunctionServiceRoleDefaultPolicyBD9C646C" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterbottlerocketasgDrainECSHookFunctionFEA27227" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/AllowInvoke:awsecsintegbottlerocketnvidiaamiClusterbottlerocketasgLifecycleHookDrainHookTopic46897984": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterbottlerocketasgDrainECSHookFunctionAllowInvokeawsecsintegbottlerocketnvidiaamiClusterbottlerocketasgLifecycleHookDrainHookTopic46897984C264A0A5" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/Topic/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterbottlerocketasgDrainECSHookFunctionTopicC875173C" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Topic/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterbottlerocketasgLifecycleHookDrainHookRole9E2A1D11" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/DefaultPolicy/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterbottlerocketasgLifecycleHookDrainHookRoleDefaultPolicy2C98DD9A" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Resource": [ - { - "type": "aws:cdk:logicalId", - "data": "ClusterbottlerocketasgLifecycleHookDrainHook00055B9D" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1-nvidia--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ - { - "type": "aws:cdk:logicalId", - "data": "SsmParameterValueawsservicebottlerocketawsecs1nvidiax8664latestimageidC96584B6F00A464EAD1953AFF4B05118Parameter" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/BootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "BootstrapVersion" - } - ], - "/aws-ecs-integ-bottlerocket-nvidia-ami/CheckBootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "CheckBootstrapVersion" - } - ] - }, - "displayName": "aws-ecs-integ-bottlerocket-nvidia-ami" - }, - "awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.assets": { - "type": "cdk:asset-manifest", - "properties": { - "file": "awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.assets.json", - "requiresBootstrapStackVersion": 6, - "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" - } - }, - "awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79": { - "type": "aws:cloudformation:stack", - "environment": "aws://unknown-account/unknown-region", - "properties": { - "templateFile": "awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.template.json", - "terminationProtection": false, - "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": [ - "awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.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": [ - "awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.assets" - ], - "metadata": { - "/aws-ecs-bottlerocket-nvidia-ami/DefaultTest/DeployAssert/BootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "BootstrapVersion" - } - ], - "/aws-ecs-bottlerocket-nvidia-ami/DefaultTest/DeployAssert/CheckBootstrapVersion": [ - { - "type": "aws:cdk:logicalId", - "data": "CheckBootstrapVersion" - } - ] - }, - "displayName": "aws-ecs-bottlerocket-nvidia-ami/DefaultTest/DeployAssert" - }, - "Tree": { - "type": "cdk:tree", - "properties": { - "file": "tree.json" - } - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/tree.json deleted file mode 100644 index 093ac5989e660..0000000000000 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/tree.json +++ /dev/null @@ -1,1583 +0,0 @@ -{ - "version": "tree-0.1", - "tree": { - "id": "App", - "path": "", - "children": { - "aws-ecs-integ-bottlerocket-nvidia-ami": { - "id": "aws-ecs-integ-bottlerocket-nvidia-ami", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami", - "children": { - "Vpc": { - "id": "Vpc", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::VPC", - "aws:cdk:cloudformation:props": { - "cidrBlock": "10.0.0.0/16", - "enableDnsHostnames": true, - "enableDnsSupport": true, - "instanceTenancy": "default", - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc" - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnVPC", - "version": "0.0.0" - } - }, - "PublicSubnet1": { - "id": "PublicSubnet1", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "availabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.0.0/18", - "mapPublicIpOnLaunch": true, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Public" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Public" - }, - { - "key": "Name", - "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1" - } - ], - "vpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/Acl", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1" - } - ], - "vpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "VpcPublicSubnet1RouteTable6C95E38E" - }, - "subnetId": { - "Ref": "VpcPublicSubnet1Subnet5C2D37C4" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "destinationCidrBlock": "0.0.0.0/0", - "gatewayId": { - "Ref": "VpcIGWD7BA715C" - }, - "routeTableId": { - "Ref": "VpcPublicSubnet1RouteTable6C95E38E" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", - "version": "0.0.0" - } - }, - "EIP": { - "id": "EIP", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/EIP", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::EIP", - "aws:cdk:cloudformation:props": { - "domain": "vpc", - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", - "version": "0.0.0" - } - }, - "NATGateway": { - "id": "NATGateway", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/NATGateway", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", - "aws:cdk:cloudformation:props": { - "allocationId": { - "Fn::GetAtt": [ - "VpcPublicSubnet1EIPD7E02669", - "AllocationId" - ] - }, - "subnetId": { - "Ref": "VpcPublicSubnet1Subnet5C2D37C4" - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1" - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", - "version": "0.0.0" - } - }, - "PublicSubnet2": { - "id": "PublicSubnet2", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "availabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.64.0/18", - "mapPublicIpOnLaunch": true, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Public" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Public" - }, - { - "key": "Name", - "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2" - } - ], - "vpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/Acl", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2" - } - ], - "vpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "VpcPublicSubnet2RouteTable94F7E489" - }, - "subnetId": { - "Ref": "VpcPublicSubnet2Subnet691E08A3" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "destinationCidrBlock": "0.0.0.0/0", - "gatewayId": { - "Ref": "VpcIGWD7BA715C" - }, - "routeTableId": { - "Ref": "VpcPublicSubnet2RouteTable94F7E489" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", - "version": "0.0.0" - } - }, - "EIP": { - "id": "EIP", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/EIP", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::EIP", - "aws:cdk:cloudformation:props": { - "domain": "vpc", - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", - "version": "0.0.0" - } - }, - "NATGateway": { - "id": "NATGateway", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/NATGateway", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", - "aws:cdk:cloudformation:props": { - "allocationId": { - "Fn::GetAtt": [ - "VpcPublicSubnet2EIP3C605A87", - "AllocationId" - ] - }, - "subnetId": { - "Ref": "VpcPublicSubnet2Subnet691E08A3" - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2" - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", - "version": "0.0.0" - } - }, - "PrivateSubnet1": { - "id": "PrivateSubnet1", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "availabilityZone": { - "Fn::Select": [ - 0, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.128.0/18", - "mapPublicIpOnLaunch": false, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Private" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Private" - }, - { - "key": "Name", - "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1" - } - ], - "vpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1/Acl", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1" - } - ], - "vpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "VpcPrivateSubnet1RouteTableB2C5B500" - }, - "subnetId": { - "Ref": "VpcPrivateSubnet1Subnet536B997A" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "destinationCidrBlock": "0.0.0.0/0", - "natGatewayId": { - "Ref": "VpcPublicSubnet1NATGateway4D7517AA" - }, - "routeTableId": { - "Ref": "VpcPrivateSubnet1RouteTableB2C5B500" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", - "version": "0.0.0" - } - }, - "PrivateSubnet2": { - "id": "PrivateSubnet2", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2", - "children": { - "Subnet": { - "id": "Subnet", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2/Subnet", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", - "aws:cdk:cloudformation:props": { - "availabilityZone": { - "Fn::Select": [ - 1, - { - "Fn::GetAZs": "" - } - ] - }, - "cidrBlock": "10.0.192.0/18", - "mapPublicIpOnLaunch": false, - "tags": [ - { - "key": "aws-cdk:subnet-name", - "value": "Private" - }, - { - "key": "aws-cdk:subnet-type", - "value": "Private" - }, - { - "key": "Name", - "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2" - } - ], - "vpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", - "version": "0.0.0" - } - }, - "Acl": { - "id": "Acl", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2/Acl", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" - } - }, - "RouteTable": { - "id": "RouteTable", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2/RouteTable", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", - "aws:cdk:cloudformation:props": { - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2" - } - ], - "vpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", - "version": "0.0.0" - } - }, - "RouteTableAssociation": { - "id": "RouteTableAssociation", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2/RouteTableAssociation", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", - "aws:cdk:cloudformation:props": { - "routeTableId": { - "Ref": "VpcPrivateSubnet2RouteTableA678073B" - }, - "subnetId": { - "Ref": "VpcPrivateSubnet2Subnet3788AAA1" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", - "version": "0.0.0" - } - }, - "DefaultRoute": { - "id": "DefaultRoute", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2/DefaultRoute", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::Route", - "aws:cdk:cloudformation:props": { - "destinationCidrBlock": "0.0.0.0/0", - "natGatewayId": { - "Ref": "VpcPublicSubnet2NATGateway9182C01D" - }, - "routeTableId": { - "Ref": "VpcPrivateSubnet2RouteTableA678073B" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", - "version": "0.0.0" - } - }, - "IGW": { - "id": "IGW", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/IGW", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", - "aws:cdk:cloudformation:props": { - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc" - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnInternetGateway", - "version": "0.0.0" - } - }, - "VPCGW": { - "id": "VPCGW", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/VPCGW", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", - "aws:cdk:cloudformation:props": { - "internetGatewayId": { - "Ref": "VpcIGWD7BA715C" - }, - "vpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.Vpc", - "version": "0.0.0" - } - }, - "Cluster": { - "id": "Cluster", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::ECS::Cluster", - "aws:cdk:cloudformation:props": {} - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ecs.CfnCluster", - "version": "0.0.0" - } - }, - "bottlerocket-asg": { - "id": "bottlerocket-asg", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg", - "children": { - "InstanceSecurityGroup": { - "id": "InstanceSecurityGroup", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceSecurityGroup", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceSecurityGroup/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", - "aws:cdk:cloudformation:props": { - "groupDescription": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceSecurityGroup", - "securityGroupEgress": [ - { - "cidrIp": "0.0.0.0/0", - "description": "Allow all outbound traffic by default", - "ipProtocol": "-1" - } - ], - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" - } - ], - "vpcId": { - "Ref": "Vpc8378EB38" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.SecurityGroup", - "version": "0.0.0" - } - }, - "InstanceRole": { - "id": "InstanceRole", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceRole", - "children": { - "ImportInstanceRole": { - "id": "ImportInstanceRole", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceRole/ImportInstanceRole", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "ec2.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "managedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/AmazonSSMManagedInstanceCore" - ] - ] - }, - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role" - ] - ] - } - ], - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" - } - }, - "DefaultPolicy": { - "id": "DefaultPolicy", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceRole/DefaultPolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceRole/DefaultPolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": [ - "ecs:DeregisterContainerInstance", - "ecs:RegisterContainerInstance", - "ecs:Submit*" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "ClusterEB0386A7", - "Arn" - ] - } - }, - { - "Action": [ - "ecs:Poll", - "ecs:StartTelemetrySession" - ], - "Condition": { - "ArnEquals": { - "ecs:cluster": { - "Fn::GetAtt": [ - "ClusterEB0386A7", - "Arn" - ] - } - } - }, - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "ecr:GetAuthorizationToken", - "ecs:DiscoverPollEndpoint", - "logs:CreateLogStream", - "logs:PutLogEvents" - ], - "Effect": "Allow", - "Resource": "*" - } - ], - "Version": "2012-10-17" - }, - "policyName": "ClusterbottlerocketasgInstanceRoleDefaultPolicyBB6119DC", - "roles": [ - { - "Ref": "ClusterbottlerocketasgInstanceRoleD105ACA5" - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" - } - }, - "InstanceProfile": { - "id": "InstanceProfile", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceProfile", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::InstanceProfile", - "aws:cdk:cloudformation:props": { - "roles": [ - { - "Ref": "ClusterbottlerocketasgInstanceRoleD105ACA5" - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnInstanceProfile", - "version": "0.0.0" - } - }, - "ImportedInstanceProfile": { - "id": "ImportedInstanceProfile", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/ImportedInstanceProfile", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" - } - }, - "LaunchTemplate": { - "id": "LaunchTemplate", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LaunchTemplate", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LaunchTemplate/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::EC2::LaunchTemplate", - "aws:cdk:cloudformation:props": { - "launchTemplateData": { - "iamInstanceProfile": { - "arn": { - "Fn::GetAtt": [ - "ClusterbottlerocketasgInstanceProfile424C4AC3", - "Arn" - ] - } - }, - "imageId": { - "Ref": "SsmParameterValueawsservicebottlerocketawsecs1nvidiax8664latestimageidC96584B6F00A464EAD1953AFF4B05118Parameter" - }, - "instanceType": "c5.large", - "monitoring": { - "enabled": false - }, - "securityGroupIds": [ - { - "Fn::GetAtt": [ - "ClusterbottlerocketasgInstanceSecurityGroupE1EAEF75", - "GroupId" - ] - } - ], - "tagSpecifications": [ - { - "resourceType": "instance", - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LaunchTemplate" - } - ] - }, - { - "resourceType": "volume", - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LaunchTemplate" - } - ] - } - ], - "userData": { - "Fn::Base64": { - "Fn::Join": [ - "", - [ - "\n[settings.ecs]\ncluster = \"", - { - "Ref": "ClusterEB0386A7" - }, - "\"" - ] - ] - } - } - }, - "tagSpecifications": [ - { - "resourceType": "launch-template", - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LaunchTemplate" - } - ] - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.CfnLaunchTemplate", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ec2.LaunchTemplate", - "version": "0.0.0" - } - }, - "ASG": { - "id": "ASG", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/ASG", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::AutoScaling::AutoScalingGroup", - "aws:cdk:cloudformation:props": { - "launchTemplate": { - "launchTemplateId": { - "Ref": "ClusterbottlerocketasgLaunchTemplate45A2FA5C" - }, - "version": { - "Fn::GetAtt": [ - "ClusterbottlerocketasgLaunchTemplate45A2FA5C", - "LatestVersionNumber" - ] - } - }, - "maxSize": "2", - "minSize": "2", - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg", - "propagateAtLaunch": true - } - ], - "vpcZoneIdentifier": [ - { - "Ref": "VpcPrivateSubnet1Subnet536B997A" - }, - { - "Ref": "VpcPrivateSubnet2Subnet3788AAA1" - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_autoscaling.CfnAutoScalingGroup", - "version": "0.0.0" - } - }, - "DrainECSHook": { - "id": "DrainECSHook", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook", - "children": { - "Function": { - "id": "Function", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function", - "children": { - "ServiceRole": { - "id": "ServiceRole", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole", - "children": { - "ImportServiceRole": { - "id": "ImportServiceRole", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/ImportServiceRole", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "lambda.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "managedPolicyArns": [ - { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" - ] - ] - } - ], - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" - } - }, - "DefaultPolicy": { - "id": "DefaultPolicy", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/DefaultPolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/DefaultPolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": [ - "ec2:DescribeHosts", - "ec2:DescribeInstanceAttribute", - "ec2:DescribeInstanceStatus", - "ec2:DescribeInstances" - ], - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": "autoscaling:CompleteLifecycleAction", - "Effect": "Allow", - "Resource": { - "Fn::Join": [ - "", - [ - "arn:", - { - "Ref": "AWS::Partition" - }, - ":autoscaling:", - { - "Ref": "AWS::Region" - }, - ":", - { - "Ref": "AWS::AccountId" - }, - ":autoScalingGroup:*:autoScalingGroupName/", - { - "Ref": "ClusterbottlerocketasgASG5424825A" - } - ] - ] - } - }, - { - "Action": [ - "ecs:DescribeContainerInstances", - "ecs:DescribeTasks", - "ecs:ListTasks", - "ecs:UpdateContainerInstancesState" - ], - "Condition": { - "ArnEquals": { - "ecs:cluster": { - "Fn::GetAtt": [ - "ClusterEB0386A7", - "Arn" - ] - } - } - }, - "Effect": "Allow", - "Resource": "*" - }, - { - "Action": [ - "ecs:ListContainerInstances", - "ecs:SubmitContainerStateChange", - "ecs:SubmitTaskStateChange" - ], - "Effect": "Allow", - "Resource": { - "Fn::GetAtt": [ - "ClusterEB0386A7", - "Arn" - ] - } - } - ], - "Version": "2012-10-17" - }, - "policyName": "ClusterbottlerocketasgDrainECSHookFunctionServiceRoleDefaultPolicyBD9C646C", - "roles": [ - { - "Ref": "ClusterbottlerocketasgDrainECSHookFunctionServiceRole91B0C3B3" - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Function", - "aws:cdk:cloudformation:props": { - "code": { - "zipFile": "import boto3, json, os, time\n\necs = boto3.client('ecs')\nautoscaling = boto3.client('autoscaling')\n\n\ndef lambda_handler(event, context):\n print(json.dumps(dict(event, ResponseURL='...')))\n cluster = os.environ['CLUSTER']\n snsTopicArn = event['Records'][0]['Sns']['TopicArn']\n lifecycle_event = json.loads(event['Records'][0]['Sns']['Message'])\n instance_id = lifecycle_event.get('EC2InstanceId')\n if not instance_id:\n print('Got event without EC2InstanceId: %s', json.dumps(dict(event, ResponseURL='...')))\n return\n\n instance_arn = container_instance_arn(cluster, instance_id)\n print('Instance %s has container instance ARN %s' % (lifecycle_event['EC2InstanceId'], instance_arn))\n\n if not instance_arn:\n return\n\n task_arns = container_instance_task_arns(cluster, instance_arn)\n\n if task_arns:\n print('Instance ARN %s has task ARNs %s' % (instance_arn, ', '.join(task_arns)))\n\n while has_tasks(cluster, instance_arn, task_arns):\n time.sleep(10)\n\n try:\n print('Terminating instance %s' % instance_id)\n autoscaling.complete_lifecycle_action(\n LifecycleActionResult='CONTINUE',\n **pick(lifecycle_event, 'LifecycleHookName', 'LifecycleActionToken', 'AutoScalingGroupName'))\n except Exception as e:\n # Lifecycle action may have already completed.\n print(str(e))\n\n\ndef container_instance_arn(cluster, instance_id):\n \"\"\"Turn an instance ID into a container instance ARN.\"\"\"\n arns = ecs.list_container_instances(cluster=cluster, filter='ec2InstanceId==' + instance_id)['containerInstanceArns']\n if not arns:\n return None\n return arns[0]\n\ndef container_instance_task_arns(cluster, instance_arn):\n \"\"\"Fetch tasks for a container instance ARN.\"\"\"\n arns = ecs.list_tasks(cluster=cluster, containerInstance=instance_arn)['taskArns']\n return arns\n\ndef has_tasks(cluster, instance_arn, task_arns):\n \"\"\"Return True if the instance is running tasks for the given cluster.\"\"\"\n instances = ecs.describe_container_instances(cluster=cluster, containerInstances=[instance_arn])['containerInstances']\n if not instances:\n return False\n instance = instances[0]\n\n if instance['status'] == 'ACTIVE':\n # Start draining, then try again later\n set_container_instance_to_draining(cluster, instance_arn)\n return True\n\n task_count = None\n\n if task_arns:\n # Fetch details for tasks running on the container instance\n tasks = ecs.describe_tasks(cluster=cluster, tasks=task_arns)['tasks']\n if tasks:\n # Consider any non-stopped tasks as running\n task_count = sum(task['lastStatus'] != 'STOPPED' for task in tasks) + instance['pendingTasksCount']\n\n if not task_count:\n # Fallback to instance task counts if detailed task information is unavailable\n task_count = instance['runningTasksCount'] + instance['pendingTasksCount']\n\n print('Instance %s has %s tasks' % (instance_arn, task_count))\n\n return task_count > 0\n\ndef set_container_instance_to_draining(cluster, instance_arn):\n ecs.update_container_instances_state(\n cluster=cluster,\n containerInstances=[instance_arn], status='DRAINING')\n\n\ndef pick(dct, *keys):\n \"\"\"Pick a subset of a dict.\"\"\"\n return {k: v for k, v in dct.items() if k in keys}\n" - }, - "environment": { - "variables": { - "CLUSTER": { - "Ref": "ClusterEB0386A7" - } - } - }, - "handler": "index.lambda_handler", - "role": { - "Fn::GetAtt": [ - "ClusterbottlerocketasgDrainECSHookFunctionServiceRole91B0C3B3", - "Arn" - ] - }, - "runtime": "python3.9", - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" - } - ], - "timeout": 310 - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", - "version": "0.0.0" - } - }, - "AllowInvoke:awsecsintegbottlerocketnvidiaamiClusterbottlerocketasgLifecycleHookDrainHookTopic46897984": { - "id": "AllowInvoke:awsecsintegbottlerocketnvidiaamiClusterbottlerocketasgLifecycleHookDrainHookTopic46897984", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/AllowInvoke:awsecsintegbottlerocketnvidiaamiClusterbottlerocketasgLifecycleHookDrainHookTopic46897984", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", - "aws:cdk:cloudformation:props": { - "action": "lambda:InvokeFunction", - "functionName": { - "Fn::GetAtt": [ - "ClusterbottlerocketasgDrainECSHookFunctionFEA27227", - "Arn" - ] - }, - "principal": "sns.amazonaws.com", - "sourceArn": { - "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", - "version": "0.0.0" - } - }, - "Topic": { - "id": "Topic", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/Topic", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/Topic/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::SNS::Subscription", - "aws:cdk:cloudformation:props": { - "endpoint": { - "Fn::GetAtt": [ - "ClusterbottlerocketasgDrainECSHookFunctionFEA27227", - "Arn" - ] - }, - "protocol": "lambda", - "topicArn": { - "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_sns.CfnSubscription", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_sns.Subscription", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_lambda.Function", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.3.0" - } - }, - "LifecycleHookDrainHook": { - "id": "LifecycleHookDrainHook", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook", - "children": { - "Topic": { - "id": "Topic", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Topic", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Topic/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::SNS::Topic", - "aws:cdk:cloudformation:props": { - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_sns.CfnTopic", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_sns.Topic", - "version": "0.0.0" - } - }, - "Role": { - "id": "Role", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role", - "children": { - "ImportRole": { - "id": "ImportRole", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/ImportRole", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Role", - "aws:cdk:cloudformation:props": { - "assumeRolePolicyDocument": { - "Statement": [ - { - "Action": "sts:AssumeRole", - "Effect": "Allow", - "Principal": { - "Service": "autoscaling.amazonaws.com" - } - } - ], - "Version": "2012-10-17" - }, - "tags": [ - { - "key": "Name", - "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnRole", - "version": "0.0.0" - } - }, - "DefaultPolicy": { - "id": "DefaultPolicy", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/DefaultPolicy", - "children": { - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/DefaultPolicy/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::IAM::Policy", - "aws:cdk:cloudformation:props": { - "policyDocument": { - "Statement": [ - { - "Action": "sns:Publish", - "Effect": "Allow", - "Resource": { - "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" - } - } - ], - "Version": "2012-10-17" - }, - "policyName": "ClusterbottlerocketasgLifecycleHookDrainHookRoleDefaultPolicy2C98DD9A", - "roles": [ - { - "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookRole9E2A1D11" - } - ] - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Policy", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_iam.Role", - "version": "0.0.0" - } - }, - "Resource": { - "id": "Resource", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Resource", - "attributes": { - "aws:cdk:cloudformation:type": "AWS::AutoScaling::LifecycleHook", - "aws:cdk:cloudformation:props": { - "autoScalingGroupName": { - "Ref": "ClusterbottlerocketasgASG5424825A" - }, - "defaultResult": "CONTINUE", - "heartbeatTimeout": 300, - "lifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING", - "notificationTargetArn": { - "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" - }, - "roleArn": { - "Fn::GetAtt": [ - "ClusterbottlerocketasgLifecycleHookDrainHookRole9E2A1D11", - "Arn" - ] - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_autoscaling.CfnLifecycleHook", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_autoscaling.LifecycleHook", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_autoscaling.AutoScalingGroup", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.aws_ecs.Cluster", - "version": "0.0.0" - } - }, - "SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1-nvidia--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": { - "id": "SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1-nvidia--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1-nvidia--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnParameter", - "version": "0.0.0" - } - }, - "SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1-nvidia--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118": { - "id": "SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1-nvidia--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/SsmParameterValue:--aws--service--bottlerocket--aws-ecs-1-nvidia--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", - "constructInfo": { - "fqn": "aws-cdk-lib.Resource", - "version": "0.0.0" - } - }, - "BootstrapVersion": { - "id": "BootstrapVersion", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/BootstrapVersion", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnParameter", - "version": "0.0.0" - } - }, - "CheckBootstrapVersion": { - "id": "CheckBootstrapVersion", - "path": "aws-ecs-integ-bottlerocket-nvidia-ami/CheckBootstrapVersion", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnRule", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.Stack", - "version": "0.0.0" - } - }, - "aws-ecs-bottlerocket-nvidia-ami": { - "id": "aws-ecs-bottlerocket-nvidia-ami", - "path": "aws-ecs-bottlerocket-nvidia-ami", - "children": { - "DefaultTest": { - "id": "DefaultTest", - "path": "aws-ecs-bottlerocket-nvidia-ami/DefaultTest", - "children": { - "Default": { - "id": "Default", - "path": "aws-ecs-bottlerocket-nvidia-ami/DefaultTest/Default", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.3.0" - } - }, - "DeployAssert": { - "id": "DeployAssert", - "path": "aws-ecs-bottlerocket-nvidia-ami/DefaultTest/DeployAssert", - "children": { - "BootstrapVersion": { - "id": "BootstrapVersion", - "path": "aws-ecs-bottlerocket-nvidia-ami/DefaultTest/DeployAssert/BootstrapVersion", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnParameter", - "version": "0.0.0" - } - }, - "CheckBootstrapVersion": { - "id": "CheckBootstrapVersion", - "path": "aws-ecs-bottlerocket-nvidia-ami/DefaultTest/DeployAssert/CheckBootstrapVersion", - "constructInfo": { - "fqn": "aws-cdk-lib.CfnRule", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.Stack", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", - "version": "0.0.0" - } - } - }, - "constructInfo": { - "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", - "version": "0.0.0" - } - }, - "Tree": { - "id": "Tree", - "path": "Tree", - "constructInfo": { - "fqn": "constructs.Construct", - "version": "10.3.0" - } - } - }, - "constructInfo": { - "fqn": "aws-cdk-lib.App", - "version": "0.0.0" - } - } -} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.ts index 778a889baff00..6e44c07efbd3f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.ts @@ -13,7 +13,7 @@ const cluster = new ecs.Cluster(stack, 'Cluster', { }); cluster.addCapacity('bottlerocket-asg', { minCapacity: 2, - instanceType: new ec2.InstanceType('c5.large'), + instanceType: new ec2.InstanceType('p3.2xlarge'), machineImage: new ecs.BottleRocketImage({ variant: ecs.BottlerocketEcsVariant.AWS_ECS_1_NVIDIA, }), diff --git a/packages/aws-cdk-lib/aws-ecs/test/amis.test.ts b/packages/aws-cdk-lib/aws-ecs/test/amis.test.ts index 59e2568d55cec..f5bf64f419325 100644 --- a/packages/aws-cdk-lib/aws-ecs/test/amis.test.ts +++ b/packages/aws-cdk-lib/aws-ecs/test/amis.test.ts @@ -2,22 +2,26 @@ import * as cdk from '../../core'; import * as ecs from '../lib'; describe('amis', () => { - test('BottleRocketImage with NVIDIA variant', () => { + test.each([ + [ecs.BottlerocketEcsVariant.AWS_ECS_1, 'SsmParameterValueawsservicebottlerocketawsecs1x8664'], + [ecs.BottlerocketEcsVariant.AWS_ECS_1_NVIDIA, 'SsmParameterValueawsservicebottlerocketawsecs1nvidiax8664'], + [ecs.BottlerocketEcsVariant.AWS_ECS_2, 'SsmParameterValueawsservicebottlerocketawsecs2x8664'], + [ecs.BottlerocketEcsVariant.AWS_ECS_2_NVIDIA, 'SsmParameterValueawsservicebottlerocketawsecs2nvidiax8664'], + ])('BottleRocketImage with %s variant', (variant, ssmKey) => { // GIVEN const app = new cdk.App(); const stack = new cdk.Stack(app); // WHEN new ecs.BottleRocketImage({ - variant: ecs.BottlerocketEcsVariant.AWS_ECS_1_NVIDIA, + variant, }).getImage(stack); - /// THEN + // THEN const assembly = app.synth(); const parameters = assembly.getStackByName(stack.stackName).template.Parameters; expect(Object.entries(parameters).some( - ([k, v]) => k.startsWith('SsmParameterValueawsservicebottlerocketawsecs1nvidiax8664') && - (v as any).Default.includes('/bottlerocket/aws-ecs-1-nvidia/x86_64/'), + ([k, v]) => k.startsWith(ssmKey) && (v as any).Default.includes(`/bottlerocket/${variant}/x86_64/`), )).toEqual(true); }); }); From 98a96adcf16e62ce148f6a9c99cf84d9b3e311f5 Mon Sep 17 00:00:00 2001 From: Kazuho CryerShinozuka Date: Wed, 27 Dec 2023 23:25:41 +0900 Subject: [PATCH 09/10] feat: temp --- .../aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.ts | 5 ++++- packages/aws-cdk-lib/aws-ecs/README.md | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.ts index 6e44c07efbd3f..05bc4a7ce97f4 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.ts @@ -15,8 +15,11 @@ cluster.addCapacity('bottlerocket-asg', { minCapacity: 2, instanceType: new ec2.InstanceType('p3.2xlarge'), machineImage: new ecs.BottleRocketImage({ - variant: ecs.BottlerocketEcsVariant.AWS_ECS_1_NVIDIA, + variant: ecs.BottlerocketEcsVariant.AWS_ECS_2_NVIDIA, }), + vpcSubnets: { + availabilityZones: ['us-east-1c'], + }, }); new integ.IntegTest(app, 'aws-ecs-bottlerocket-nvidia-ami', { diff --git a/packages/aws-cdk-lib/aws-ecs/README.md b/packages/aws-cdk-lib/aws-ecs/README.md index 19eeca0a6a0b2..0acd9501176b5 100644 --- a/packages/aws-cdk-lib/aws-ecs/README.md +++ b/packages/aws-cdk-lib/aws-ecs/README.md @@ -229,9 +229,9 @@ declare const cluster: ecs.Cluster; cluster.addCapacity('bottlerocket-asg', { minCapacity: 2, - instanceType: new ec2.InstanceType('c5.large'), + instanceType: new ec2.InstanceType('p3.2xlarge'), machineImage: new ecs.BottleRocketImage({ - variant: ecs.BottlerocketEcsVariant.AWS_ECS_1_NVIDIA, + variant: ecs.BottlerocketEcsVariant.AWS_ECS_2_NVIDIA, }), }); ``` From ef327d961dca123996b8b2c1841182b2c8ef06c5 Mon Sep 17 00:00:00 2001 From: Kazuho CryerShinozuka Date: Thu, 28 Dec 2023 00:55:28 +0900 Subject: [PATCH 10/10] test: integ test --- ...-integ-bottlerocket-nvidia-ami.assets.json | 19 + ...nteg-bottlerocket-nvidia-ami.template.json | 965 ++++++++++ ...efaultTestDeployAssert682D6B79.assets.json | 19 + ...aultTestDeployAssert682D6B79.template.json | 36 + .../cdk.out | 1 + .../integ.json | 12 + .../manifest.json | 347 ++++ .../tree.json | 1583 +++++++++++++++++ .../integ.cluster-bottlerocket-nvidia-ami.ts | 9 +- packages/aws-cdk-lib/aws-ecs/README.md | 1 - 10 files changed, 2985 insertions(+), 7 deletions(-) create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/aws-ecs-integ-bottlerocket-nvidia-ami.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/aws-ecs-integ-bottlerocket-nvidia-ami.template.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.assets.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.template.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/cdk.out create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/integ.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/manifest.json create mode 100644 packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/tree.json diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/aws-ecs-integ-bottlerocket-nvidia-ami.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/aws-ecs-integ-bottlerocket-nvidia-ami.assets.json new file mode 100644 index 0000000000000..1ada4a62eae05 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/aws-ecs-integ-bottlerocket-nvidia-ami.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "25ecc9ee1f79cd8a912202279ab524c1d49216ee0be93a5179ef19f50cd1b1ba": { + "source": { + "path": "aws-ecs-integ-bottlerocket-nvidia-ami.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "25ecc9ee1f79cd8a912202279ab524c1d49216ee0be93a5179ef19f50cd1b1ba.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-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/aws-ecs-integ-bottlerocket-nvidia-ami.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/aws-ecs-integ-bottlerocket-nvidia-ami.template.json new file mode 100644 index 0000000000000..b393e63b3fec4 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/aws-ecs-integ-bottlerocket-nvidia-ami.template.json @@ -0,0 +1,965 @@ +{ + "Resources": { + "Vpc8378EB38": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc" + } + ] + } + }, + "VpcPublicSubnet1Subnet5C2D37C4": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.0.0/18", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPublicSubnet1RouteTable6C95E38E": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPublicSubnet1RouteTableAssociation97140677": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcPublicSubnet1RouteTable6C95E38E" + }, + "SubnetId": { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + } + } + }, + "VpcPublicSubnet1DefaultRoute3DA9E72A": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "RouteTableId": { + "Ref": "VpcPublicSubnet1RouteTable6C95E38E" + } + }, + "DependsOn": [ + "VpcVPCGWBF912B6E" + ] + }, + "VpcPublicSubnet1EIPD7E02669": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1" + } + ] + } + }, + "VpcPublicSubnet1NATGateway4D7517AA": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "VpcPublicSubnet1EIPD7E02669", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1" + } + ] + }, + "DependsOn": [ + "VpcPublicSubnet1DefaultRoute3DA9E72A", + "VpcPublicSubnet1RouteTableAssociation97140677" + ] + }, + "VpcPublicSubnet2Subnet691E08A3": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.64.0/18", + "MapPublicIpOnLaunch": true, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Public" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Public" + }, + { + "Key": "Name", + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPublicSubnet2RouteTable94F7E489": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPublicSubnet2RouteTableAssociationDD5762D8": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcPublicSubnet2RouteTable94F7E489" + }, + "SubnetId": { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + } + } + }, + "VpcPublicSubnet2DefaultRoute97F91067": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "RouteTableId": { + "Ref": "VpcPublicSubnet2RouteTable94F7E489" + } + }, + "DependsOn": [ + "VpcVPCGWBF912B6E" + ] + }, + "VpcPublicSubnet2EIP3C605A87": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2" + } + ] + } + }, + "VpcPublicSubnet2NATGateway9182C01D": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "VpcPublicSubnet2EIP3C605A87", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2" + } + ] + }, + "DependsOn": [ + "VpcPublicSubnet2DefaultRoute97F91067", + "VpcPublicSubnet2RouteTableAssociationDD5762D8" + ] + }, + "VpcPrivateSubnet1Subnet536B997A": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.128.0/18", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPrivateSubnet1RouteTableB2C5B500": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPrivateSubnet1RouteTableAssociation70C59FA6": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcPrivateSubnet1RouteTableB2C5B500" + }, + "SubnetId": { + "Ref": "VpcPrivateSubnet1Subnet536B997A" + } + } + }, + "VpcPrivateSubnet1DefaultRouteBE02A9ED": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "VpcPublicSubnet1NATGateway4D7517AA" + }, + "RouteTableId": { + "Ref": "VpcPrivateSubnet1RouteTableB2C5B500" + } + } + }, + "VpcPrivateSubnet2Subnet3788AAA1": { + "Type": "AWS::EC2::Subnet", + "Properties": { + "AvailabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "CidrBlock": "10.0.192.0/18", + "MapPublicIpOnLaunch": false, + "Tags": [ + { + "Key": "aws-cdk:subnet-name", + "Value": "Private" + }, + { + "Key": "aws-cdk:subnet-type", + "Value": "Private" + }, + { + "Key": "Name", + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPrivateSubnet2RouteTableA678073B": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "VpcPrivateSubnet2RouteTableAssociationA89CAD56": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "VpcPrivateSubnet2RouteTableA678073B" + }, + "SubnetId": { + "Ref": "VpcPrivateSubnet2Subnet3788AAA1" + } + } + }, + "VpcPrivateSubnet2DefaultRoute060D2087": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "VpcPublicSubnet2NATGateway9182C01D" + }, + "RouteTableId": { + "Ref": "VpcPrivateSubnet2RouteTableA678073B" + } + } + }, + "VpcIGWD7BA715C": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc" + } + ] + } + }, + "VpcVPCGWBF912B6E": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "InternetGatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "ClusterEB0386A7": { + "Type": "AWS::ECS::Cluster" + }, + "ClusterbottlerocketasgInstanceSecurityGroupE1EAEF75": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceSecurityGroup", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" + } + ], + "VpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "ClusterbottlerocketasgInstanceRoleD105ACA5": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/AmazonSSMManagedInstanceCore" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role" + ] + ] + } + ], + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" + } + ] + } + }, + "ClusterbottlerocketasgInstanceRoleDefaultPolicyBB6119DC": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ecs:DeregisterContainerInstance", + "ecs:RegisterContainerInstance", + "ecs:Submit*" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ClusterEB0386A7", + "Arn" + ] + } + }, + { + "Action": [ + "ecs:Poll", + "ecs:StartTelemetrySession" + ], + "Condition": { + "ArnEquals": { + "ecs:cluster": { + "Fn::GetAtt": [ + "ClusterEB0386A7", + "Arn" + ] + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecr:GetAuthorizationToken", + "ecs:DiscoverPollEndpoint", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ClusterbottlerocketasgInstanceRoleDefaultPolicyBB6119DC", + "Roles": [ + { + "Ref": "ClusterbottlerocketasgInstanceRoleD105ACA5" + } + ] + } + }, + "ClusterbottlerocketasgInstanceProfile424C4AC3": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "ClusterbottlerocketasgInstanceRoleD105ACA5" + } + ] + } + }, + "ClusterbottlerocketasgLaunchTemplate45A2FA5C": { + "Type": "AWS::EC2::LaunchTemplate", + "Properties": { + "LaunchTemplateData": { + "IamInstanceProfile": { + "Arn": { + "Fn::GetAtt": [ + "ClusterbottlerocketasgInstanceProfile424C4AC3", + "Arn" + ] + } + }, + "ImageId": { + "Ref": "SsmParameterValueawsservicebottlerocketawsecs2nvidiax8664latestimageidC96584B6F00A464EAD1953AFF4B05118Parameter" + }, + "InstanceType": "g3s.xlarge", + "Monitoring": { + "Enabled": false + }, + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "ClusterbottlerocketasgInstanceSecurityGroupE1EAEF75", + "GroupId" + ] + } + ], + "TagSpecifications": [ + { + "ResourceType": "instance", + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LaunchTemplate" + } + ] + }, + { + "ResourceType": "volume", + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LaunchTemplate" + } + ] + } + ], + "UserData": { + "Fn::Base64": { + "Fn::Join": [ + "", + [ + "\n[settings.ecs]\ncluster = \"", + { + "Ref": "ClusterEB0386A7" + }, + "\"" + ] + ] + } + } + }, + "TagSpecifications": [ + { + "ResourceType": "launch-template", + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LaunchTemplate" + } + ] + } + ] + }, + "DependsOn": [ + "ClusterbottlerocketasgInstanceRoleDefaultPolicyBB6119DC", + "ClusterbottlerocketasgInstanceRoleD105ACA5" + ] + }, + "ClusterbottlerocketasgASG5424825A": { + "Type": "AWS::AutoScaling::AutoScalingGroup", + "Properties": { + "LaunchTemplate": { + "LaunchTemplateId": { + "Ref": "ClusterbottlerocketasgLaunchTemplate45A2FA5C" + }, + "Version": { + "Fn::GetAtt": [ + "ClusterbottlerocketasgLaunchTemplate45A2FA5C", + "LatestVersionNumber" + ] + } + }, + "MaxSize": "1", + "MinSize": "0", + "Tags": [ + { + "Key": "Name", + "PropagateAtLaunch": true, + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" + } + ], + "VPCZoneIdentifier": [ + { + "Ref": "VpcPrivateSubnet1Subnet536B997A" + }, + { + "Ref": "VpcPrivateSubnet2Subnet3788AAA1" + } + ] + }, + "UpdatePolicy": { + "AutoScalingReplacingUpdate": { + "WillReplace": true + }, + "AutoScalingScheduledAction": { + "IgnoreUnmodifiedGroupSizeProperties": true + } + } + }, + "ClusterbottlerocketasgDrainECSHookFunctionServiceRole91B0C3B3": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ], + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" + } + ] + } + }, + "ClusterbottlerocketasgDrainECSHookFunctionServiceRoleDefaultPolicyBD9C646C": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "ec2:DescribeHosts", + "ec2:DescribeInstanceAttribute", + "ec2:DescribeInstanceStatus", + "ec2:DescribeInstances" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "autoscaling:CompleteLifecycleAction", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":autoscaling:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":autoScalingGroup:*:autoScalingGroupName/", + { + "Ref": "ClusterbottlerocketasgASG5424825A" + } + ] + ] + } + }, + { + "Action": [ + "ecs:DescribeContainerInstances", + "ecs:DescribeTasks", + "ecs:ListTasks", + "ecs:UpdateContainerInstancesState" + ], + "Condition": { + "ArnEquals": { + "ecs:cluster": { + "Fn::GetAtt": [ + "ClusterEB0386A7", + "Arn" + ] + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecs:ListContainerInstances", + "ecs:SubmitContainerStateChange", + "ecs:SubmitTaskStateChange" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ClusterEB0386A7", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ClusterbottlerocketasgDrainECSHookFunctionServiceRoleDefaultPolicyBD9C646C", + "Roles": [ + { + "Ref": "ClusterbottlerocketasgDrainECSHookFunctionServiceRole91B0C3B3" + } + ] + } + }, + "ClusterbottlerocketasgDrainECSHookFunctionFEA27227": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "ZipFile": "import boto3, json, os, time\n\necs = boto3.client('ecs')\nautoscaling = boto3.client('autoscaling')\n\n\ndef lambda_handler(event, context):\n print(json.dumps(dict(event, ResponseURL='...')))\n cluster = os.environ['CLUSTER']\n snsTopicArn = event['Records'][0]['Sns']['TopicArn']\n lifecycle_event = json.loads(event['Records'][0]['Sns']['Message'])\n instance_id = lifecycle_event.get('EC2InstanceId')\n if not instance_id:\n print('Got event without EC2InstanceId: %s', json.dumps(dict(event, ResponseURL='...')))\n return\n\n instance_arn = container_instance_arn(cluster, instance_id)\n print('Instance %s has container instance ARN %s' % (lifecycle_event['EC2InstanceId'], instance_arn))\n\n if not instance_arn:\n return\n\n task_arns = container_instance_task_arns(cluster, instance_arn)\n\n if task_arns:\n print('Instance ARN %s has task ARNs %s' % (instance_arn, ', '.join(task_arns)))\n\n while has_tasks(cluster, instance_arn, task_arns):\n time.sleep(10)\n\n try:\n print('Terminating instance %s' % instance_id)\n autoscaling.complete_lifecycle_action(\n LifecycleActionResult='CONTINUE',\n **pick(lifecycle_event, 'LifecycleHookName', 'LifecycleActionToken', 'AutoScalingGroupName'))\n except Exception as e:\n # Lifecycle action may have already completed.\n print(str(e))\n\n\ndef container_instance_arn(cluster, instance_id):\n \"\"\"Turn an instance ID into a container instance ARN.\"\"\"\n arns = ecs.list_container_instances(cluster=cluster, filter='ec2InstanceId==' + instance_id)['containerInstanceArns']\n if not arns:\n return None\n return arns[0]\n\ndef container_instance_task_arns(cluster, instance_arn):\n \"\"\"Fetch tasks for a container instance ARN.\"\"\"\n arns = ecs.list_tasks(cluster=cluster, containerInstance=instance_arn)['taskArns']\n return arns\n\ndef has_tasks(cluster, instance_arn, task_arns):\n \"\"\"Return True if the instance is running tasks for the given cluster.\"\"\"\n instances = ecs.describe_container_instances(cluster=cluster, containerInstances=[instance_arn])['containerInstances']\n if not instances:\n return False\n instance = instances[0]\n\n if instance['status'] == 'ACTIVE':\n # Start draining, then try again later\n set_container_instance_to_draining(cluster, instance_arn)\n return True\n\n task_count = None\n\n if task_arns:\n # Fetch details for tasks running on the container instance\n tasks = ecs.describe_tasks(cluster=cluster, tasks=task_arns)['tasks']\n if tasks:\n # Consider any non-stopped tasks as running\n task_count = sum(task['lastStatus'] != 'STOPPED' for task in tasks) + instance['pendingTasksCount']\n\n if not task_count:\n # Fallback to instance task counts if detailed task information is unavailable\n task_count = instance['runningTasksCount'] + instance['pendingTasksCount']\n\n print('Instance %s has %s tasks' % (instance_arn, task_count))\n\n return task_count > 0\n\ndef set_container_instance_to_draining(cluster, instance_arn):\n ecs.update_container_instances_state(\n cluster=cluster,\n containerInstances=[instance_arn], status='DRAINING')\n\n\ndef pick(dct, *keys):\n \"\"\"Pick a subset of a dict.\"\"\"\n return {k: v for k, v in dct.items() if k in keys}\n" + }, + "Environment": { + "Variables": { + "CLUSTER": { + "Ref": "ClusterEB0386A7" + } + } + }, + "Handler": "index.lambda_handler", + "Role": { + "Fn::GetAtt": [ + "ClusterbottlerocketasgDrainECSHookFunctionServiceRole91B0C3B3", + "Arn" + ] + }, + "Runtime": "python3.9", + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" + } + ], + "Timeout": 310 + }, + "DependsOn": [ + "ClusterbottlerocketasgDrainECSHookFunctionServiceRoleDefaultPolicyBD9C646C", + "ClusterbottlerocketasgDrainECSHookFunctionServiceRole91B0C3B3" + ] + }, + "ClusterbottlerocketasgDrainECSHookFunctionAllowInvokeawsecsintegbottlerocketnvidiaamiClusterbottlerocketasgLifecycleHookDrainHookTopic46897984C264A0A5": { + "Type": "AWS::Lambda::Permission", + "Properties": { + "Action": "lambda:InvokeFunction", + "FunctionName": { + "Fn::GetAtt": [ + "ClusterbottlerocketasgDrainECSHookFunctionFEA27227", + "Arn" + ] + }, + "Principal": "sns.amazonaws.com", + "SourceArn": { + "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" + } + } + }, + "ClusterbottlerocketasgDrainECSHookFunctionTopicC875173C": { + "Type": "AWS::SNS::Subscription", + "Properties": { + "Endpoint": { + "Fn::GetAtt": [ + "ClusterbottlerocketasgDrainECSHookFunctionFEA27227", + "Arn" + ] + }, + "Protocol": "lambda", + "TopicArn": { + "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" + } + } + }, + "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02": { + "Type": "AWS::SNS::Topic", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" + } + ] + } + }, + "ClusterbottlerocketasgLifecycleHookDrainHookRole9E2A1D11": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "autoscaling.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "Name", + "Value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" + } + ] + } + }, + "ClusterbottlerocketasgLifecycleHookDrainHookRoleDefaultPolicy2C98DD9A": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "sns:Publish", + "Effect": "Allow", + "Resource": { + "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "ClusterbottlerocketasgLifecycleHookDrainHookRoleDefaultPolicy2C98DD9A", + "Roles": [ + { + "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookRole9E2A1D11" + } + ] + } + }, + "ClusterbottlerocketasgLifecycleHookDrainHook00055B9D": { + "Type": "AWS::AutoScaling::LifecycleHook", + "Properties": { + "AutoScalingGroupName": { + "Ref": "ClusterbottlerocketasgASG5424825A" + }, + "DefaultResult": "CONTINUE", + "HeartbeatTimeout": 300, + "LifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING", + "NotificationTargetARN": { + "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" + }, + "RoleARN": { + "Fn::GetAtt": [ + "ClusterbottlerocketasgLifecycleHookDrainHookRole9E2A1D11", + "Arn" + ] + } + }, + "DependsOn": [ + "ClusterbottlerocketasgLifecycleHookDrainHookRoleDefaultPolicy2C98DD9A", + "ClusterbottlerocketasgLifecycleHookDrainHookRole9E2A1D11" + ] + } + }, + "Parameters": { + "SsmParameterValueawsservicebottlerocketawsecs2nvidiax8664latestimageidC96584B6F00A464EAD1953AFF4B05118Parameter": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/aws/service/bottlerocket/aws-ecs-2-nvidia/x86_64/latest/image_id" + }, + "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-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.assets.json new file mode 100644 index 0000000000000..6a67204f0bdff --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.0", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.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-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.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-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/cdk.out new file mode 100644 index 0000000000000..1f0068d32659a --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"36.0.0"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/integ.json new file mode 100644 index 0000000000000..a6bfe4d8bc3ff --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "36.0.0", + "testCases": { + "aws-ecs-bottlerocket-nvidia-ami/DefaultTest": { + "stacks": [ + "aws-ecs-integ-bottlerocket-nvidia-ami" + ], + "assertionStack": "aws-ecs-bottlerocket-nvidia-ami/DefaultTest/DeployAssert", + "assertionStackName": "awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/manifest.json new file mode 100644 index 0000000000000..28658ca520aa3 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/manifest.json @@ -0,0 +1,347 @@ +{ + "version": "36.0.0", + "artifacts": { + "aws-ecs-integ-bottlerocket-nvidia-ami.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "aws-ecs-integ-bottlerocket-nvidia-ami.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "aws-ecs-integ-bottlerocket-nvidia-ami": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "aws-ecs-integ-bottlerocket-nvidia-ami.template.json", + "terminationProtection": false, + "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}/25ecc9ee1f79cd8a912202279ab524c1d49216ee0be93a5179ef19f50cd1b1ba.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "aws-ecs-integ-bottlerocket-nvidia-ami.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "aws-ecs-integ-bottlerocket-nvidia-ami.assets" + ], + "metadata": { + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "Vpc8378EB38" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet1Subnet5C2D37C4" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet1RouteTable6C95E38E" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet1RouteTableAssociation97140677" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet1DefaultRoute3DA9E72A" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet1EIPD7E02669" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet1NATGateway4D7517AA" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet2Subnet691E08A3" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet2RouteTable94F7E489" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet2RouteTableAssociationDD5762D8" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet2DefaultRoute97F91067" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet2EIP3C605A87" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPublicSubnet2NATGateway9182C01D" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPrivateSubnet1Subnet536B997A" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPrivateSubnet1RouteTableB2C5B500" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPrivateSubnet1RouteTableAssociation70C59FA6" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPrivateSubnet1DefaultRouteBE02A9ED" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPrivateSubnet2Subnet3788AAA1" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPrivateSubnet2RouteTableA678073B" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPrivateSubnet2RouteTableAssociationA89CAD56" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcPrivateSubnet2DefaultRoute060D2087" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/IGW": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcIGWD7BA715C" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/VPCGW": [ + { + "type": "aws:cdk:logicalId", + "data": "VpcVPCGWBF912B6E" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterEB0386A7" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceSecurityGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgInstanceSecurityGroupE1EAEF75" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgInstanceRoleD105ACA5" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgInstanceRoleDefaultPolicyBB6119DC" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceProfile": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgInstanceProfile424C4AC3" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LaunchTemplate/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgLaunchTemplate45A2FA5C" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/ASG": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgASG5424825A" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgDrainECSHookFunctionServiceRole91B0C3B3" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgDrainECSHookFunctionServiceRoleDefaultPolicyBD9C646C" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgDrainECSHookFunctionFEA27227" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/AllowInvoke:awsecsintegbottlerocketnvidiaamiClusterbottlerocketasgLifecycleHookDrainHookTopic46897984": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgDrainECSHookFunctionAllowInvokeawsecsintegbottlerocketnvidiaamiClusterbottlerocketasgLifecycleHookDrainHookTopic46897984C264A0A5" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/Topic/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgDrainECSHookFunctionTopicC875173C" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Topic/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgLifecycleHookDrainHookRole9E2A1D11" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/DefaultPolicy/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgLifecycleHookDrainHookRoleDefaultPolicy2C98DD9A" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "ClusterbottlerocketasgLifecycleHookDrainHook00055B9D" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/SsmParameterValue:--aws--service--bottlerocket--aws-ecs-2-nvidia--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ + { + "type": "aws:cdk:logicalId", + "data": "SsmParameterValueawsservicebottlerocketawsecs2nvidiax8664latestimageidC96584B6F00A464EAD1953AFF4B05118Parameter" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/aws-ecs-integ-bottlerocket-nvidia-ami/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "aws-ecs-integ-bottlerocket-nvidia-ami" + }, + "awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.template.json", + "terminationProtection": false, + "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": [ + "awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.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": [ + "awsecsbottlerocketnvidiaamiDefaultTestDeployAssert682D6B79.assets" + ], + "metadata": { + "/aws-ecs-bottlerocket-nvidia-ami/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/aws-ecs-bottlerocket-nvidia-ami/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "aws-ecs-bottlerocket-nvidia-ami/DefaultTest/DeployAssert" + }, + "Tree": { + "type": "cdk:tree", + "properties": { + "file": "tree.json" + } + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/tree.json new file mode 100644 index 0000000000000..0f1c006667121 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.js.snapshot/tree.json @@ -0,0 +1,1583 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "aws-ecs-integ-bottlerocket-nvidia-ami": { + "id": "aws-ecs-integ-bottlerocket-nvidia-ami", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami", + "children": { + "Vpc": { + "id": "Vpc", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPC", + "aws:cdk:cloudformation:props": { + "cidrBlock": "10.0.0.0/16", + "enableDnsHostnames": true, + "enableDnsSupport": true, + "instanceTenancy": "default", + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPC", + "version": "0.0.0" + } + }, + "PublicSubnet1": { + "id": "PublicSubnet1", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.0.0/18", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VpcPublicSubnet1RouteTable6C95E38E" + }, + "subnetId": { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "routeTableId": { + "Ref": "VpcPublicSubnet1RouteTable6C95E38E" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + }, + "EIP": { + "id": "EIP", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", + "version": "0.0.0" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1/NATGateway", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", + "aws:cdk:cloudformation:props": { + "allocationId": { + "Fn::GetAtt": [ + "VpcPublicSubnet1EIPD7E02669", + "AllocationId" + ] + }, + "subnetId": { + "Ref": "VpcPublicSubnet1Subnet5C2D37C4" + }, + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", + "version": "0.0.0" + } + }, + "PublicSubnet2": { + "id": "PublicSubnet2", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.64.0/18", + "mapPublicIpOnLaunch": true, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Public" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Public" + }, + { + "key": "Name", + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VpcPublicSubnet2RouteTable94F7E489" + }, + "subnetId": { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "routeTableId": { + "Ref": "VpcPublicSubnet2RouteTable94F7E489" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + }, + "EIP": { + "id": "EIP", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnEIP", + "version": "0.0.0" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2/NATGateway", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", + "aws:cdk:cloudformation:props": { + "allocationId": { + "Fn::GetAtt": [ + "VpcPublicSubnet2EIP3C605A87", + "AllocationId" + ] + }, + "subnetId": { + "Ref": "VpcPublicSubnet2Subnet691E08A3" + }, + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnNatGateway", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PublicSubnet", + "version": "0.0.0" + } + }, + "PrivateSubnet1": { + "id": "PrivateSubnet1", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 0, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.128.0/18", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Private" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Private" + }, + { + "key": "Name", + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VpcPrivateSubnet1RouteTableB2C5B500" + }, + "subnetId": { + "Ref": "VpcPrivateSubnet1Subnet536B997A" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "natGatewayId": { + "Ref": "VpcPublicSubnet1NATGateway4D7517AA" + }, + "routeTableId": { + "Ref": "VpcPrivateSubnet1RouteTableB2C5B500" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "PrivateSubnet2": { + "id": "PrivateSubnet2", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2/Subnet", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Subnet", + "aws:cdk:cloudformation:props": { + "availabilityZone": { + "Fn::Select": [ + 1, + { + "Fn::GetAZs": "" + } + ] + }, + "cidrBlock": "10.0.192.0/18", + "mapPublicIpOnLaunch": false, + "tags": [ + { + "key": "aws-cdk:subnet-name", + "value": "Private" + }, + { + "key": "aws-cdk:subnet-type", + "value": "Private" + }, + { + "key": "Name", + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnet", + "version": "0.0.0" + } + }, + "Acl": { + "id": "Acl", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2/Acl", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRouteTable", + "version": "0.0.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "VpcPrivateSubnet2RouteTableA678073B" + }, + "subnetId": { + "Ref": "VpcPrivateSubnet2Subnet3788AAA1" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation", + "version": "0.0.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/PrivateSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "natGatewayId": { + "Ref": "VpcPublicSubnet2NATGateway9182C01D" + }, + "routeTableId": { + "Ref": "VpcPrivateSubnet2RouteTableA678073B" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnRoute", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.PrivateSubnet", + "version": "0.0.0" + } + }, + "IGW": { + "id": "IGW", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/IGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnInternetGateway", + "version": "0.0.0" + } + }, + "VPCGW": { + "id": "VPCGW", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Vpc/VPCGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", + "aws:cdk:cloudformation:props": { + "internetGatewayId": { + "Ref": "VpcIGWD7BA715C" + }, + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.Vpc", + "version": "0.0.0" + } + }, + "Cluster": { + "id": "Cluster", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::ECS::Cluster", + "aws:cdk:cloudformation:props": {} + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ecs.CfnCluster", + "version": "0.0.0" + } + }, + "bottlerocket-asg": { + "id": "bottlerocket-asg", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg", + "children": { + "InstanceSecurityGroup": { + "id": "InstanceSecurityGroup", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceSecurityGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceSecurityGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceSecurityGroup", + "securityGroupEgress": [ + { + "cidrIp": "0.0.0.0/0", + "description": "Allow all outbound traffic by default", + "ipProtocol": "-1" + } + ], + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" + } + ], + "vpcId": { + "Ref": "Vpc8378EB38" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnSecurityGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.SecurityGroup", + "version": "0.0.0" + } + }, + "InstanceRole": { + "id": "InstanceRole", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceRole", + "children": { + "ImportInstanceRole": { + "id": "ImportInstanceRole", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceRole/ImportInstanceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/AmazonSSMManagedInstanceCore" + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role" + ] + ] + } + ], + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": [ + "ecs:DeregisterContainerInstance", + "ecs:RegisterContainerInstance", + "ecs:Submit*" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ClusterEB0386A7", + "Arn" + ] + } + }, + { + "Action": [ + "ecs:Poll", + "ecs:StartTelemetrySession" + ], + "Condition": { + "ArnEquals": { + "ecs:cluster": { + "Fn::GetAtt": [ + "ClusterEB0386A7", + "Arn" + ] + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecr:GetAuthorizationToken", + "ecs:DiscoverPollEndpoint", + "logs:CreateLogStream", + "logs:PutLogEvents" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "policyName": "ClusterbottlerocketasgInstanceRoleDefaultPolicyBB6119DC", + "roles": [ + { + "Ref": "ClusterbottlerocketasgInstanceRoleD105ACA5" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" + } + }, + "InstanceProfile": { + "id": "InstanceProfile", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/InstanceProfile", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::InstanceProfile", + "aws:cdk:cloudformation:props": { + "roles": [ + { + "Ref": "ClusterbottlerocketasgInstanceRoleD105ACA5" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnInstanceProfile", + "version": "0.0.0" + } + }, + "ImportedInstanceProfile": { + "id": "ImportedInstanceProfile", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/ImportedInstanceProfile", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "LaunchTemplate": { + "id": "LaunchTemplate", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LaunchTemplate", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LaunchTemplate/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::LaunchTemplate", + "aws:cdk:cloudformation:props": { + "launchTemplateData": { + "iamInstanceProfile": { + "arn": { + "Fn::GetAtt": [ + "ClusterbottlerocketasgInstanceProfile424C4AC3", + "Arn" + ] + } + }, + "imageId": { + "Ref": "SsmParameterValueawsservicebottlerocketawsecs2nvidiax8664latestimageidC96584B6F00A464EAD1953AFF4B05118Parameter" + }, + "instanceType": "g3s.xlarge", + "monitoring": { + "enabled": false + }, + "securityGroupIds": [ + { + "Fn::GetAtt": [ + "ClusterbottlerocketasgInstanceSecurityGroupE1EAEF75", + "GroupId" + ] + } + ], + "tagSpecifications": [ + { + "resourceType": "instance", + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LaunchTemplate" + } + ] + }, + { + "resourceType": "volume", + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LaunchTemplate" + } + ] + } + ], + "userData": { + "Fn::Base64": { + "Fn::Join": [ + "", + [ + "\n[settings.ecs]\ncluster = \"", + { + "Ref": "ClusterEB0386A7" + }, + "\"" + ] + ] + } + } + }, + "tagSpecifications": [ + { + "resourceType": "launch-template", + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LaunchTemplate" + } + ] + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.CfnLaunchTemplate", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ec2.LaunchTemplate", + "version": "0.0.0" + } + }, + "ASG": { + "id": "ASG", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/ASG", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::AutoScaling::AutoScalingGroup", + "aws:cdk:cloudformation:props": { + "launchTemplate": { + "launchTemplateId": { + "Ref": "ClusterbottlerocketasgLaunchTemplate45A2FA5C" + }, + "version": { + "Fn::GetAtt": [ + "ClusterbottlerocketasgLaunchTemplate45A2FA5C", + "LatestVersionNumber" + ] + } + }, + "maxSize": "1", + "minSize": "0", + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg", + "propagateAtLaunch": true + } + ], + "vpcZoneIdentifier": [ + { + "Ref": "VpcPrivateSubnet1Subnet536B997A" + }, + { + "Ref": "VpcPrivateSubnet2Subnet3788AAA1" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_autoscaling.CfnAutoScalingGroup", + "version": "0.0.0" + } + }, + "DrainECSHook": { + "id": "DrainECSHook", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook", + "children": { + "Function": { + "id": "Function", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function", + "children": { + "ServiceRole": { + "id": "ServiceRole", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole", + "children": { + "ImportServiceRole": { + "id": "ImportServiceRole", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/ImportServiceRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "managedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ], + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/ServiceRole/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": [ + "ec2:DescribeHosts", + "ec2:DescribeInstanceAttribute", + "ec2:DescribeInstanceStatus", + "ec2:DescribeInstances" + ], + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": "autoscaling:CompleteLifecycleAction", + "Effect": "Allow", + "Resource": { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":autoscaling:", + { + "Ref": "AWS::Region" + }, + ":", + { + "Ref": "AWS::AccountId" + }, + ":autoScalingGroup:*:autoScalingGroupName/", + { + "Ref": "ClusterbottlerocketasgASG5424825A" + } + ] + ] + } + }, + { + "Action": [ + "ecs:DescribeContainerInstances", + "ecs:DescribeTasks", + "ecs:ListTasks", + "ecs:UpdateContainerInstancesState" + ], + "Condition": { + "ArnEquals": { + "ecs:cluster": { + "Fn::GetAtt": [ + "ClusterEB0386A7", + "Arn" + ] + } + } + }, + "Effect": "Allow", + "Resource": "*" + }, + { + "Action": [ + "ecs:ListContainerInstances", + "ecs:SubmitContainerStateChange", + "ecs:SubmitTaskStateChange" + ], + "Effect": "Allow", + "Resource": { + "Fn::GetAtt": [ + "ClusterEB0386A7", + "Arn" + ] + } + } + ], + "Version": "2012-10-17" + }, + "policyName": "ClusterbottlerocketasgDrainECSHookFunctionServiceRoleDefaultPolicyBD9C646C", + "roles": [ + { + "Ref": "ClusterbottlerocketasgDrainECSHookFunctionServiceRole91B0C3B3" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Function", + "aws:cdk:cloudformation:props": { + "code": { + "zipFile": "import boto3, json, os, time\n\necs = boto3.client('ecs')\nautoscaling = boto3.client('autoscaling')\n\n\ndef lambda_handler(event, context):\n print(json.dumps(dict(event, ResponseURL='...')))\n cluster = os.environ['CLUSTER']\n snsTopicArn = event['Records'][0]['Sns']['TopicArn']\n lifecycle_event = json.loads(event['Records'][0]['Sns']['Message'])\n instance_id = lifecycle_event.get('EC2InstanceId')\n if not instance_id:\n print('Got event without EC2InstanceId: %s', json.dumps(dict(event, ResponseURL='...')))\n return\n\n instance_arn = container_instance_arn(cluster, instance_id)\n print('Instance %s has container instance ARN %s' % (lifecycle_event['EC2InstanceId'], instance_arn))\n\n if not instance_arn:\n return\n\n task_arns = container_instance_task_arns(cluster, instance_arn)\n\n if task_arns:\n print('Instance ARN %s has task ARNs %s' % (instance_arn, ', '.join(task_arns)))\n\n while has_tasks(cluster, instance_arn, task_arns):\n time.sleep(10)\n\n try:\n print('Terminating instance %s' % instance_id)\n autoscaling.complete_lifecycle_action(\n LifecycleActionResult='CONTINUE',\n **pick(lifecycle_event, 'LifecycleHookName', 'LifecycleActionToken', 'AutoScalingGroupName'))\n except Exception as e:\n # Lifecycle action may have already completed.\n print(str(e))\n\n\ndef container_instance_arn(cluster, instance_id):\n \"\"\"Turn an instance ID into a container instance ARN.\"\"\"\n arns = ecs.list_container_instances(cluster=cluster, filter='ec2InstanceId==' + instance_id)['containerInstanceArns']\n if not arns:\n return None\n return arns[0]\n\ndef container_instance_task_arns(cluster, instance_arn):\n \"\"\"Fetch tasks for a container instance ARN.\"\"\"\n arns = ecs.list_tasks(cluster=cluster, containerInstance=instance_arn)['taskArns']\n return arns\n\ndef has_tasks(cluster, instance_arn, task_arns):\n \"\"\"Return True if the instance is running tasks for the given cluster.\"\"\"\n instances = ecs.describe_container_instances(cluster=cluster, containerInstances=[instance_arn])['containerInstances']\n if not instances:\n return False\n instance = instances[0]\n\n if instance['status'] == 'ACTIVE':\n # Start draining, then try again later\n set_container_instance_to_draining(cluster, instance_arn)\n return True\n\n task_count = None\n\n if task_arns:\n # Fetch details for tasks running on the container instance\n tasks = ecs.describe_tasks(cluster=cluster, tasks=task_arns)['tasks']\n if tasks:\n # Consider any non-stopped tasks as running\n task_count = sum(task['lastStatus'] != 'STOPPED' for task in tasks) + instance['pendingTasksCount']\n\n if not task_count:\n # Fallback to instance task counts if detailed task information is unavailable\n task_count = instance['runningTasksCount'] + instance['pendingTasksCount']\n\n print('Instance %s has %s tasks' % (instance_arn, task_count))\n\n return task_count > 0\n\ndef set_container_instance_to_draining(cluster, instance_arn):\n ecs.update_container_instances_state(\n cluster=cluster,\n containerInstances=[instance_arn], status='DRAINING')\n\n\ndef pick(dct, *keys):\n \"\"\"Pick a subset of a dict.\"\"\"\n return {k: v for k, v in dct.items() if k in keys}\n" + }, + "environment": { + "variables": { + "CLUSTER": { + "Ref": "ClusterEB0386A7" + } + } + }, + "handler": "index.lambda_handler", + "role": { + "Fn::GetAtt": [ + "ClusterbottlerocketasgDrainECSHookFunctionServiceRole91B0C3B3", + "Arn" + ] + }, + "runtime": "python3.9", + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" + } + ], + "timeout": 310 + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnFunction", + "version": "0.0.0" + } + }, + "AllowInvoke:awsecsintegbottlerocketnvidiaamiClusterbottlerocketasgLifecycleHookDrainHookTopic46897984": { + "id": "AllowInvoke:awsecsintegbottlerocketnvidiaamiClusterbottlerocketasgLifecycleHookDrainHookTopic46897984", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/AllowInvoke:awsecsintegbottlerocketnvidiaamiClusterbottlerocketasgLifecycleHookDrainHookTopic46897984", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::Lambda::Permission", + "aws:cdk:cloudformation:props": { + "action": "lambda:InvokeFunction", + "functionName": { + "Fn::GetAtt": [ + "ClusterbottlerocketasgDrainECSHookFunctionFEA27227", + "Arn" + ] + }, + "principal": "sns.amazonaws.com", + "sourceArn": { + "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.CfnPermission", + "version": "0.0.0" + } + }, + "Topic": { + "id": "Topic", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/Topic", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/DrainECSHook/Function/Topic/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SNS::Subscription", + "aws:cdk:cloudformation:props": { + "endpoint": { + "Fn::GetAtt": [ + "ClusterbottlerocketasgDrainECSHookFunctionFEA27227", + "Arn" + ] + }, + "protocol": "lambda", + "topicArn": { + "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sns.CfnSubscription", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sns.Subscription", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_lambda.Function", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "LifecycleHookDrainHook": { + "id": "LifecycleHookDrainHook", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook", + "children": { + "Topic": { + "id": "Topic", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Topic", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Topic/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::SNS::Topic", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sns.CfnTopic", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_sns.Topic", + "version": "0.0.0" + } + }, + "Role": { + "id": "Role", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role", + "children": { + "ImportRole": { + "id": "ImportRole", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/ImportRole", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Role", + "aws:cdk:cloudformation:props": { + "assumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "autoscaling.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "tags": [ + { + "key": "Name", + "value": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnRole", + "version": "0.0.0" + } + }, + "DefaultPolicy": { + "id": "DefaultPolicy", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/DefaultPolicy", + "children": { + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Role/DefaultPolicy/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::Policy", + "aws:cdk:cloudformation:props": { + "policyDocument": { + "Statement": [ + { + "Action": "sns:Publish", + "Effect": "Allow", + "Resource": { + "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" + } + } + ], + "Version": "2012-10-17" + }, + "policyName": "ClusterbottlerocketasgLifecycleHookDrainHookRoleDefaultPolicy2C98DD9A", + "roles": [ + { + "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookRole9E2A1D11" + } + ] + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.CfnPolicy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Policy", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_iam.Role", + "version": "0.0.0" + } + }, + "Resource": { + "id": "Resource", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/Cluster/bottlerocket-asg/LifecycleHookDrainHook/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::AutoScaling::LifecycleHook", + "aws:cdk:cloudformation:props": { + "autoScalingGroupName": { + "Ref": "ClusterbottlerocketasgASG5424825A" + }, + "defaultResult": "CONTINUE", + "heartbeatTimeout": 300, + "lifecycleTransition": "autoscaling:EC2_INSTANCE_TERMINATING", + "notificationTargetArn": { + "Ref": "ClusterbottlerocketasgLifecycleHookDrainHookTopic34DF3A02" + }, + "roleArn": { + "Fn::GetAtt": [ + "ClusterbottlerocketasgLifecycleHookDrainHookRole9E2A1D11", + "Arn" + ] + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_autoscaling.CfnLifecycleHook", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_autoscaling.LifecycleHook", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_autoscaling.AutoScalingGroup", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.aws_ecs.Cluster", + "version": "0.0.0" + } + }, + "SsmParameterValue:--aws--service--bottlerocket--aws-ecs-2-nvidia--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": { + "id": "SsmParameterValue:--aws--service--bottlerocket--aws-ecs-2-nvidia--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/SsmParameterValue:--aws--service--bottlerocket--aws-ecs-2-nvidia--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "SsmParameterValue:--aws--service--bottlerocket--aws-ecs-2-nvidia--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118": { + "id": "SsmParameterValue:--aws--service--bottlerocket--aws-ecs-2-nvidia--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/SsmParameterValue:--aws--service--bottlerocket--aws-ecs-2-nvidia--x86_64--latest--image_id:C96584B6-F00A-464E-AD19-53AFF4B05118", + "constructInfo": { + "fqn": "aws-cdk-lib.Resource", + "version": "0.0.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-ecs-integ-bottlerocket-nvidia-ami/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + }, + "aws-ecs-bottlerocket-nvidia-ami": { + "id": "aws-ecs-bottlerocket-nvidia-ami", + "path": "aws-ecs-bottlerocket-nvidia-ami", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "aws-ecs-bottlerocket-nvidia-ami/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "aws-ecs-bottlerocket-nvidia-ami/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "aws-ecs-bottlerocket-nvidia-ami/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "aws-ecs-bottlerocket-nvidia-ami/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnParameter", + "version": "0.0.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "aws-ecs-bottlerocket-nvidia-ami/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "aws-cdk-lib.CfnRule", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.Stack", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTestCase", + "version": "0.0.0" + } + } + }, + "constructInfo": { + "fqn": "@aws-cdk/integ-tests-alpha.IntegTest", + "version": "0.0.0" + } + }, + "Tree": { + "id": "Tree", + "path": "Tree", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "aws-cdk-lib.App", + "version": "0.0.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.ts index 05bc4a7ce97f4..f852a20e6cfa5 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.cluster-bottlerocket-nvidia-ami.ts @@ -7,19 +7,16 @@ const app = new cdk.App(); const stack = new cdk.Stack(app, 'aws-ecs-integ-bottlerocket-nvidia-ami'); const vpc = new ec2.Vpc(stack, 'Vpc', { maxAzs: 2, restrictDefaultSecurityGroup: false }); - const cluster = new ecs.Cluster(stack, 'Cluster', { vpc, }); cluster.addCapacity('bottlerocket-asg', { - minCapacity: 2, - instanceType: new ec2.InstanceType('p3.2xlarge'), + minCapacity: 0, + maxCapacity: 1, + instanceType: new ec2.InstanceType('g3s.xlarge'), machineImage: new ecs.BottleRocketImage({ variant: ecs.BottlerocketEcsVariant.AWS_ECS_2_NVIDIA, }), - vpcSubnets: { - availabilityZones: ['us-east-1c'], - }, }); new integ.IntegTest(app, 'aws-ecs-bottlerocket-nvidia-ami', { diff --git a/packages/aws-cdk-lib/aws-ecs/README.md b/packages/aws-cdk-lib/aws-ecs/README.md index 0acd9501176b5..771e2faa1fd58 100644 --- a/packages/aws-cdk-lib/aws-ecs/README.md +++ b/packages/aws-cdk-lib/aws-ecs/README.md @@ -228,7 +228,6 @@ You can also specify an NVIDIA-compatible AMI such as in this example: declare const cluster: ecs.Cluster; cluster.addCapacity('bottlerocket-asg', { - minCapacity: 2, instanceType: new ec2.InstanceType('p3.2xlarge'), machineImage: new ecs.BottleRocketImage({ variant: ecs.BottlerocketEcsVariant.AWS_ECS_2_NVIDIA,