diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.health-checks.js.snapshot/AutoScalingGroupHealthChecksDefaultTestDeployAssert9AAA1F3B.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.health-checks.js.snapshot/AutoScalingGroupHealthChecksDefaultTestDeployAssert9AAA1F3B.assets.json new file mode 100644 index 0000000000000..a5f539e03dfe3 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.health-checks.js.snapshot/AutoScalingGroupHealthChecksDefaultTestDeployAssert9AAA1F3B.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.5", + "files": { + "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": { + "source": { + "path": "AutoScalingGroupHealthChecksDefaultTestDeployAssert9AAA1F3B.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-autoscaling/test/integ.health-checks.js.snapshot/AutoScalingGroupHealthChecksDefaultTestDeployAssert9AAA1F3B.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.health-checks.js.snapshot/AutoScalingGroupHealthChecksDefaultTestDeployAssert9AAA1F3B.template.json new file mode 100644 index 0000000000000..ad9d0fb73d1dd --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.health-checks.js.snapshot/AutoScalingGroupHealthChecksDefaultTestDeployAssert9AAA1F3B.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-autoscaling/test/integ.health-checks.js.snapshot/cdk.out b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.health-checks.js.snapshot/cdk.out new file mode 100644 index 0000000000000..bd5311dc372de --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.health-checks.js.snapshot/cdk.out @@ -0,0 +1 @@ +{"version":"36.0.5"} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.health-checks.js.snapshot/integ-health-checks.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.health-checks.js.snapshot/integ-health-checks.assets.json new file mode 100644 index 0000000000000..43ee464991c4f --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.health-checks.js.snapshot/integ-health-checks.assets.json @@ -0,0 +1,19 @@ +{ + "version": "36.0.5", + "files": { + "ef7061115e98ba6f0acd0111a051ef90e571f3296b8897efb16bdd2efd0fe426": { + "source": { + "path": "integ-health-checks.template.json", + "packaging": "file" + }, + "destinations": { + "current_account-current_region": { + "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", + "objectKey": "ef7061115e98ba6f0acd0111a051ef90e571f3296b8897efb16bdd2efd0fe426.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-autoscaling/test/integ.health-checks.js.snapshot/integ-health-checks.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.health-checks.js.snapshot/integ-health-checks.template.json new file mode 100644 index 0000000000000..9eda0e69712d8 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.health-checks.js.snapshot/integ-health-checks.template.json @@ -0,0 +1,918 @@ +{ + "Resources": { + "myVpcAuto1A4B61E2": { + "Type": "AWS::EC2::VPC", + "Properties": { + "CidrBlock": "10.0.0.0/16", + "EnableDnsHostnames": true, + "EnableDnsSupport": true, + "InstanceTenancy": "default", + "Tags": [ + { + "Key": "Name", + "Value": "integ-health-checks/myVpcAuto" + } + ] + } + }, + "myVpcAutoPublicSubnet1Subnet3516098F": { + "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": "integ-health-checks/myVpcAuto/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "myVpcAuto1A4B61E2" + } + } + }, + "myVpcAutoPublicSubnet1RouteTable3D618310": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "integ-health-checks/myVpcAuto/PublicSubnet1" + } + ], + "VpcId": { + "Ref": "myVpcAuto1A4B61E2" + } + } + }, + "myVpcAutoPublicSubnet1RouteTableAssociationB3A6EFAC": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "myVpcAutoPublicSubnet1RouteTable3D618310" + }, + "SubnetId": { + "Ref": "myVpcAutoPublicSubnet1Subnet3516098F" + } + } + }, + "myVpcAutoPublicSubnet1DefaultRoute2791173D": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "myVpcAutoIGW08055396" + }, + "RouteTableId": { + "Ref": "myVpcAutoPublicSubnet1RouteTable3D618310" + } + }, + "DependsOn": [ + "myVpcAutoVPCGWEC42CD12" + ] + }, + "myVpcAutoPublicSubnet1EIP15D99CAF": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "integ-health-checks/myVpcAuto/PublicSubnet1" + } + ] + } + }, + "myVpcAutoPublicSubnet1NATGatewayF3EA78A2": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "myVpcAutoPublicSubnet1EIP15D99CAF", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "myVpcAutoPublicSubnet1Subnet3516098F" + }, + "Tags": [ + { + "Key": "Name", + "Value": "integ-health-checks/myVpcAuto/PublicSubnet1" + } + ] + }, + "DependsOn": [ + "myVpcAutoPublicSubnet1DefaultRoute2791173D", + "myVpcAutoPublicSubnet1RouteTableAssociationB3A6EFAC" + ] + }, + "myVpcAutoPublicSubnet2Subnet297C7839": { + "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": "integ-health-checks/myVpcAuto/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "myVpcAuto1A4B61E2" + } + } + }, + "myVpcAutoPublicSubnet2RouteTable17ECF2AC": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "integ-health-checks/myVpcAuto/PublicSubnet2" + } + ], + "VpcId": { + "Ref": "myVpcAuto1A4B61E2" + } + } + }, + "myVpcAutoPublicSubnet2RouteTableAssociationE21B7B6C": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "myVpcAutoPublicSubnet2RouteTable17ECF2AC" + }, + "SubnetId": { + "Ref": "myVpcAutoPublicSubnet2Subnet297C7839" + } + } + }, + "myVpcAutoPublicSubnet2DefaultRouteE9454F16": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "GatewayId": { + "Ref": "myVpcAutoIGW08055396" + }, + "RouteTableId": { + "Ref": "myVpcAutoPublicSubnet2RouteTable17ECF2AC" + } + }, + "DependsOn": [ + "myVpcAutoVPCGWEC42CD12" + ] + }, + "myVpcAutoPublicSubnet2EIPA484FACE": { + "Type": "AWS::EC2::EIP", + "Properties": { + "Domain": "vpc", + "Tags": [ + { + "Key": "Name", + "Value": "integ-health-checks/myVpcAuto/PublicSubnet2" + } + ] + } + }, + "myVpcAutoPublicSubnet2NATGatewayF670624F": { + "Type": "AWS::EC2::NatGateway", + "Properties": { + "AllocationId": { + "Fn::GetAtt": [ + "myVpcAutoPublicSubnet2EIPA484FACE", + "AllocationId" + ] + }, + "SubnetId": { + "Ref": "myVpcAutoPublicSubnet2Subnet297C7839" + }, + "Tags": [ + { + "Key": "Name", + "Value": "integ-health-checks/myVpcAuto/PublicSubnet2" + } + ] + }, + "DependsOn": [ + "myVpcAutoPublicSubnet2DefaultRouteE9454F16", + "myVpcAutoPublicSubnet2RouteTableAssociationE21B7B6C" + ] + }, + "myVpcAutoPrivateSubnet1SubnetCF0D49B2": { + "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": "integ-health-checks/myVpcAuto/PrivateSubnet1" + } + ], + "VpcId": { + "Ref": "myVpcAuto1A4B61E2" + } + } + }, + "myVpcAutoPrivateSubnet1RouteTableDC61148B": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "integ-health-checks/myVpcAuto/PrivateSubnet1" + } + ], + "VpcId": { + "Ref": "myVpcAuto1A4B61E2" + } + } + }, + "myVpcAutoPrivateSubnet1RouteTableAssociation9848EFFB": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "myVpcAutoPrivateSubnet1RouteTableDC61148B" + }, + "SubnetId": { + "Ref": "myVpcAutoPrivateSubnet1SubnetCF0D49B2" + } + } + }, + "myVpcAutoPrivateSubnet1DefaultRouteF007F5E7": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "myVpcAutoPublicSubnet1NATGatewayF3EA78A2" + }, + "RouteTableId": { + "Ref": "myVpcAutoPrivateSubnet1RouteTableDC61148B" + } + } + }, + "myVpcAutoPrivateSubnet2Subnet592674AC": { + "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": "integ-health-checks/myVpcAuto/PrivateSubnet2" + } + ], + "VpcId": { + "Ref": "myVpcAuto1A4B61E2" + } + } + }, + "myVpcAutoPrivateSubnet2RouteTableE10F6006": { + "Type": "AWS::EC2::RouteTable", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "integ-health-checks/myVpcAuto/PrivateSubnet2" + } + ], + "VpcId": { + "Ref": "myVpcAuto1A4B61E2" + } + } + }, + "myVpcAutoPrivateSubnet2RouteTableAssociation05CC4CEB": { + "Type": "AWS::EC2::SubnetRouteTableAssociation", + "Properties": { + "RouteTableId": { + "Ref": "myVpcAutoPrivateSubnet2RouteTableE10F6006" + }, + "SubnetId": { + "Ref": "myVpcAutoPrivateSubnet2Subnet592674AC" + } + } + }, + "myVpcAutoPrivateSubnet2DefaultRouteDA295DF0": { + "Type": "AWS::EC2::Route", + "Properties": { + "DestinationCidrBlock": "0.0.0.0/0", + "NatGatewayId": { + "Ref": "myVpcAutoPublicSubnet2NATGatewayF670624F" + }, + "RouteTableId": { + "Ref": "myVpcAutoPrivateSubnet2RouteTableE10F6006" + } + } + }, + "myVpcAutoIGW08055396": { + "Type": "AWS::EC2::InternetGateway", + "Properties": { + "Tags": [ + { + "Key": "Name", + "Value": "integ-health-checks/myVpcAuto" + } + ] + } + }, + "myVpcAutoVPCGWEC42CD12": { + "Type": "AWS::EC2::VPCGatewayAttachment", + "Properties": { + "InternetGatewayId": { + "Ref": "myVpcAutoIGW08055396" + }, + "VpcId": { + "Ref": "myVpcAuto1A4B61E2" + } + } + }, + "EC2HealthChecksInstanceSecurityGroupB5E28934": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "integ-health-checks/EC2HealthChecks/InstanceSecurityGroup", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "Name", + "Value": "integ-health-checks/EC2HealthChecks" + } + ], + "VpcId": { + "Ref": "myVpcAuto1A4B61E2" + } + } + }, + "EC2HealthChecksInstanceRole330231BD": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "Name", + "Value": "integ-health-checks/EC2HealthChecks" + } + ] + } + }, + "EC2HealthChecksInstanceProfile0F3A6CD0": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "EC2HealthChecksInstanceRole330231BD" + } + ] + } + }, + "EC2HealthChecksLaunchTemplate1F05DB09": { + "Type": "AWS::EC2::LaunchTemplate", + "Properties": { + "LaunchTemplateData": { + "IamInstanceProfile": { + "Arn": { + "Fn::GetAtt": [ + "EC2HealthChecksInstanceProfile0F3A6CD0", + "Arn" + ] + } + }, + "ImageId": { + "Ref": "SsmParameterValueawsserviceamiamazonlinuxlatestamznamihvmx8664gp2C96584B6F00A464EAD1953AFF4B05118Parameter" + }, + "InstanceType": "t2.micro", + "Monitoring": { + "Enabled": false + }, + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "EC2HealthChecksInstanceSecurityGroupB5E28934", + "GroupId" + ] + } + ], + "TagSpecifications": [ + { + "ResourceType": "instance", + "Tags": [ + { + "Key": "Name", + "Value": "integ-health-checks/EC2HealthChecks/LaunchTemplate" + } + ] + }, + { + "ResourceType": "volume", + "Tags": [ + { + "Key": "Name", + "Value": "integ-health-checks/EC2HealthChecks/LaunchTemplate" + } + ] + } + ], + "UserData": { + "Fn::Base64": "#!/bin/bash" + } + }, + "TagSpecifications": [ + { + "ResourceType": "launch-template", + "Tags": [ + { + "Key": "Name", + "Value": "integ-health-checks/EC2HealthChecks/LaunchTemplate" + } + ] + } + ] + }, + "DependsOn": [ + "EC2HealthChecksInstanceRole330231BD" + ] + }, + "EC2HealthChecksASG86AE6FB7": { + "Type": "AWS::AutoScaling::AutoScalingGroup", + "Properties": { + "HealthCheckGracePeriod": 100, + "HealthCheckType": "EC2", + "LaunchTemplate": { + "LaunchTemplateId": { + "Ref": "EC2HealthChecksLaunchTemplate1F05DB09" + }, + "Version": { + "Fn::GetAtt": [ + "EC2HealthChecksLaunchTemplate1F05DB09", + "LatestVersionNumber" + ] + } + }, + "MaxSize": "1", + "MinSize": "1", + "Tags": [ + { + "Key": "Name", + "PropagateAtLaunch": true, + "Value": "integ-health-checks/EC2HealthChecks" + } + ], + "VPCZoneIdentifier": [ + { + "Ref": "myVpcAutoPrivateSubnet1SubnetCF0D49B2" + }, + { + "Ref": "myVpcAutoPrivateSubnet2Subnet592674AC" + } + ] + }, + "UpdatePolicy": { + "AutoScalingScheduledAction": { + "IgnoreUnmodifiedGroupSizeProperties": true + } + } + }, + "AdditionalHealthChecksInstanceSecurityGroup7ABFD032": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "integ-health-checks/AdditionalHealthChecks/InstanceSecurityGroup", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "Name", + "Value": "integ-health-checks/AdditionalHealthChecks" + } + ], + "VpcId": { + "Ref": "myVpcAuto1A4B61E2" + } + } + }, + "AdditionalHealthChecksInstanceRole8F52F51E": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "Name", + "Value": "integ-health-checks/AdditionalHealthChecks" + } + ] + } + }, + "AdditionalHealthChecksInstanceProfile71F64498": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "AdditionalHealthChecksInstanceRole8F52F51E" + } + ] + } + }, + "AdditionalHealthChecksLaunchTemplateCCCFDD89": { + "Type": "AWS::EC2::LaunchTemplate", + "Properties": { + "LaunchTemplateData": { + "IamInstanceProfile": { + "Arn": { + "Fn::GetAtt": [ + "AdditionalHealthChecksInstanceProfile71F64498", + "Arn" + ] + } + }, + "ImageId": { + "Ref": "SsmParameterValueawsserviceamiamazonlinuxlatestamznamihvmx8664gp2C96584B6F00A464EAD1953AFF4B05118Parameter" + }, + "InstanceType": "t2.micro", + "Monitoring": { + "Enabled": false + }, + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "AdditionalHealthChecksInstanceSecurityGroup7ABFD032", + "GroupId" + ] + } + ], + "TagSpecifications": [ + { + "ResourceType": "instance", + "Tags": [ + { + "Key": "Name", + "Value": "integ-health-checks/AdditionalHealthChecks/LaunchTemplate" + } + ] + }, + { + "ResourceType": "volume", + "Tags": [ + { + "Key": "Name", + "Value": "integ-health-checks/AdditionalHealthChecks/LaunchTemplate" + } + ] + } + ], + "UserData": { + "Fn::Base64": "#!/bin/bash" + } + }, + "TagSpecifications": [ + { + "ResourceType": "launch-template", + "Tags": [ + { + "Key": "Name", + "Value": "integ-health-checks/AdditionalHealthChecks/LaunchTemplate" + } + ] + } + ] + }, + "DependsOn": [ + "AdditionalHealthChecksInstanceRole8F52F51E" + ] + }, + "AdditionalHealthChecksASG30451BBE": { + "Type": "AWS::AutoScaling::AutoScalingGroup", + "Properties": { + "HealthCheckGracePeriod": 100, + "HealthCheckType": "EBS,ELB,VPC_LATTICE", + "LaunchTemplate": { + "LaunchTemplateId": { + "Ref": "AdditionalHealthChecksLaunchTemplateCCCFDD89" + }, + "Version": { + "Fn::GetAtt": [ + "AdditionalHealthChecksLaunchTemplateCCCFDD89", + "LatestVersionNumber" + ] + } + }, + "MaxSize": "1", + "MinSize": "1", + "Tags": [ + { + "Key": "Name", + "PropagateAtLaunch": true, + "Value": "integ-health-checks/AdditionalHealthChecks" + } + ], + "VPCZoneIdentifier": [ + { + "Ref": "myVpcAutoPrivateSubnet1SubnetCF0D49B2" + }, + { + "Ref": "myVpcAutoPrivateSubnet2Subnet592674AC" + } + ] + }, + "UpdatePolicy": { + "AutoScalingScheduledAction": { + "IgnoreUnmodifiedGroupSizeProperties": true + } + } + }, + "HealthChecksWithoutGraceInstanceSecurityGroup9496DAB2": { + "Type": "AWS::EC2::SecurityGroup", + "Properties": { + "GroupDescription": "integ-health-checks/HealthChecksWithoutGrace/InstanceSecurityGroup", + "SecurityGroupEgress": [ + { + "CidrIp": "0.0.0.0/0", + "Description": "Allow all outbound traffic by default", + "IpProtocol": "-1" + } + ], + "Tags": [ + { + "Key": "Name", + "Value": "integ-health-checks/HealthChecksWithoutGrace" + } + ], + "VpcId": { + "Ref": "myVpcAuto1A4B61E2" + } + } + }, + "HealthChecksWithoutGraceInstanceRole253C2D6A": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "ec2.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "Tags": [ + { + "Key": "Name", + "Value": "integ-health-checks/HealthChecksWithoutGrace" + } + ] + } + }, + "HealthChecksWithoutGraceInstanceProfileE1C43D1C": { + "Type": "AWS::IAM::InstanceProfile", + "Properties": { + "Roles": [ + { + "Ref": "HealthChecksWithoutGraceInstanceRole253C2D6A" + } + ] + } + }, + "HealthChecksWithoutGraceLaunchTemplate907174BB": { + "Type": "AWS::EC2::LaunchTemplate", + "Properties": { + "LaunchTemplateData": { + "IamInstanceProfile": { + "Arn": { + "Fn::GetAtt": [ + "HealthChecksWithoutGraceInstanceProfileE1C43D1C", + "Arn" + ] + } + }, + "ImageId": { + "Ref": "SsmParameterValueawsserviceamiamazonlinuxlatestamznamihvmx8664gp2C96584B6F00A464EAD1953AFF4B05118Parameter" + }, + "InstanceType": "t2.micro", + "Monitoring": { + "Enabled": false + }, + "SecurityGroupIds": [ + { + "Fn::GetAtt": [ + "HealthChecksWithoutGraceInstanceSecurityGroup9496DAB2", + "GroupId" + ] + } + ], + "TagSpecifications": [ + { + "ResourceType": "instance", + "Tags": [ + { + "Key": "Name", + "Value": "integ-health-checks/HealthChecksWithoutGrace/LaunchTemplate" + } + ] + }, + { + "ResourceType": "volume", + "Tags": [ + { + "Key": "Name", + "Value": "integ-health-checks/HealthChecksWithoutGrace/LaunchTemplate" + } + ] + } + ], + "UserData": { + "Fn::Base64": "#!/bin/bash" + } + }, + "TagSpecifications": [ + { + "ResourceType": "launch-template", + "Tags": [ + { + "Key": "Name", + "Value": "integ-health-checks/HealthChecksWithoutGrace/LaunchTemplate" + } + ] + } + ] + }, + "DependsOn": [ + "HealthChecksWithoutGraceInstanceRole253C2D6A" + ] + }, + "HealthChecksWithoutGraceASG4A11A476": { + "Type": "AWS::AutoScaling::AutoScalingGroup", + "Properties": { + "HealthCheckType": "ELB", + "LaunchTemplate": { + "LaunchTemplateId": { + "Ref": "HealthChecksWithoutGraceLaunchTemplate907174BB" + }, + "Version": { + "Fn::GetAtt": [ + "HealthChecksWithoutGraceLaunchTemplate907174BB", + "LatestVersionNumber" + ] + } + }, + "MaxSize": "1", + "MinSize": "1", + "Tags": [ + { + "Key": "Name", + "PropagateAtLaunch": true, + "Value": "integ-health-checks/HealthChecksWithoutGrace" + } + ], + "VPCZoneIdentifier": [ + { + "Ref": "myVpcAutoPrivateSubnet1SubnetCF0D49B2" + }, + { + "Ref": "myVpcAutoPrivateSubnet2Subnet592674AC" + } + ] + }, + "UpdatePolicy": { + "AutoScalingScheduledAction": { + "IgnoreUnmodifiedGroupSizeProperties": true + } + } + } + }, + "Parameters": { + "SsmParameterValueawsserviceamiamazonlinuxlatestamznamihvmx8664gp2C96584B6F00A464EAD1953AFF4B05118Parameter": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/aws/service/ami-amazon-linux-latest/amzn-ami-hvm-x86_64-gp2" + }, + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "Default": "/cdk-bootstrap/hnb659fds/version", + "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" + } + }, + "Rules": { + "CheckBootstrapVersion": { + "Assertions": [ + { + "Assert": { + "Fn::Not": [ + { + "Fn::Contains": [ + [ + "1", + "2", + "3", + "4", + "5" + ], + { + "Ref": "BootstrapVersion" + } + ] + } + ] + }, + "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.health-checks.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.health-checks.js.snapshot/integ.json new file mode 100644 index 0000000000000..165ca77232a03 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.health-checks.js.snapshot/integ.json @@ -0,0 +1,12 @@ +{ + "version": "36.0.5", + "testCases": { + "AutoScalingGroupHealthChecks/DefaultTest": { + "stacks": [ + "integ-health-checks" + ], + "assertionStack": "AutoScalingGroupHealthChecks/DefaultTest/DeployAssert", + "assertionStackName": "AutoScalingGroupHealthChecksDefaultTestDeployAssert9AAA1F3B" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.health-checks.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.health-checks.js.snapshot/manifest.json new file mode 100644 index 0000000000000..bf519ff8cacee --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.health-checks.js.snapshot/manifest.json @@ -0,0 +1,341 @@ +{ + "version": "36.0.5", + "artifacts": { + "integ-health-checks.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "integ-health-checks.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "integ-health-checks": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "integ-health-checks.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}/ef7061115e98ba6f0acd0111a051ef90e571f3296b8897efb16bdd2efd0fe426.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", + "additionalDependencies": [ + "integ-health-checks.assets" + ], + "lookupRole": { + "arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}", + "requiresBootstrapStackVersion": 8, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "dependencies": [ + "integ-health-checks.assets" + ], + "metadata": { + "/integ-health-checks/myVpcAuto/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "myVpcAuto1A4B61E2" + } + ], + "/integ-health-checks/myVpcAuto/PublicSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "myVpcAutoPublicSubnet1Subnet3516098F" + } + ], + "/integ-health-checks/myVpcAuto/PublicSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "myVpcAutoPublicSubnet1RouteTable3D618310" + } + ], + "/integ-health-checks/myVpcAuto/PublicSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "myVpcAutoPublicSubnet1RouteTableAssociationB3A6EFAC" + } + ], + "/integ-health-checks/myVpcAuto/PublicSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "myVpcAutoPublicSubnet1DefaultRoute2791173D" + } + ], + "/integ-health-checks/myVpcAuto/PublicSubnet1/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "myVpcAutoPublicSubnet1EIP15D99CAF" + } + ], + "/integ-health-checks/myVpcAuto/PublicSubnet1/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "myVpcAutoPublicSubnet1NATGatewayF3EA78A2" + } + ], + "/integ-health-checks/myVpcAuto/PublicSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "myVpcAutoPublicSubnet2Subnet297C7839" + } + ], + "/integ-health-checks/myVpcAuto/PublicSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "myVpcAutoPublicSubnet2RouteTable17ECF2AC" + } + ], + "/integ-health-checks/myVpcAuto/PublicSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "myVpcAutoPublicSubnet2RouteTableAssociationE21B7B6C" + } + ], + "/integ-health-checks/myVpcAuto/PublicSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "myVpcAutoPublicSubnet2DefaultRouteE9454F16" + } + ], + "/integ-health-checks/myVpcAuto/PublicSubnet2/EIP": [ + { + "type": "aws:cdk:logicalId", + "data": "myVpcAutoPublicSubnet2EIPA484FACE" + } + ], + "/integ-health-checks/myVpcAuto/PublicSubnet2/NATGateway": [ + { + "type": "aws:cdk:logicalId", + "data": "myVpcAutoPublicSubnet2NATGatewayF670624F" + } + ], + "/integ-health-checks/myVpcAuto/PrivateSubnet1/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "myVpcAutoPrivateSubnet1SubnetCF0D49B2" + } + ], + "/integ-health-checks/myVpcAuto/PrivateSubnet1/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "myVpcAutoPrivateSubnet1RouteTableDC61148B" + } + ], + "/integ-health-checks/myVpcAuto/PrivateSubnet1/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "myVpcAutoPrivateSubnet1RouteTableAssociation9848EFFB" + } + ], + "/integ-health-checks/myVpcAuto/PrivateSubnet1/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "myVpcAutoPrivateSubnet1DefaultRouteF007F5E7" + } + ], + "/integ-health-checks/myVpcAuto/PrivateSubnet2/Subnet": [ + { + "type": "aws:cdk:logicalId", + "data": "myVpcAutoPrivateSubnet2Subnet592674AC" + } + ], + "/integ-health-checks/myVpcAuto/PrivateSubnet2/RouteTable": [ + { + "type": "aws:cdk:logicalId", + "data": "myVpcAutoPrivateSubnet2RouteTableE10F6006" + } + ], + "/integ-health-checks/myVpcAuto/PrivateSubnet2/RouteTableAssociation": [ + { + "type": "aws:cdk:logicalId", + "data": "myVpcAutoPrivateSubnet2RouteTableAssociation05CC4CEB" + } + ], + "/integ-health-checks/myVpcAuto/PrivateSubnet2/DefaultRoute": [ + { + "type": "aws:cdk:logicalId", + "data": "myVpcAutoPrivateSubnet2DefaultRouteDA295DF0" + } + ], + "/integ-health-checks/myVpcAuto/IGW": [ + { + "type": "aws:cdk:logicalId", + "data": "myVpcAutoIGW08055396" + } + ], + "/integ-health-checks/myVpcAuto/VPCGW": [ + { + "type": "aws:cdk:logicalId", + "data": "myVpcAutoVPCGWEC42CD12" + } + ], + "/integ-health-checks/EC2HealthChecks/InstanceSecurityGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "EC2HealthChecksInstanceSecurityGroupB5E28934" + } + ], + "/integ-health-checks/EC2HealthChecks/InstanceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "EC2HealthChecksInstanceRole330231BD" + } + ], + "/integ-health-checks/EC2HealthChecks/InstanceProfile": [ + { + "type": "aws:cdk:logicalId", + "data": "EC2HealthChecksInstanceProfile0F3A6CD0" + } + ], + "/integ-health-checks/EC2HealthChecks/LaunchTemplate/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "EC2HealthChecksLaunchTemplate1F05DB09" + } + ], + "/integ-health-checks/EC2HealthChecks/ASG": [ + { + "type": "aws:cdk:logicalId", + "data": "EC2HealthChecksASG86AE6FB7" + } + ], + "/integ-health-checks/SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [ + { + "type": "aws:cdk:logicalId", + "data": "SsmParameterValueawsserviceamiamazonlinuxlatestamznamihvmx8664gp2C96584B6F00A464EAD1953AFF4B05118Parameter" + } + ], + "/integ-health-checks/AdditionalHealthChecks/InstanceSecurityGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "AdditionalHealthChecksInstanceSecurityGroup7ABFD032" + } + ], + "/integ-health-checks/AdditionalHealthChecks/InstanceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "AdditionalHealthChecksInstanceRole8F52F51E" + } + ], + "/integ-health-checks/AdditionalHealthChecks/InstanceProfile": [ + { + "type": "aws:cdk:logicalId", + "data": "AdditionalHealthChecksInstanceProfile71F64498" + } + ], + "/integ-health-checks/AdditionalHealthChecks/LaunchTemplate/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "AdditionalHealthChecksLaunchTemplateCCCFDD89" + } + ], + "/integ-health-checks/AdditionalHealthChecks/ASG": [ + { + "type": "aws:cdk:logicalId", + "data": "AdditionalHealthChecksASG30451BBE" + } + ], + "/integ-health-checks/HealthChecksWithoutGrace/InstanceSecurityGroup/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "HealthChecksWithoutGraceInstanceSecurityGroup9496DAB2" + } + ], + "/integ-health-checks/HealthChecksWithoutGrace/InstanceRole/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "HealthChecksWithoutGraceInstanceRole253C2D6A" + } + ], + "/integ-health-checks/HealthChecksWithoutGrace/InstanceProfile": [ + { + "type": "aws:cdk:logicalId", + "data": "HealthChecksWithoutGraceInstanceProfileE1C43D1C" + } + ], + "/integ-health-checks/HealthChecksWithoutGrace/LaunchTemplate/Resource": [ + { + "type": "aws:cdk:logicalId", + "data": "HealthChecksWithoutGraceLaunchTemplate907174BB" + } + ], + "/integ-health-checks/HealthChecksWithoutGrace/ASG": [ + { + "type": "aws:cdk:logicalId", + "data": "HealthChecksWithoutGraceASG4A11A476" + } + ], + "/integ-health-checks/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/integ-health-checks/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "integ-health-checks" + }, + "AutoScalingGroupHealthChecksDefaultTestDeployAssert9AAA1F3B.assets": { + "type": "cdk:asset-manifest", + "properties": { + "file": "AutoScalingGroupHealthChecksDefaultTestDeployAssert9AAA1F3B.assets.json", + "requiresBootstrapStackVersion": 6, + "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version" + } + }, + "AutoScalingGroupHealthChecksDefaultTestDeployAssert9AAA1F3B": { + "type": "aws:cloudformation:stack", + "environment": "aws://unknown-account/unknown-region", + "properties": { + "templateFile": "AutoScalingGroupHealthChecksDefaultTestDeployAssert9AAA1F3B.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": [ + "AutoScalingGroupHealthChecksDefaultTestDeployAssert9AAA1F3B.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": [ + "AutoScalingGroupHealthChecksDefaultTestDeployAssert9AAA1F3B.assets" + ], + "metadata": { + "/AutoScalingGroupHealthChecks/DefaultTest/DeployAssert/BootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "BootstrapVersion" + } + ], + "/AutoScalingGroupHealthChecks/DefaultTest/DeployAssert/CheckBootstrapVersion": [ + { + "type": "aws:cdk:logicalId", + "data": "CheckBootstrapVersion" + } + ] + }, + "displayName": "AutoScalingGroupHealthChecks/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-autoscaling/test/integ.health-checks.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.health-checks.js.snapshot/tree.json new file mode 100644 index 0000000000000..10bc620bb0823 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.health-checks.js.snapshot/tree.json @@ -0,0 +1,1509 @@ +{ + "version": "tree-0.1", + "tree": { + "id": "App", + "path": "", + "children": { + "integ-health-checks": { + "id": "integ-health-checks", + "path": "integ-health-checks", + "children": { + "myVpcAuto": { + "id": "myVpcAuto", + "path": "integ-health-checks/myVpcAuto", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-health-checks/myVpcAuto/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": "integ-health-checks/myVpcAuto" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "PublicSubnet1": { + "id": "PublicSubnet1", + "path": "integ-health-checks/myVpcAuto/PublicSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "integ-health-checks/myVpcAuto/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": "integ-health-checks/myVpcAuto/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "myVpcAuto1A4B61E2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "Acl": { + "id": "Acl", + "path": "integ-health-checks/myVpcAuto/PublicSubnet1/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "integ-health-checks/myVpcAuto/PublicSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "integ-health-checks/myVpcAuto/PublicSubnet1" + } + ], + "vpcId": { + "Ref": "myVpcAuto1A4B61E2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "integ-health-checks/myVpcAuto/PublicSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "myVpcAutoPublicSubnet1RouteTable3D618310" + }, + "subnetId": { + "Ref": "myVpcAutoPublicSubnet1Subnet3516098F" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "integ-health-checks/myVpcAuto/PublicSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "myVpcAutoIGW08055396" + }, + "routeTableId": { + "Ref": "myVpcAutoPublicSubnet1RouteTable3D618310" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "EIP": { + "id": "EIP", + "path": "integ-health-checks/myVpcAuto/PublicSubnet1/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "integ-health-checks/myVpcAuto/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "integ-health-checks/myVpcAuto/PublicSubnet1/NATGateway", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", + "aws:cdk:cloudformation:props": { + "allocationId": { + "Fn::GetAtt": [ + "myVpcAutoPublicSubnet1EIP15D99CAF", + "AllocationId" + ] + }, + "subnetId": { + "Ref": "myVpcAutoPublicSubnet1Subnet3516098F" + }, + "tags": [ + { + "key": "Name", + "value": "integ-health-checks/myVpcAuto/PublicSubnet1" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "PublicSubnet2": { + "id": "PublicSubnet2", + "path": "integ-health-checks/myVpcAuto/PublicSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "integ-health-checks/myVpcAuto/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": "integ-health-checks/myVpcAuto/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "myVpcAuto1A4B61E2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "Acl": { + "id": "Acl", + "path": "integ-health-checks/myVpcAuto/PublicSubnet2/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "integ-health-checks/myVpcAuto/PublicSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "integ-health-checks/myVpcAuto/PublicSubnet2" + } + ], + "vpcId": { + "Ref": "myVpcAuto1A4B61E2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "integ-health-checks/myVpcAuto/PublicSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "myVpcAutoPublicSubnet2RouteTable17ECF2AC" + }, + "subnetId": { + "Ref": "myVpcAutoPublicSubnet2Subnet297C7839" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "integ-health-checks/myVpcAuto/PublicSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "gatewayId": { + "Ref": "myVpcAutoIGW08055396" + }, + "routeTableId": { + "Ref": "myVpcAutoPublicSubnet2RouteTable17ECF2AC" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "EIP": { + "id": "EIP", + "path": "integ-health-checks/myVpcAuto/PublicSubnet2/EIP", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::EIP", + "aws:cdk:cloudformation:props": { + "domain": "vpc", + "tags": [ + { + "key": "Name", + "value": "integ-health-checks/myVpcAuto/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "NATGateway": { + "id": "NATGateway", + "path": "integ-health-checks/myVpcAuto/PublicSubnet2/NATGateway", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::NatGateway", + "aws:cdk:cloudformation:props": { + "allocationId": { + "Fn::GetAtt": [ + "myVpcAutoPublicSubnet2EIPA484FACE", + "AllocationId" + ] + }, + "subnetId": { + "Ref": "myVpcAutoPublicSubnet2Subnet297C7839" + }, + "tags": [ + { + "key": "Name", + "value": "integ-health-checks/myVpcAuto/PublicSubnet2" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "PrivateSubnet1": { + "id": "PrivateSubnet1", + "path": "integ-health-checks/myVpcAuto/PrivateSubnet1", + "children": { + "Subnet": { + "id": "Subnet", + "path": "integ-health-checks/myVpcAuto/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": "integ-health-checks/myVpcAuto/PrivateSubnet1" + } + ], + "vpcId": { + "Ref": "myVpcAuto1A4B61E2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "Acl": { + "id": "Acl", + "path": "integ-health-checks/myVpcAuto/PrivateSubnet1/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "integ-health-checks/myVpcAuto/PrivateSubnet1/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "integ-health-checks/myVpcAuto/PrivateSubnet1" + } + ], + "vpcId": { + "Ref": "myVpcAuto1A4B61E2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "integ-health-checks/myVpcAuto/PrivateSubnet1/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "myVpcAutoPrivateSubnet1RouteTableDC61148B" + }, + "subnetId": { + "Ref": "myVpcAutoPrivateSubnet1SubnetCF0D49B2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "integ-health-checks/myVpcAuto/PrivateSubnet1/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "natGatewayId": { + "Ref": "myVpcAutoPublicSubnet1NATGatewayF3EA78A2" + }, + "routeTableId": { + "Ref": "myVpcAutoPrivateSubnet1RouteTableDC61148B" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "PrivateSubnet2": { + "id": "PrivateSubnet2", + "path": "integ-health-checks/myVpcAuto/PrivateSubnet2", + "children": { + "Subnet": { + "id": "Subnet", + "path": "integ-health-checks/myVpcAuto/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": "integ-health-checks/myVpcAuto/PrivateSubnet2" + } + ], + "vpcId": { + "Ref": "myVpcAuto1A4B61E2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "Acl": { + "id": "Acl", + "path": "integ-health-checks/myVpcAuto/PrivateSubnet2/Acl", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "RouteTable": { + "id": "RouteTable", + "path": "integ-health-checks/myVpcAuto/PrivateSubnet2/RouteTable", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::RouteTable", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "integ-health-checks/myVpcAuto/PrivateSubnet2" + } + ], + "vpcId": { + "Ref": "myVpcAuto1A4B61E2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "RouteTableAssociation": { + "id": "RouteTableAssociation", + "path": "integ-health-checks/myVpcAuto/PrivateSubnet2/RouteTableAssociation", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SubnetRouteTableAssociation", + "aws:cdk:cloudformation:props": { + "routeTableId": { + "Ref": "myVpcAutoPrivateSubnet2RouteTableE10F6006" + }, + "subnetId": { + "Ref": "myVpcAutoPrivateSubnet2Subnet592674AC" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DefaultRoute": { + "id": "DefaultRoute", + "path": "integ-health-checks/myVpcAuto/PrivateSubnet2/DefaultRoute", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::Route", + "aws:cdk:cloudformation:props": { + "destinationCidrBlock": "0.0.0.0/0", + "natGatewayId": { + "Ref": "myVpcAutoPublicSubnet2NATGatewayF670624F" + }, + "routeTableId": { + "Ref": "myVpcAutoPrivateSubnet2RouteTableE10F6006" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "IGW": { + "id": "IGW", + "path": "integ-health-checks/myVpcAuto/IGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::InternetGateway", + "aws:cdk:cloudformation:props": { + "tags": [ + { + "key": "Name", + "value": "integ-health-checks/myVpcAuto" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "VPCGW": { + "id": "VPCGW", + "path": "integ-health-checks/myVpcAuto/VPCGW", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::VPCGatewayAttachment", + "aws:cdk:cloudformation:props": { + "internetGatewayId": { + "Ref": "myVpcAutoIGW08055396" + }, + "vpcId": { + "Ref": "myVpcAuto1A4B61E2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "EC2HealthChecks": { + "id": "EC2HealthChecks", + "path": "integ-health-checks/EC2HealthChecks", + "children": { + "InstanceSecurityGroup": { + "id": "InstanceSecurityGroup", + "path": "integ-health-checks/EC2HealthChecks/InstanceSecurityGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-health-checks/EC2HealthChecks/InstanceSecurityGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "integ-health-checks/EC2HealthChecks/InstanceSecurityGroup", + "securityGroupEgress": [ + { + "cidrIp": "0.0.0.0/0", + "description": "Allow all outbound traffic by default", + "ipProtocol": "-1" + } + ], + "tags": [ + { + "key": "Name", + "value": "integ-health-checks/EC2HealthChecks" + } + ], + "vpcId": { + "Ref": "myVpcAuto1A4B61E2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "InstanceRole": { + "id": "InstanceRole", + "path": "integ-health-checks/EC2HealthChecks/InstanceRole", + "children": { + "ImportInstanceRole": { + "id": "ImportInstanceRole", + "path": "integ-health-checks/EC2HealthChecks/InstanceRole/ImportInstanceRole", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-health-checks/EC2HealthChecks/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" + }, + "tags": [ + { + "key": "Name", + "value": "integ-health-checks/EC2HealthChecks" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "InstanceProfile": { + "id": "InstanceProfile", + "path": "integ-health-checks/EC2HealthChecks/InstanceProfile", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::InstanceProfile", + "aws:cdk:cloudformation:props": { + "roles": [ + { + "Ref": "EC2HealthChecksInstanceRole330231BD" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "ImportedInstanceProfile": { + "id": "ImportedInstanceProfile", + "path": "integ-health-checks/EC2HealthChecks/ImportedInstanceProfile", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "LaunchTemplate": { + "id": "LaunchTemplate", + "path": "integ-health-checks/EC2HealthChecks/LaunchTemplate", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-health-checks/EC2HealthChecks/LaunchTemplate/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::LaunchTemplate", + "aws:cdk:cloudformation:props": { + "launchTemplateData": { + "iamInstanceProfile": { + "arn": { + "Fn::GetAtt": [ + "EC2HealthChecksInstanceProfile0F3A6CD0", + "Arn" + ] + } + }, + "imageId": { + "Ref": "SsmParameterValueawsserviceamiamazonlinuxlatestamznamihvmx8664gp2C96584B6F00A464EAD1953AFF4B05118Parameter" + }, + "instanceType": "t2.micro", + "monitoring": { + "enabled": false + }, + "securityGroupIds": [ + { + "Fn::GetAtt": [ + "EC2HealthChecksInstanceSecurityGroupB5E28934", + "GroupId" + ] + } + ], + "tagSpecifications": [ + { + "resourceType": "instance", + "tags": [ + { + "key": "Name", + "value": "integ-health-checks/EC2HealthChecks/LaunchTemplate" + } + ] + }, + { + "resourceType": "volume", + "tags": [ + { + "key": "Name", + "value": "integ-health-checks/EC2HealthChecks/LaunchTemplate" + } + ] + } + ], + "userData": { + "Fn::Base64": "#!/bin/bash" + } + }, + "tagSpecifications": [ + { + "resourceType": "launch-template", + "tags": [ + { + "key": "Name", + "value": "integ-health-checks/EC2HealthChecks/LaunchTemplate" + } + ] + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "ASG": { + "id": "ASG", + "path": "integ-health-checks/EC2HealthChecks/ASG", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::AutoScaling::AutoScalingGroup", + "aws:cdk:cloudformation:props": { + "healthCheckGracePeriod": 100, + "healthCheckType": "EC2", + "launchTemplate": { + "launchTemplateId": { + "Ref": "EC2HealthChecksLaunchTemplate1F05DB09" + }, + "version": { + "Fn::GetAtt": [ + "EC2HealthChecksLaunchTemplate1F05DB09", + "LatestVersionNumber" + ] + } + }, + "maxSize": "1", + "minSize": "1", + "tags": [ + { + "key": "Name", + "value": "integ-health-checks/EC2HealthChecks", + "propagateAtLaunch": true + } + ], + "vpcZoneIdentifier": [ + { + "Ref": "myVpcAutoPrivateSubnet1SubnetCF0D49B2" + }, + { + "Ref": "myVpcAutoPrivateSubnet2Subnet592674AC" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": { + "id": "SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", + "path": "integ-health-checks/SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118": { + "id": "SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118", + "path": "integ-health-checks/SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "AdditionalHealthChecks": { + "id": "AdditionalHealthChecks", + "path": "integ-health-checks/AdditionalHealthChecks", + "children": { + "InstanceSecurityGroup": { + "id": "InstanceSecurityGroup", + "path": "integ-health-checks/AdditionalHealthChecks/InstanceSecurityGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-health-checks/AdditionalHealthChecks/InstanceSecurityGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "integ-health-checks/AdditionalHealthChecks/InstanceSecurityGroup", + "securityGroupEgress": [ + { + "cidrIp": "0.0.0.0/0", + "description": "Allow all outbound traffic by default", + "ipProtocol": "-1" + } + ], + "tags": [ + { + "key": "Name", + "value": "integ-health-checks/AdditionalHealthChecks" + } + ], + "vpcId": { + "Ref": "myVpcAuto1A4B61E2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "InstanceRole": { + "id": "InstanceRole", + "path": "integ-health-checks/AdditionalHealthChecks/InstanceRole", + "children": { + "ImportInstanceRole": { + "id": "ImportInstanceRole", + "path": "integ-health-checks/AdditionalHealthChecks/InstanceRole/ImportInstanceRole", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-health-checks/AdditionalHealthChecks/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" + }, + "tags": [ + { + "key": "Name", + "value": "integ-health-checks/AdditionalHealthChecks" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "InstanceProfile": { + "id": "InstanceProfile", + "path": "integ-health-checks/AdditionalHealthChecks/InstanceProfile", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::InstanceProfile", + "aws:cdk:cloudformation:props": { + "roles": [ + { + "Ref": "AdditionalHealthChecksInstanceRole8F52F51E" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "ImportedInstanceProfile": { + "id": "ImportedInstanceProfile", + "path": "integ-health-checks/AdditionalHealthChecks/ImportedInstanceProfile", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "LaunchTemplate": { + "id": "LaunchTemplate", + "path": "integ-health-checks/AdditionalHealthChecks/LaunchTemplate", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-health-checks/AdditionalHealthChecks/LaunchTemplate/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::LaunchTemplate", + "aws:cdk:cloudformation:props": { + "launchTemplateData": { + "iamInstanceProfile": { + "arn": { + "Fn::GetAtt": [ + "AdditionalHealthChecksInstanceProfile71F64498", + "Arn" + ] + } + }, + "imageId": { + "Ref": "SsmParameterValueawsserviceamiamazonlinuxlatestamznamihvmx8664gp2C96584B6F00A464EAD1953AFF4B05118Parameter" + }, + "instanceType": "t2.micro", + "monitoring": { + "enabled": false + }, + "securityGroupIds": [ + { + "Fn::GetAtt": [ + "AdditionalHealthChecksInstanceSecurityGroup7ABFD032", + "GroupId" + ] + } + ], + "tagSpecifications": [ + { + "resourceType": "instance", + "tags": [ + { + "key": "Name", + "value": "integ-health-checks/AdditionalHealthChecks/LaunchTemplate" + } + ] + }, + { + "resourceType": "volume", + "tags": [ + { + "key": "Name", + "value": "integ-health-checks/AdditionalHealthChecks/LaunchTemplate" + } + ] + } + ], + "userData": { + "Fn::Base64": "#!/bin/bash" + } + }, + "tagSpecifications": [ + { + "resourceType": "launch-template", + "tags": [ + { + "key": "Name", + "value": "integ-health-checks/AdditionalHealthChecks/LaunchTemplate" + } + ] + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "ASG": { + "id": "ASG", + "path": "integ-health-checks/AdditionalHealthChecks/ASG", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::AutoScaling::AutoScalingGroup", + "aws:cdk:cloudformation:props": { + "healthCheckGracePeriod": 100, + "healthCheckType": "EBS,ELB,VPC_LATTICE", + "launchTemplate": { + "launchTemplateId": { + "Ref": "AdditionalHealthChecksLaunchTemplateCCCFDD89" + }, + "version": { + "Fn::GetAtt": [ + "AdditionalHealthChecksLaunchTemplateCCCFDD89", + "LatestVersionNumber" + ] + } + }, + "maxSize": "1", + "minSize": "1", + "tags": [ + { + "key": "Name", + "value": "integ-health-checks/AdditionalHealthChecks", + "propagateAtLaunch": true + } + ], + "vpcZoneIdentifier": [ + { + "Ref": "myVpcAutoPrivateSubnet1SubnetCF0D49B2" + }, + { + "Ref": "myVpcAutoPrivateSubnet2Subnet592674AC" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "HealthChecksWithoutGrace": { + "id": "HealthChecksWithoutGrace", + "path": "integ-health-checks/HealthChecksWithoutGrace", + "children": { + "InstanceSecurityGroup": { + "id": "InstanceSecurityGroup", + "path": "integ-health-checks/HealthChecksWithoutGrace/InstanceSecurityGroup", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-health-checks/HealthChecksWithoutGrace/InstanceSecurityGroup/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::SecurityGroup", + "aws:cdk:cloudformation:props": { + "groupDescription": "integ-health-checks/HealthChecksWithoutGrace/InstanceSecurityGroup", + "securityGroupEgress": [ + { + "cidrIp": "0.0.0.0/0", + "description": "Allow all outbound traffic by default", + "ipProtocol": "-1" + } + ], + "tags": [ + { + "key": "Name", + "value": "integ-health-checks/HealthChecksWithoutGrace" + } + ], + "vpcId": { + "Ref": "myVpcAuto1A4B61E2" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "InstanceRole": { + "id": "InstanceRole", + "path": "integ-health-checks/HealthChecksWithoutGrace/InstanceRole", + "children": { + "ImportInstanceRole": { + "id": "ImportInstanceRole", + "path": "integ-health-checks/HealthChecksWithoutGrace/InstanceRole/ImportInstanceRole", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "Resource": { + "id": "Resource", + "path": "integ-health-checks/HealthChecksWithoutGrace/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" + }, + "tags": [ + { + "key": "Name", + "value": "integ-health-checks/HealthChecksWithoutGrace" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "InstanceProfile": { + "id": "InstanceProfile", + "path": "integ-health-checks/HealthChecksWithoutGrace/InstanceProfile", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::IAM::InstanceProfile", + "aws:cdk:cloudformation:props": { + "roles": [ + { + "Ref": "HealthChecksWithoutGraceInstanceRole253C2D6A" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "ImportedInstanceProfile": { + "id": "ImportedInstanceProfile", + "path": "integ-health-checks/HealthChecksWithoutGrace/ImportedInstanceProfile", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "LaunchTemplate": { + "id": "LaunchTemplate", + "path": "integ-health-checks/HealthChecksWithoutGrace/LaunchTemplate", + "children": { + "Resource": { + "id": "Resource", + "path": "integ-health-checks/HealthChecksWithoutGrace/LaunchTemplate/Resource", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::EC2::LaunchTemplate", + "aws:cdk:cloudformation:props": { + "launchTemplateData": { + "iamInstanceProfile": { + "arn": { + "Fn::GetAtt": [ + "HealthChecksWithoutGraceInstanceProfileE1C43D1C", + "Arn" + ] + } + }, + "imageId": { + "Ref": "SsmParameterValueawsserviceamiamazonlinuxlatestamznamihvmx8664gp2C96584B6F00A464EAD1953AFF4B05118Parameter" + }, + "instanceType": "t2.micro", + "monitoring": { + "enabled": false + }, + "securityGroupIds": [ + { + "Fn::GetAtt": [ + "HealthChecksWithoutGraceInstanceSecurityGroup9496DAB2", + "GroupId" + ] + } + ], + "tagSpecifications": [ + { + "resourceType": "instance", + "tags": [ + { + "key": "Name", + "value": "integ-health-checks/HealthChecksWithoutGrace/LaunchTemplate" + } + ] + }, + { + "resourceType": "volume", + "tags": [ + { + "key": "Name", + "value": "integ-health-checks/HealthChecksWithoutGrace/LaunchTemplate" + } + ] + } + ], + "userData": { + "Fn::Base64": "#!/bin/bash" + } + }, + "tagSpecifications": [ + { + "resourceType": "launch-template", + "tags": [ + { + "key": "Name", + "value": "integ-health-checks/HealthChecksWithoutGrace/LaunchTemplate" + } + ] + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "ASG": { + "id": "ASG", + "path": "integ-health-checks/HealthChecksWithoutGrace/ASG", + "attributes": { + "aws:cdk:cloudformation:type": "AWS::AutoScaling::AutoScalingGroup", + "aws:cdk:cloudformation:props": { + "healthCheckType": "ELB", + "launchTemplate": { + "launchTemplateId": { + "Ref": "HealthChecksWithoutGraceLaunchTemplate907174BB" + }, + "version": { + "Fn::GetAtt": [ + "HealthChecksWithoutGraceLaunchTemplate907174BB", + "LatestVersionNumber" + ] + } + }, + "maxSize": "1", + "minSize": "1", + "tags": [ + { + "key": "Name", + "value": "integ-health-checks/HealthChecksWithoutGrace", + "propagateAtLaunch": true + } + ], + "vpcZoneIdentifier": [ + { + "Ref": "myVpcAutoPrivateSubnet1SubnetCF0D49B2" + }, + { + "Ref": "myVpcAutoPrivateSubnet2Subnet592674AC" + } + ] + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "integ-health-checks/BootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "integ-health-checks/CheckBootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "AutoScalingGroupHealthChecks": { + "id": "AutoScalingGroupHealthChecks", + "path": "AutoScalingGroupHealthChecks", + "children": { + "DefaultTest": { + "id": "DefaultTest", + "path": "AutoScalingGroupHealthChecks/DefaultTest", + "children": { + "Default": { + "id": "Default", + "path": "AutoScalingGroupHealthChecks/DefaultTest/Default", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "DeployAssert": { + "id": "DeployAssert", + "path": "AutoScalingGroupHealthChecks/DefaultTest/DeployAssert", + "children": { + "BootstrapVersion": { + "id": "BootstrapVersion", + "path": "AutoScalingGroupHealthChecks/DefaultTest/DeployAssert/BootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + }, + "CheckBootstrapVersion": { + "id": "CheckBootstrapVersion", + "path": "AutoScalingGroupHealthChecks/DefaultTest/DeployAssert/CheckBootstrapVersion", + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.0" + } + } + }, + "constructInfo": { + "fqn": "constructs.Construct", + "version": "10.3.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": "constructs.Construct", + "version": "10.3.0" + } + } +} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.health-checks.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.health-checks.ts new file mode 100644 index 0000000000000..1fd6973a18414 --- /dev/null +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-autoscaling/test/integ.health-checks.ts @@ -0,0 +1,56 @@ +import * as ec2 from 'aws-cdk-lib/aws-ec2'; +import * as cdk from 'aws-cdk-lib'; +import * as autoscaling from 'aws-cdk-lib/aws-autoscaling'; +import { IntegTest } from '@aws-cdk/integ-tests-alpha'; + +export class TestStack extends cdk.Stack { + constructor(scope: cdk.App, id: string, props?: cdk.StackProps) { + super(scope, id, props); + + const vpc = new ec2.Vpc(this, 'myVpcAuto', { restrictDefaultSecurityGroup: false }); + + new autoscaling.AutoScalingGroup(this, 'EC2HealthChecks', { + vpc, + instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.MICRO), + machineImage: new ec2.AmazonLinuxImage(), // get the latest Amazon Linux image + healthChecks: autoscaling.HealthChecks.ec2( + { + gracePeriod: cdk.Duration.seconds(100), + }, + ), + }); + + new autoscaling.AutoScalingGroup(this, 'AdditionalHealthChecks', { + vpc, + instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.MICRO), + machineImage: new ec2.AmazonLinuxImage(), // get the latest Amazon Linux image + healthChecks: autoscaling.HealthChecks.withAdditionalChecks({ + gracePeriod: cdk.Duration.seconds(100), + additionalTypes: [ + autoscaling.AdditionalHealthCheckType.EBS, + autoscaling.AdditionalHealthCheckType.ELB, + autoscaling.AdditionalHealthCheckType.VPC_LATTICE, + ], + }), + }); + + new autoscaling.AutoScalingGroup(this, 'HealthChecksWithoutGrace', { + vpc, + instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.MICRO), + machineImage: new ec2.AmazonLinuxImage(), // get the latest Amazon Linux image + healthChecks: autoscaling.HealthChecks.withAdditionalChecks({ + additionalTypes: [ + autoscaling.AdditionalHealthCheckType.ELB, + ], + }), + }); + } +} + +const app = new cdk.App(); + +const stack = new TestStack(app, 'integ-health-checks'); + +new IntegTest(app, 'AutoScalingGroupHealthChecks', { + testCases: [stack], +}); diff --git a/packages/aws-cdk-lib/aws-autoscaling/README.md b/packages/aws-cdk-lib/aws-autoscaling/README.md index 289356f19a9bd..871907120c625 100644 --- a/packages/aws-cdk-lib/aws-autoscaling/README.md +++ b/packages/aws-cdk-lib/aws-autoscaling/README.md @@ -314,6 +314,50 @@ autoScalingGroup.scaleOnSchedule('AllowDownscalingAtNight', { }); ``` +### Health checks for instances + +You can configure the health checks for the instances in the Auto Scaling group. + +Possible health check types are EC2, EBS, ELB, and VPC_LATTICE. EC2 is the default health check and cannot be disabled. + +If you want to configure the EC2 health check, use the `HealthChecks.ec2` method: + +```ts +declare const vpc: ec2.Vpc; + +new autoscaling.AutoScalingGroup(this, 'ASG', { + vpc, + instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.MICRO), + machineImage: ec2.MachineImage.latestAmazonLinux2(), + healthChecks: autoscaling.HealthChecks.ec2({ + gracePeriod: Duration.seconds(100), + }), +}); +``` + +If you also want to configure the additional health checks other than EC2, use the `HealthChecks.withAdditionalChecks` method. +EC2 is implicitly included, so you can specify types other than EC2. + +```ts +declare const vpc: ec2.Vpc; + +new autoscaling.AutoScalingGroup(this, 'ASG', { + vpc, + instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.MICRO), + machineImage: ec2.MachineImage.latestAmazonLinux2(), + healthChecks: autoscaling.HealthChecks.withAdditionalChecks({ + gracePeriod: Duration.seconds(100), + additionalTypes: [ + autoscaling.AdditionalHealthCheckType.EBS, + autoscaling.AdditionalHealthCheckType.ELB, + autoscaling.AdditionalHealthCheckType.VPC_LATTICE, + ], + }), +}); +``` + +> Visit [Health checks for instances in an Auto Scaling group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-health-checks.html) for more details. + ### Instance Maintenance Policy You can configure an instance maintenance policy for your Auto Scaling group to diff --git a/packages/aws-cdk-lib/aws-autoscaling/lib/auto-scaling-group.ts b/packages/aws-cdk-lib/aws-autoscaling/lib/auto-scaling-group.ts index 16e6766d63732..d42c362bfbb62 100644 --- a/packages/aws-cdk-lib/aws-autoscaling/lib/auto-scaling-group.ts +++ b/packages/aws-cdk-lib/aws-autoscaling/lib/auto-scaling-group.ts @@ -231,9 +231,20 @@ export interface CommonAutoScalingGroupProps { * Configuration for health checks * * @default - HealthCheck.ec2 with no grace period + * @deprecated Use `healthChecks` instead */ readonly healthCheck?: HealthCheck; + /** + * Configuration for EC2 or additional health checks + * + * Even when using `HealthChecks.withAdditionalChecks()`, the EC2 type is implicitly included. + * + * @default - EC2 type with no grace period + * @see https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-health-checks.html + */ + readonly healthChecks?: HealthChecks; + /** * Specifies how block devices are exposed to the instance. You can specify virtual devices and EBS volumes. * @@ -1546,6 +1557,8 @@ export class AutoScalingGroup extends AutoScalingGroupBase implements }); } + const { healthCheckType, healthCheckGracePeriod } = this.renderHealthChecks(props.healthChecks, props.healthCheck); + const asgProps: CfnAutoScalingGroupProps = { autoScalingGroupName: this.physicalName, availabilityZoneDistribution: props.azCapacityDistributionStrategy @@ -1560,8 +1573,8 @@ export class AutoScalingGroup extends AutoScalingGroupBase implements notificationConfigurations: this.renderNotificationConfiguration(), metricsCollection: Lazy.any({ produce: () => this.renderMetricsCollection() }), vpcZoneIdentifier: subnetIds, - healthCheckType: props.healthCheck && props.healthCheck.type, - healthCheckGracePeriod: props.healthCheck && props.healthCheck.gracePeriod && props.healthCheck.gracePeriod.toSeconds(), + healthCheckType, + healthCheckGracePeriod, maxInstanceLifetime: this.maxInstanceLifetime ? this.maxInstanceLifetime.toSeconds() : undefined, newInstancesProtectedFromScaleIn: Lazy.any({ produce: () => this.newInstancesProtectedFromScaleIn }), terminationPolicies: terminationPolicies.length === 0 ? undefined : terminationPolicies, @@ -2032,6 +2045,25 @@ export class AutoScalingGroup extends AutoScalingGroupBase implements maxHealthyPercentage, }; } + + private renderHealthChecks(healthChecks?: HealthChecks, healthCheck?: HealthCheck): { healthCheckType?: string; healthCheckGracePeriod?: number } { + if (healthCheck && healthChecks) { + throw new ValidationError('Cannot specify both \'healthCheck\' and \'healthChecks\'. Please use \'healthChecks\' only.', this); + } + + let healthCheckType: string | undefined; + let healthCheckGracePeriod: number | undefined; + + if (healthChecks) { + healthCheckType = healthChecks.types.join(','); + healthCheckGracePeriod = healthChecks.gracePeriod?.toSeconds(); + } else if (healthCheck) { + healthCheckType = healthCheck.type; + healthCheckGracePeriod = healthCheck.gracePeriod?.toSeconds(); + } + + return { healthCheckType, healthCheckGracePeriod }; + } } /** @@ -2238,6 +2270,8 @@ const DEFAULT_SUSPEND_PROCESSES = [ScalingProcess.HEALTH_CHECK, ScalingProcess.R /** * EC2 Heath check options + * + * @deprecated Use Ec2HealthChecksOptions instead */ export interface Ec2HealthCheckOptions { /** @@ -2250,6 +2284,8 @@ export interface Ec2HealthCheckOptions { /** * ELB Heath check options + * + * @deprecated Use AdditionalHealthChecksOptions instead */ export interface ElbHealthCheckOptions { /** @@ -2262,6 +2298,8 @@ export interface ElbHealthCheckOptions { /** * Health check settings + * + * @deprecated Use HealthChecks instead */ export class HealthCheck { /** @@ -2286,11 +2324,94 @@ export class HealthCheck { private constructor(public readonly type: string, public readonly gracePeriod?: Duration) { } } +/** + * Heath checks base options + */ +interface HealthChecksBaseOptions { + /** + * Specified the time Auto Scaling waits before checking the health status of an EC2 instance that has come into service + * and marking it unhealthy due to a failed health check. + * + * @default Duration.seconds(0) + * @see https://docs.aws.amazon.com/autoscaling/ec2/userguide/health-check-grace-period.html + */ + readonly gracePeriod?: Duration; +} + +/** + * EC2 Heath checks options + */ +export interface Ec2HealthChecksOptions extends HealthChecksBaseOptions { +} + +/** + * Additional Heath checks options + */ +export interface AdditionalHealthChecksOptions extends HealthChecksBaseOptions { + /** + * One or more health check types other than EC2. + */ + readonly additionalTypes: AdditionalHealthCheckType[]; +} + +/** + * Health check settings for multiple types + */ +export class HealthChecks { + /** + * Use EC2 only for health checks. + * + * @param options EC2 health checks options + */ + public static ec2(options: Ec2HealthChecksOptions = {}): HealthChecks { + return new HealthChecks(['EC2'], options.gracePeriod); + } + + /** + * Use additional health checks other than EC2. + * + * Specify types other than EC2, as EC2 is always enabled. + * It considers the instance unhealthy if it fails either the EC2 status checks or the additional health checks. + * + * @param options Additional health checks options + */ + public static withAdditionalChecks(options: AdditionalHealthChecksOptions): HealthChecks { + return new HealthChecks(options.additionalTypes, options.gracePeriod); + } + + private constructor(public readonly types: string[], public readonly gracePeriod?: Duration) { + if (types.length === 0) { + throw new UnscopedValidationError('At least one health check type must be specified in \'additionalTypes\' for \'healthChecks\''); + } + } +} + +/** + * @deprecated Use AdditionalHealthCheckType instead + */ enum HealthCheckType { EC2 = 'EC2', ELB = 'ELB', } +/** + * Additional Health Check Type + */ +export enum AdditionalHealthCheckType { + /** + * ELB Health Check + */ + ELB = 'ELB', + /** + * EBS Health Check + */ + EBS = 'EBS', + /** + * VPC LATTICE Health Check + */ + VPC_LATTICE = 'VPC_LATTICE', +} + /** * Render the rolling update configuration into the appropriate object */ diff --git a/packages/aws-cdk-lib/aws-autoscaling/test/auto-scaling-group.test.ts b/packages/aws-cdk-lib/aws-autoscaling/test/auto-scaling-group.test.ts index 884ac5235dec5..600f70022a29e 100644 --- a/packages/aws-cdk-lib/aws-autoscaling/test/auto-scaling-group.test.ts +++ b/packages/aws-cdk-lib/aws-autoscaling/test/auto-scaling-group.test.ts @@ -650,7 +650,7 @@ describe('auto scaling group', () => { }); }); - test('can configure EC2 health check', () => { + testDeprecated('can configure EC2 health check', () => { // GIVEN const stack = new cdk.Stack(undefined, 'MyStack', { env: { region: 'us-east-1', account: '1234' } }); const vpc = mockVpc(stack); @@ -669,7 +669,7 @@ describe('auto scaling group', () => { }); }); - test('can configure EBS health check', () => { + testDeprecated('can configure ELB health check', () => { // GIVEN const stack = new cdk.Stack(undefined, 'MyStack', { env: { region: 'us-east-1', account: '1234' } }); const vpc = mockVpc(stack); @@ -689,6 +689,106 @@ describe('auto scaling group', () => { }); }); + test.each([ + cdk.Duration.seconds(100), + undefined, + ])('can configure EC2 health checks with gracePeriod is %s', (gracePeriod) => { + // GIVEN + const stack = new cdk.Stack(undefined, 'MyStack', { env: { region: 'us-east-1', account: '1234' } }); + const vpc = mockVpc(stack); + + // WHEN + new autoscaling.AutoScalingGroup(stack, 'MyFleet', { + instanceType: ec2.InstanceType.of(ec2.InstanceClass.M4, ec2.InstanceSize.MICRO), + machineImage: new ec2.AmazonLinuxImage(), + vpc, + healthChecks: autoscaling.HealthChecks.ec2({ + gracePeriod, + }), + }); + + const expectedGrace = gracePeriod ? gracePeriod.toSeconds() : Match.absent(); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::AutoScaling::AutoScalingGroup', { + HealthCheckType: 'EC2', + HealthCheckGracePeriod: expectedGrace, + }); + }); + + test.each([ + cdk.Duration.seconds(100), + undefined, + ])('can configure additional health checks with gracePeriod is %s', (gracePeriod) => { + // GIVEN + const stack = new cdk.Stack(undefined, 'MyStack', { env: { region: 'us-east-1', account: '1234' } }); + const vpc = mockVpc(stack); + + // WHEN + new autoscaling.AutoScalingGroup(stack, 'MyFleet', { + instanceType: ec2.InstanceType.of(ec2.InstanceClass.M4, ec2.InstanceSize.MICRO), + machineImage: new ec2.AmazonLinuxImage(), + vpc, + healthChecks: autoscaling.HealthChecks.withAdditionalChecks({ + gracePeriod, + additionalTypes: [ + autoscaling.AdditionalHealthCheckType.EBS, + autoscaling.AdditionalHealthCheckType.ELB, + autoscaling.AdditionalHealthCheckType.VPC_LATTICE, + ], + }), + }); + + const expectedGrace = gracePeriod ? gracePeriod.toSeconds() : Match.absent(); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::AutoScaling::AutoScalingGroup', { + HealthCheckType: 'EBS,ELB,VPC_LATTICE', + HealthCheckGracePeriod: expectedGrace, + }); + }); + + test('throws if both healthCheck and healthChecks are specified.', () => { + // GIVEN + const stack = new cdk.Stack(undefined, 'MyStack', { env: { region: 'us-east-1', account: '1234' } }); + const vpc = mockVpc(stack); + + // WHEN + expect(() => { + new autoscaling.AutoScalingGroup(stack, 'MyFleet', { + instanceType: ec2.InstanceType.of(ec2.InstanceClass.M4, ec2.InstanceSize.MICRO), + machineImage: new ec2.AmazonLinuxImage(), + vpc, + healthCheck: autoscaling.HealthCheck.ec2(), + healthChecks: autoscaling.HealthChecks.withAdditionalChecks({ + gracePeriod: cdk.Duration.seconds(100), + additionalTypes: [ + autoscaling.AdditionalHealthCheckType.EBS, + ], + }), + }); + }).toThrow(/Cannot specify both 'healthCheck' and 'healthChecks'. Please use 'healthChecks' only./); + }); + + test('throws when additionalTypes array for additional health checks is empty', () => { + // GIVEN + const stack = new cdk.Stack(undefined, 'MyStack', { env: { region: 'us-east-1', account: '1234' } }); + const vpc = mockVpc(stack); + + // THEN + expect(() => { + new autoscaling.AutoScalingGroup(stack, 'MyFleet', { + instanceType: ec2.InstanceType.of(ec2.InstanceClass.M4, ec2.InstanceSize.MICRO), + machineImage: new ec2.AmazonLinuxImage(), + vpc, + healthChecks: autoscaling.HealthChecks.withAdditionalChecks({ + gracePeriod: cdk.Duration.seconds(100), + additionalTypes: [], + }), + }); + }).toThrow(/At least one health check type must be specified in 'additionalTypes' for 'healthChecks'/); + }); + test('can add Security Group to Fleet', () => { // GIVEN const stack = new cdk.Stack(undefined, 'MyStack', { env: { region: 'us-east-1', account: '1234' } }); diff --git a/packages/aws-cdk-lib/awslint.json b/packages/aws-cdk-lib/awslint.json index de6e45e21ac96..6c7775644b6f3 100644 --- a/packages/aws-cdk-lib/awslint.json +++ b/packages/aws-cdk-lib/awslint.json @@ -258,6 +258,8 @@ "docs-public-apis:aws-cdk-lib.aws_autoscaling.AutoScalingGroup.fromAutoScalingGroupName", "docs-public-apis:aws-cdk-lib.aws_autoscaling.HealthCheck.type", "docs-public-apis:aws-cdk-lib.aws_autoscaling.HealthCheck.gracePeriod", + "docs-public-apis:aws-cdk-lib.aws_autoscaling.HealthChecks.types", + "docs-public-apis:aws-cdk-lib.aws_autoscaling.HealthChecks.gracePeriod", "docs-public-apis:aws-cdk-lib.aws_autoscaling.StepScalingPolicy.*", "docs-public-apis:aws-cdk-lib.aws_autoscaling.TargetTrackingScalingPolicy", "docs-public-apis:aws-cdk-lib.aws_cloudfront.ViewerCertificate.aliases", @@ -968,7 +970,6 @@ "docs-public-apis:aws-cdk-lib.aws_appconfig.IDeploymentStrategy", "docs-public-apis:aws-cdk-lib.aws_appconfig.IConfiguration", "docs-public-apis:aws-cdk-lib.aws_appconfig.IApplication", - "from-signature:aws-cdk-lib.aws_appconfig.DeploymentStrategy.fromDeploymentStrategyId.params[2]", "events-method-signature:aws-cdk-lib.aws_appconfig.Application.on", "events-method-signature:aws-cdk-lib.aws_appconfig.Application.onDeploymentBaking*",