From be1f5ee1c5e4dfa2392995398bc18b0fc1a9b8ac Mon Sep 17 00:00:00 2001 From: Vito Laurenza Date: Fri, 5 Dec 2025 10:53:55 -0500 Subject: [PATCH 1/4] chore(ecs): add test showing bug in enableDeploymentAlarms --- .../aws-ecs/test/base-service.test.ts | 40 ++++++++++++++++++- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/packages/aws-cdk-lib/aws-ecs/test/base-service.test.ts b/packages/aws-cdk-lib/aws-ecs/test/base-service.test.ts index d2b332c95dd52..64d5b372d5dec 100644 --- a/packages/aws-cdk-lib/aws-ecs/test/base-service.test.ts +++ b/packages/aws-cdk-lib/aws-ecs/test/base-service.test.ts @@ -1,9 +1,8 @@ import { Template, Match } from '../../assertions'; +import * as cloudwatch from '../../aws-cloudwatch'; import * as ec2 from '../../aws-ec2'; -import * as elbv2 from '../../aws-elasticloadbalancingv2'; import * as iam from '../../aws-iam'; import * as kms from '../../aws-kms'; -import * as lambda from '../../aws-lambda'; import * as cdk from '../../core'; import { App, Stack } from '../../core'; import * as cxapi from '../../cx-api'; @@ -309,6 +308,43 @@ describe('For alarm-based rollbacks', () => { }, }); }); + + describe('enableDeploymentAlarms', () => { + test('enableDeploymentAlarms will concat alarms in the deployment configuration when called more than once', () => { + // GIVEN + const vpc = new ec2.Vpc(stack, 'Vpc'); + const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc }); + const taskDefinition = new ecs.FargateTaskDefinition(stack, 'FargateTaskDef'); + taskDefinition.addContainer('web', { + image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'), + }); + + const expectedAlarmNames = ['alarm1', 'alarm2', 'alarm3']; + + // WHEN + const service = new ecs.FargateService(stack, 'FargateService', { + cluster, + taskDefinition, + minHealthyPercent: 100, + maxHealthyPercent: 200, + deploymentAlarms: { alarmNames: ['alarm1'] }, + }); + + service.enableDeploymentAlarms(['alarm2']); + service.enableDeploymentAlarms(['alarm3']); + + // THEN + Template.fromStack(stack).hasResourceProperties('AWS::ECS::Service', { + DeploymentConfiguration: { + Alarms: { + AlarmNames: expectedAlarmNames, + Enable: true, + Rollback: true, + }, + }, + }); + }); + }); }); describe('When specifying a task definition revision', () => { From 49ef68ebb9501bd81984b46c19f1961e38a9b2c6 Mon Sep 17 00:00:00 2001 From: Vito Laurenza Date: Fri, 5 Dec 2025 10:55:21 -0500 Subject: [PATCH 2/4] fix(ecs): enableDeploymentAlarms should mutate the alarmNames property concat() does not mutate the existing array, while push() does --- packages/aws-cdk-lib/aws-ecs/lib/base/base-service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-ecs/lib/base/base-service.ts b/packages/aws-cdk-lib/aws-ecs/lib/base/base-service.ts index 2654143c4d2b8..4e163a94e664f 100644 --- a/packages/aws-cdk-lib/aws-ecs/lib/base/base-service.ts +++ b/packages/aws-cdk-lib/aws-ecs/lib/base/base-service.ts @@ -973,7 +973,7 @@ export abstract class BaseService extends Resource } else { // If deployment alarms have previously been enabled, we only need to add // the new alarm names, since rollback behaviors can't be updated/mixed. - this.deploymentAlarms.alarmNames.concat(alarmNames); + this.deploymentAlarms.alarmNames.push(...alarmNames); } } From 015f94269aedb07471d6a31619d6e1a99c2d1aa6 Mon Sep 17 00:00:00 2001 From: Vito Laurenza Date: Mon, 8 Dec 2025 12:18:11 -0500 Subject: [PATCH 3/4] chore(ecs): add integration test coverage --- .../aws-ecs-blue-green-deployment.assets.json | 6 +- ...ws-ecs-blue-green-deployment.template.json | 36 ++++ .../integ.json | 2 +- .../manifest.json | 187 +++++++----------- .../tree.json | 2 +- .../integ.blue-green-deployment-strategy.ts | 24 +++ 6 files changed, 135 insertions(+), 122 deletions(-) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.js.snapshot/aws-ecs-blue-green-deployment.assets.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.js.snapshot/aws-ecs-blue-green-deployment.assets.json index 694301ea99736..18a49218b7ceb 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.js.snapshot/aws-ecs-blue-green-deployment.assets.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.js.snapshot/aws-ecs-blue-green-deployment.assets.json @@ -1,16 +1,16 @@ { "version": "48.0.0", "files": { - "3f2de3687de753e01df8af1f3f5db3418f528a660a93dfdd7cb90e7ed75c213f": { + "856865a383105a35ce3d6e6e1172b42adc91b0e246187cdff4941ca3a726bf8e": { "displayName": "aws-ecs-blue-green-deployment Template", "source": { "path": "aws-ecs-blue-green-deployment.template.json", "packaging": "file" }, "destinations": { - "current_account-current_region-289748b6": { + "current_account-current_region-06474891": { "bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}", - "objectKey": "3f2de3687de753e01df8af1f3f5db3418f528a660a93dfdd7cb90e7ed75c213f.json", + "objectKey": "856865a383105a35ce3d6e6e1172b42adc91b0e246187cdff4941ca3a726bf8e.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/base/integ.blue-green-deployment-strategy.js.snapshot/aws-ecs-blue-green-deployment.template.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.js.snapshot/aws-ecs-blue-green-deployment.template.json index cc03e2ba30041..90b5584c282fe 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.js.snapshot/aws-ecs-blue-green-deployment.template.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.js.snapshot/aws-ecs-blue-green-deployment.template.json @@ -740,6 +740,18 @@ "Ref": "FargateCluster7CCD5F93" }, "DeploymentConfiguration": { + "Alarms": { + "AlarmNames": [ + { + "Ref": "MyCustomAlarmBBB0BEE1" + }, + { + "Ref": "AnotherCustomAlarm221DEB18" + } + ], + "Enable": true, + "Rollback": true + }, "LifecycleHooks": [ { "HookTargetArn": { @@ -911,6 +923,30 @@ } ] } + }, + "MyCustomAlarmBBB0BEE1": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "EvaluationPeriods": 2, + "MetricName": "MyCustomMetric", + "Namespace": "Custom", + "Period": 300, + "Statistic": "Average", + "Threshold": 80 + } + }, + "AnotherCustomAlarm221DEB18": { + "Type": "AWS::CloudWatch::Alarm", + "Properties": { + "ComparisonOperator": "GreaterThanOrEqualToThreshold", + "EvaluationPeriods": 2, + "MetricName": "AnotherCustomMetric", + "Namespace": "Custom", + "Period": 300, + "Statistic": "Average", + "Threshold": 80 + } } }, "Parameters": { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.js.snapshot/integ.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.js.snapshot/integ.json index a40a7e4f89c29..71ce62737c69f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.js.snapshot/integ.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.js.snapshot/integ.json @@ -9,5 +9,5 @@ "assertionStackName": "awsecsbluegreenDefaultTestDeployAssertA9C6C1DC" } }, - "minimumCliVersion": "2.1023.0" + "minimumCliVersion": "2.1033.0" } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.js.snapshot/manifest.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.js.snapshot/manifest.json index 8addde70457d7..3fd427371822f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.js.snapshot/manifest.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.js.snapshot/manifest.json @@ -18,7 +18,7 @@ "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}/3f2de3687de753e01df8af1f3f5db3418f528a660a93dfdd7cb90e7ed75c213f.json", + "stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/856865a383105a35ce3d6e6e1172b42adc91b0e246187cdff4941ca3a726bf8e.json", "requiresBootstrapStackVersion": 6, "bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version", "additionalDependencies": [ @@ -510,18 +510,8 @@ ], "/aws-ecs-blue-green-deployment/LambdaHook/ServiceRole": [ { - "type": "aws:cdk:analytics:construct", - "data": { - "assumedBy": { - "principalAccount": "*", - "assumeRoleAction": "*" - }, - "managedPolicies": [ - { - "managedPolicyArn": "*" - } - ] - } + "type": "aws:cdk:warning", + "data": "Failed to add construct metadata for node [ServiceRole]. Reason: ValidationError: The result of fromAwsManagedPolicyName can not be used in this API [ack: @aws-cdk/core:addConstructMetadataFailed]" } ], "/aws-ecs-blue-green-deployment/LambdaHook/ServiceRole/ImportServiceRole": [ @@ -600,10 +590,7 @@ "/aws-ecs-blue-green-deployment/TaskDef/Resource": [ { "type": "aws:cdk:logicalId", - "data": "TaskDef54694570", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" - ] + "data": "TaskDef54694570" } ], "/aws-ecs-blue-green-deployment/Service": [ @@ -614,31 +601,26 @@ { "type": "aws:cdk:analytics:construct", "data": "*" + }, + { + "type": "aws:cdk:info", + "data": "Deployment alarm ({\"Ref\":\"MyCustomAlarmBBB0BEE1\"}) enabled on Service may cause a circular dependency error when this stack deploys. The alarm name references the alarm's logical id, or another resource. See the 'Deployment alarms' section in the module README for more details." + }, + { + "type": "aws:cdk:info", + "data": "Deployment alarm ({\"Ref\":\"AnotherCustomAlarm221DEB18\"}) enabled on Service may cause a circular dependency error when this stack deploys. The alarm name references the alarm's logical id, or another resource. See the 'Deployment alarms' section in the module README for more details." } ], "/aws-ecs-blue-green-deployment/Service/Service": [ { "type": "aws:cdk:logicalId", - "data": "ServiceD69D759B", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_REPLACE" - ] + "data": "ServiceD69D759B" } ], "/aws-ecs-blue-green-deployment/Service/LBAlternateOptionsRole": [ { - "type": "aws:cdk:analytics:construct", - "data": { - "assumedBy": { - "principalAccount": "*", - "assumeRoleAction": "*" - }, - "managedPolicies": [ - { - "managedPolicyArn": "*" - } - ] - } + "type": "aws:cdk:warning", + "data": "Failed to add construct metadata for node [LBAlternateOptionsRole]. Reason: ValidationError: The result of fromAwsManagedPolicyName can not be used in this API [ack: @aws-cdk/core:addConstructMetadataFailed]" } ], "/aws-ecs-blue-green-deployment/Service/LBAlternateOptionsRole/ImportLBAlternateOptionsRole": [ @@ -736,43 +718,54 @@ "data": "ServicePreScaleUpRoleDefaultPolicyF1032E86" } ], - "/aws-ecs-blue-green-deployment/BootstrapVersion": [ + "/aws-ecs-blue-green-deployment/MyCustomAlarm": [ { - "type": "aws:cdk:logicalId", - "data": "BootstrapVersion" + "type": "aws:cdk:analytics:construct", + "data": { + "metric": { + "warnings": "*", + "warningsV2": "*" + }, + "threshold": "*", + "evaluationPeriods": "*" + } } ], - "/aws-ecs-blue-green-deployment/CheckBootstrapVersion": [ + "/aws-ecs-blue-green-deployment/MyCustomAlarm/Resource": [ { "type": "aws:cdk:logicalId", - "data": "CheckBootstrapVersion" + "data": "MyCustomAlarmBBB0BEE1" + } + ], + "/aws-ecs-blue-green-deployment/AnotherCustomAlarm": [ + { + "type": "aws:cdk:analytics:construct", + "data": { + "metric": { + "warnings": "*", + "warningsV2": "*" + }, + "threshold": "*", + "evaluationPeriods": "*" + } } ], - "EcsTaskExecutionRoleC0B6A84D": [ + "/aws-ecs-blue-green-deployment/AnotherCustomAlarm/Resource": [ { "type": "aws:cdk:logicalId", - "data": "EcsTaskExecutionRoleC0B6A84D", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] + "data": "AnotherCustomAlarm221DEB18" } ], - "ServiceRole4288B192": [ + "/aws-ecs-blue-green-deployment/BootstrapVersion": [ { "type": "aws:cdk:logicalId", - "data": "ServiceRole4288B192", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] + "data": "BootstrapVersion" } ], - "ServiceRoleDefaultPolicy94CF55F6": [ + "/aws-ecs-blue-green-deployment/CheckBootstrapVersion": [ { "type": "aws:cdk:logicalId", - "data": "ServiceRoleDefaultPolicy94CF55F6", - "trace": [ - "!!DESTRUCTIVE_CHANGES: WILL_DESTROY" - ] + "data": "CheckBootstrapVersion" } ] }, @@ -837,19 +830,10 @@ "properties": { "module": "aws-cdk-lib", "flags": { - "@aws-cdk/core:enableStackNameDuplicates": { - "recommendedValue": true, - "explanation": "Allow multiple stacks with the same name", - "unconfiguredBehavesLike": { - "v2": true - } - }, - "aws-cdk:enableDiffNoFail": { + "@aws-cdk/aws-signer:signingProfileNamePassedToCfn": { + "userValue": true, "recommendedValue": true, - "explanation": "Make `cdk diff` not fail when there are differences", - "unconfiguredBehavesLike": { - "v2": true - } + "explanation": "Pass signingProfileName to CfnSigningProfile" }, "@aws-cdk/core:newStyleStackSynthesis": { "recommendedValue": true, @@ -865,40 +849,10 @@ "v2": true } }, - "@aws-cdk/aws-ecr-assets:dockerIgnoreSupport": { - "recommendedValue": true, - "explanation": "DockerImageAsset properly supports `.dockerignore` files by default", - "unconfiguredBehavesLike": { - "v2": true - } - }, - "@aws-cdk/aws-secretsmanager:parseOwnedSecretName": { - "recommendedValue": true, - "explanation": "Fix the referencing of SecretsManager names from ARNs", - "unconfiguredBehavesLike": { - "v2": true - } - }, - "@aws-cdk/aws-kms:defaultKeyPolicies": { - "recommendedValue": true, - "explanation": "Tighten default KMS key policies", - "unconfiguredBehavesLike": { - "v2": true - } - }, - "@aws-cdk/aws-s3:grantWriteWithoutAcl": { - "recommendedValue": true, - "explanation": "Remove `PutObjectAcl` from Bucket.grantWrite", - "unconfiguredBehavesLike": { - "v2": true - } - }, - "@aws-cdk/aws-ecs-patterns:removeDefaultDesiredCount": { + "@aws-cdk/aws-ecs-patterns:secGroupsDisablesImplicitOpenListener": { + "userValue": true, "recommendedValue": true, - "explanation": "Do not specify a default DesiredCount for ECS services", - "unconfiguredBehavesLike": { - "v2": true - } + "explanation": "Disable implicit openListener when custom security groups are provided" }, "@aws-cdk/aws-rds:lowercaseDbIdentifier": { "recommendedValue": true, @@ -914,13 +868,6 @@ "v2": true } }, - "@aws-cdk/aws-efs:defaultEncryptionAtRest": { - "recommendedValue": true, - "explanation": "Enable this feature flag to have elastic file systems encrypted at rest by default.", - "unconfiguredBehavesLike": { - "v2": true - } - }, "@aws-cdk/aws-lambda:recognizeVersionProps": { "recommendedValue": true, "explanation": "Enable this feature flag to opt in to the updated logical id calculation for Lambda Version created using the `fn.currentVersion`.", @@ -1015,7 +962,7 @@ "@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName": { "userValue": true, "recommendedValue": true, - "explanation": "Enable this feature to by default create default policy names for imported roles that depend on the stack the role is in." + "explanation": "Enable this feature to create default policy names for imported roles that depend on the stack the role is in." }, "@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": { "userValue": true, @@ -1317,10 +1264,7 @@ }, "@aws-cdk/cognito:logUserPoolClientSecretValue": { "recommendedValue": false, - "explanation": "When disabled, the value of the user pool client secret will not be logged in the custom resource lambda function logs.", - "unconfiguredBehavesLike": { - "v2": false - } + "explanation": "When disabled, the value of the user pool client secret will not be logged in the custom resource lambda function logs." }, "@aws-cdk/pipelines:reduceCrossAccountActionRoleTrustScope": { "recommendedValue": true, @@ -1346,10 +1290,7 @@ }, "@aws-cdk/aws-ec2-alpha:useResourceIdForVpcV2Migration": { "recommendedValue": false, - "explanation": "When enabled, use resource IDs for VPC V2 migration", - "unconfiguredBehavesLike": { - "v2": false - } + "explanation": "When enabled, use resource IDs for VPC V2 migration" }, "@aws-cdk/aws-s3:publicAccessBlockedByDefault": { "userValue": true, @@ -1359,14 +1300,26 @@ "@aws-cdk/aws-lambda:useCdkManagedLogGroup": { "userValue": true, "recommendedValue": true, - "explanation": "When enabled, CDK creates and manages loggroup for the lambda function", + "explanation": "When enabled, CDK creates and manages loggroup for the lambda function" + }, + "@aws-cdk/aws-elasticloadbalancingv2:networkLoadBalancerWithSecurityGroupByDefault": { + "recommendedValue": true, + "explanation": "When enabled, Network Load Balancer will be created with a security group by default." + }, + "@aws-cdk/aws-stepfunctions-tasks:httpInvokeDynamicJsonPathEndpoint": { + "recommendedValue": true, + "explanation": "When enabled, allows using a dynamic apiEndpoint with JSONPath format in HttpInvoke tasks.", "unconfiguredBehavesLike": { - "v2": false + "v2": true } + }, + "@aws-cdk/aws-ecs-patterns:uniqueTargetGroupId": { + "recommendedValue": true, + "explanation": "When enabled, ECS patterns will generate unique target group IDs to prevent conflicts during load balancer replacement" } } } } }, - "minimumCliVersion": "2.1023.0" + "minimumCliVersion": "2.1033.0" } \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.js.snapshot/tree.json b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.js.snapshot/tree.json index c6da4e094e80f..d0e2d5393c64a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.js.snapshot/tree.json +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.js.snapshot/tree.json @@ -1 +1 @@ -{"version":"tree-0.1","tree":{"id":"App","path":"","constructInfo":{"fqn":"aws-cdk-lib.App","version":"0.0.0"},"children":{"aws-ecs-blue-green-deployment":{"id":"aws-ecs-blue-green-deployment","path":"aws-ecs-blue-green-deployment","constructInfo":{"fqn":"aws-cdk-lib.Stack","version":"0.0.0"},"children":{"Vpc":{"id":"Vpc","path":"aws-ecs-blue-green-deployment/Vpc","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.Vpc","version":"0.0.0","metadata":[{"maxAzs":"*","restrictDefaultSecurityGroup":false}]},"children":{"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/Vpc/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnVPC","version":"0.0.0"},"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-blue-green-deployment/Vpc"}]}}},"PublicSubnet1":{"id":"PublicSubnet1","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet1","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.PublicSubnet","version":"0.0.0","metadata":[{"availabilityZone":"*","vpcId":"*","cidrBlock":"*","mapPublicIpOnLaunch":true,"ipv6CidrBlock":"*","assignIpv6AddressOnCreation":"*"},{"availabilityZone":"*","vpcId":"*","cidrBlock":"*","mapPublicIpOnLaunch":true,"ipv6CidrBlock":"*","assignIpv6AddressOnCreation":"*"},{},{"addNatGateway":["*"]}]},"children":{"Subnet":{"id":"Subnet","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet1/Subnet","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSubnet","version":"0.0.0"},"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-blue-green-deployment/Vpc/PublicSubnet1"}],"vpcId":{"Ref":"Vpc8378EB38"}}}},"Acl":{"id":"Acl","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet1/Acl","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":[]}},"RouteTable":{"id":"RouteTable","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet1/RouteTable","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnRouteTable","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::RouteTable","aws:cdk:cloudformation:props":{"tags":[{"key":"Name","value":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet1"}],"vpcId":{"Ref":"Vpc8378EB38"}}}},"RouteTableAssociation":{"id":"RouteTableAssociation","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet1/RouteTableAssociation","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::SubnetRouteTableAssociation","aws:cdk:cloudformation:props":{"routeTableId":{"Ref":"VpcPublicSubnet1RouteTable6C95E38E"},"subnetId":{"Ref":"VpcPublicSubnet1Subnet5C2D37C4"}}}},"DefaultRoute":{"id":"DefaultRoute","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet1/DefaultRoute","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnRoute","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::Route","aws:cdk:cloudformation:props":{"destinationCidrBlock":"0.0.0.0/0","gatewayId":{"Ref":"VpcIGWD7BA715C"},"routeTableId":{"Ref":"VpcPublicSubnet1RouteTable6C95E38E"}}}},"EIP":{"id":"EIP","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet1/EIP","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnEIP","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::EIP","aws:cdk:cloudformation:props":{"domain":"vpc","tags":[{"key":"Name","value":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet1"}]}}},"NATGateway":{"id":"NATGateway","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet1/NATGateway","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnNatGateway","version":"0.0.0"},"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-blue-green-deployment/Vpc/PublicSubnet1"}]}}}}},"PublicSubnet2":{"id":"PublicSubnet2","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet2","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.PublicSubnet","version":"0.0.0","metadata":[{"availabilityZone":"*","vpcId":"*","cidrBlock":"*","mapPublicIpOnLaunch":true,"ipv6CidrBlock":"*","assignIpv6AddressOnCreation":"*"},{"availabilityZone":"*","vpcId":"*","cidrBlock":"*","mapPublicIpOnLaunch":true,"ipv6CidrBlock":"*","assignIpv6AddressOnCreation":"*"},{},{"addNatGateway":["*"]}]},"children":{"Subnet":{"id":"Subnet","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet2/Subnet","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSubnet","version":"0.0.0"},"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-blue-green-deployment/Vpc/PublicSubnet2"}],"vpcId":{"Ref":"Vpc8378EB38"}}}},"Acl":{"id":"Acl","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet2/Acl","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":[]}},"RouteTable":{"id":"RouteTable","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet2/RouteTable","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnRouteTable","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::RouteTable","aws:cdk:cloudformation:props":{"tags":[{"key":"Name","value":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet2"}],"vpcId":{"Ref":"Vpc8378EB38"}}}},"RouteTableAssociation":{"id":"RouteTableAssociation","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet2/RouteTableAssociation","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::SubnetRouteTableAssociation","aws:cdk:cloudformation:props":{"routeTableId":{"Ref":"VpcPublicSubnet2RouteTable94F7E489"},"subnetId":{"Ref":"VpcPublicSubnet2Subnet691E08A3"}}}},"DefaultRoute":{"id":"DefaultRoute","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet2/DefaultRoute","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnRoute","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::Route","aws:cdk:cloudformation:props":{"destinationCidrBlock":"0.0.0.0/0","gatewayId":{"Ref":"VpcIGWD7BA715C"},"routeTableId":{"Ref":"VpcPublicSubnet2RouteTable94F7E489"}}}},"EIP":{"id":"EIP","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet2/EIP","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnEIP","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::EIP","aws:cdk:cloudformation:props":{"domain":"vpc","tags":[{"key":"Name","value":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet2"}]}}},"NATGateway":{"id":"NATGateway","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet2/NATGateway","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnNatGateway","version":"0.0.0"},"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-blue-green-deployment/Vpc/PublicSubnet2"}]}}}}},"PrivateSubnet1":{"id":"PrivateSubnet1","path":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet1","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.PrivateSubnet","version":"0.0.0","metadata":[{"availabilityZone":"*","vpcId":"*","cidrBlock":"*","mapPublicIpOnLaunch":false,"ipv6CidrBlock":"*","assignIpv6AddressOnCreation":"*"},{"availabilityZone":"*","vpcId":"*","cidrBlock":"*","mapPublicIpOnLaunch":false,"ipv6CidrBlock":"*","assignIpv6AddressOnCreation":"*"},{}]},"children":{"Subnet":{"id":"Subnet","path":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet1/Subnet","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSubnet","version":"0.0.0"},"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-blue-green-deployment/Vpc/PrivateSubnet1"}],"vpcId":{"Ref":"Vpc8378EB38"}}}},"Acl":{"id":"Acl","path":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet1/Acl","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":[]}},"RouteTable":{"id":"RouteTable","path":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet1/RouteTable","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnRouteTable","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::RouteTable","aws:cdk:cloudformation:props":{"tags":[{"key":"Name","value":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet1"}],"vpcId":{"Ref":"Vpc8378EB38"}}}},"RouteTableAssociation":{"id":"RouteTableAssociation","path":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet1/RouteTableAssociation","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::SubnetRouteTableAssociation","aws:cdk:cloudformation:props":{"routeTableId":{"Ref":"VpcPrivateSubnet1RouteTableB2C5B500"},"subnetId":{"Ref":"VpcPrivateSubnet1Subnet536B997A"}}}},"DefaultRoute":{"id":"DefaultRoute","path":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet1/DefaultRoute","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnRoute","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::Route","aws:cdk:cloudformation:props":{"destinationCidrBlock":"0.0.0.0/0","natGatewayId":{"Ref":"VpcPublicSubnet1NATGateway4D7517AA"},"routeTableId":{"Ref":"VpcPrivateSubnet1RouteTableB2C5B500"}}}}}},"PrivateSubnet2":{"id":"PrivateSubnet2","path":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet2","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.PrivateSubnet","version":"0.0.0","metadata":[{"availabilityZone":"*","vpcId":"*","cidrBlock":"*","mapPublicIpOnLaunch":false,"ipv6CidrBlock":"*","assignIpv6AddressOnCreation":"*"},{"availabilityZone":"*","vpcId":"*","cidrBlock":"*","mapPublicIpOnLaunch":false,"ipv6CidrBlock":"*","assignIpv6AddressOnCreation":"*"},{}]},"children":{"Subnet":{"id":"Subnet","path":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet2/Subnet","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSubnet","version":"0.0.0"},"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-blue-green-deployment/Vpc/PrivateSubnet2"}],"vpcId":{"Ref":"Vpc8378EB38"}}}},"Acl":{"id":"Acl","path":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet2/Acl","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":[]}},"RouteTable":{"id":"RouteTable","path":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet2/RouteTable","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnRouteTable","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::RouteTable","aws:cdk:cloudformation:props":{"tags":[{"key":"Name","value":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet2"}],"vpcId":{"Ref":"Vpc8378EB38"}}}},"RouteTableAssociation":{"id":"RouteTableAssociation","path":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet2/RouteTableAssociation","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::SubnetRouteTableAssociation","aws:cdk:cloudformation:props":{"routeTableId":{"Ref":"VpcPrivateSubnet2RouteTableA678073B"},"subnetId":{"Ref":"VpcPrivateSubnet2Subnet3788AAA1"}}}},"DefaultRoute":{"id":"DefaultRoute","path":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet2/DefaultRoute","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnRoute","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::Route","aws:cdk:cloudformation:props":{"destinationCidrBlock":"0.0.0.0/0","natGatewayId":{"Ref":"VpcPublicSubnet2NATGateway9182C01D"},"routeTableId":{"Ref":"VpcPrivateSubnet2RouteTableA678073B"}}}}}},"IGW":{"id":"IGW","path":"aws-ecs-blue-green-deployment/Vpc/IGW","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnInternetGateway","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::InternetGateway","aws:cdk:cloudformation:props":{"tags":[{"key":"Name","value":"aws-ecs-blue-green-deployment/Vpc"}]}}},"VPCGW":{"id":"VPCGW","path":"aws-ecs-blue-green-deployment/Vpc/VPCGW","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::VPCGatewayAttachment","aws:cdk:cloudformation:props":{"internetGatewayId":{"Ref":"VpcIGWD7BA715C"},"vpcId":{"Ref":"Vpc8378EB38"}}}}}},"FargateCluster":{"id":"FargateCluster","path":"aws-ecs-blue-green-deployment/FargateCluster","constructInfo":{"fqn":"aws-cdk-lib.aws_ecs.Cluster","version":"0.0.0","metadata":[{"vpc":"*","defaultCloudMapNamespace":{"name":"*","useForServiceConnect":true}},{"addDefaultCloudMapNamespace":[{"name":"*","useForServiceConnect":true}]}]},"children":{"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/FargateCluster/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_ecs.CfnCluster","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::ECS::Cluster","aws:cdk:cloudformation:props":{"serviceConnectDefaults":{"namespace":{"Fn::GetAtt":["FargateClusterDefaultServiceDiscoveryNamespace04381E1E","Arn"]}}}}},"DefaultServiceDiscoveryNamespace":{"id":"DefaultServiceDiscoveryNamespace","path":"aws-ecs-blue-green-deployment/FargateCluster/DefaultServiceDiscoveryNamespace","constructInfo":{"fqn":"aws-cdk-lib.aws_servicediscovery.PrivateDnsNamespace","version":"0.0.0","metadata":[{"name":"*","vpc":"*"}]},"children":{"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/FargateCluster/DefaultServiceDiscoveryNamespace/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_servicediscovery.CfnPrivateDnsNamespace","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::ServiceDiscovery::PrivateDnsNamespace","aws:cdk:cloudformation:props":{"name":"bluegreendeployment.com","vpc":{"Ref":"Vpc8378EB38"}}}}}}}},"BlueTG":{"id":"BlueTG","path":"aws-ecs-blue-green-deployment/BlueTG","constructInfo":{"fqn":"aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationTargetGroup","version":"0.0.0"},"children":{"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/BlueTG/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_elasticloadbalancingv2.CfnTargetGroup","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::ElasticLoadBalancingV2::TargetGroup","aws:cdk:cloudformation:props":{"healthCheckPath":"/","matcher":{"httpCode":"200"},"port":80,"protocol":"HTTP","targetGroupAttributes":[{"key":"stickiness.enabled","value":"false"}],"targetType":"ip","vpcId":{"Ref":"Vpc8378EB38"}}}}}},"GreenTG":{"id":"GreenTG","path":"aws-ecs-blue-green-deployment/GreenTG","constructInfo":{"fqn":"aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationTargetGroup","version":"0.0.0"},"children":{"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/GreenTG/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_elasticloadbalancingv2.CfnTargetGroup","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::ElasticLoadBalancingV2::TargetGroup","aws:cdk:cloudformation:props":{"healthCheckPath":"/","matcher":{"httpCode":"200"},"port":80,"protocol":"HTTP","targetGroupAttributes":[{"key":"stickiness.enabled","value":"false"}],"targetType":"ip","vpcId":{"Ref":"Vpc8378EB38"}}}}}},"LBSecurityGroup":{"id":"LBSecurityGroup","path":"aws-ecs-blue-green-deployment/LBSecurityGroup","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.SecurityGroup","version":"0.0.0","metadata":[{"vpc":"*","allowAllOutbound":true},{"addIngressRule":[{"canInlineRule":true,"connections":"*","uniqueId":"*"},{}]},{"addIngressRule":[{"canInlineRule":true,"connections":"*","uniqueId":"*"},{},"*",false]},{"addEgressRule":["*",{},"*",true]}]},"children":{"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/LBSecurityGroup/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSecurityGroup","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::SecurityGroup","aws:cdk:cloudformation:props":{"groupDescription":"aws-ecs-blue-green-deployment/LBSecurityGroup","securityGroupEgress":[{"cidrIp":"0.0.0.0/0","description":"Allow all outbound traffic by default","ipProtocol":"-1"}],"securityGroupIngress":[{"cidrIp":"0.0.0.0/0","ipProtocol":"tcp","fromPort":80,"toPort":80,"description":"from 0.0.0.0/0:80"}],"vpcId":{"Ref":"Vpc8378EB38"}}}}}},"ECSSecurityGroup":{"id":"ECSSecurityGroup","path":"aws-ecs-blue-green-deployment/ECSSecurityGroup","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.SecurityGroup","version":"0.0.0","metadata":[{"vpc":"*","allowAllOutbound":true},{"addIngressRule":["*",{}]},{"addIngressRule":["*",{},"*",false]}]},"children":{"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/ECSSecurityGroup/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSecurityGroup","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::SecurityGroup","aws:cdk:cloudformation:props":{"groupDescription":"aws-ecs-blue-green-deployment/ECSSecurityGroup","securityGroupEgress":[{"cidrIp":"0.0.0.0/0","description":"Allow all outbound traffic by default","ipProtocol":"-1"}],"vpcId":{"Ref":"Vpc8378EB38"}}}},"from awsecsbluegreendeploymentLBSecurityGroup67E4A783:80":{"id":"from awsecsbluegreendeploymentLBSecurityGroup67E4A783:80","path":"aws-ecs-blue-green-deployment/ECSSecurityGroup/from awsecsbluegreendeploymentLBSecurityGroup67E4A783:80","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSecurityGroupIngress","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::SecurityGroupIngress","aws:cdk:cloudformation:props":{"description":"from awsecsbluegreendeploymentLBSecurityGroup67E4A783:80","fromPort":80,"groupId":{"Fn::GetAtt":["ECSSecurityGroupA14DBE7D","GroupId"]},"ipProtocol":"tcp","sourceSecurityGroupId":{"Fn::GetAtt":["LBSecurityGroup4464B654","GroupId"]},"toPort":80}}}}},"ALB":{"id":"ALB","path":"aws-ecs-blue-green-deployment/ALB","constructInfo":{"fqn":"aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationLoadBalancer","version":"0.0.0","metadata":["*","*"]},"children":{"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/ALB/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_elasticloadbalancingv2.CfnLoadBalancer","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::ElasticLoadBalancingV2::LoadBalancer","aws:cdk:cloudformation:props":{"loadBalancerAttributes":[{"key":"deletion_protection.enabled","value":"false"},{"key":"idle_timeout.timeout_seconds","value":"60"}],"scheme":"internet-facing","securityGroups":[{"Fn::GetAtt":["LBSecurityGroup4464B654","GroupId"]}],"subnets":[{"Ref":"VpcPublicSubnet1Subnet5C2D37C4"},{"Ref":"VpcPublicSubnet2Subnet691E08A3"}],"type":"application"}}},"ALBListenerHTTP":{"id":"ALBListenerHTTP","path":"aws-ecs-blue-green-deployment/ALB/ALBListenerHTTP","constructInfo":{"fqn":"aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationListener","version":"0.0.0","metadata":["*","*"]},"children":{"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/ALB/ALBListenerHTTP/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_elasticloadbalancingv2.CfnListener","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::ElasticLoadBalancingV2::Listener","aws:cdk:cloudformation:props":{"defaultActions":[{"type":"fixed-response","fixedResponseConfig":{"statusCode":"404"}}],"loadBalancerArn":{"Ref":"ALBAEE750D2"},"port":80,"protocol":"HTTP"}}}}}}},"ALBProductionListenerRule":{"id":"ALBProductionListenerRule","path":"aws-ecs-blue-green-deployment/ALBProductionListenerRule","constructInfo":{"fqn":"aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationListenerRule","version":"0.0.0"},"children":{"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/ALBProductionListenerRule/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_elasticloadbalancingv2.CfnListenerRule","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::ElasticLoadBalancingV2::ListenerRule","aws:cdk:cloudformation:props":{"actions":[{"type":"forward","forwardConfig":{"targetGroups":[{"targetGroupArn":{"Ref":"BlueTG7C058B2C"},"weight":100},{"targetGroupArn":{"Ref":"GreenTG71A27F2F"},"weight":0}]}}],"conditions":[{"field":"path-pattern","pathPatternConfig":{"values":["/*"]}}],"listenerArn":{"Ref":"ALBALBListenerHTTP413250C3"},"priority":1}}}}},"LambdaHook":{"id":"LambdaHook","path":"aws-ecs-blue-green-deployment/LambdaHook","constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.Function","version":"0.0.0","metadata":[{"handler":"*","runtime":"*","code":"*"}]},"children":{"ServiceRole":{"id":"ServiceRole","path":"aws-ecs-blue-green-deployment/LambdaHook/ServiceRole","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Role","version":"0.0.0","metadata":[{"assumedBy":{"principalAccount":"*","assumeRoleAction":"*"},"managedPolicies":[{"managedPolicyArn":"*"}]}]},"children":{"ImportServiceRole":{"id":"ImportServiceRole","path":"aws-ecs-blue-green-deployment/LambdaHook/ServiceRole/ImportServiceRole","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":["*"]}},"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/LambdaHook/ServiceRole/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnRole","version":"0.0.0"},"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"]]}]}}}}},"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/LambdaHook/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.CfnFunction","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::Lambda::Function","aws:cdk:cloudformation:props":{"code":{"zipFile":"exports.handler = async (event, context) => {\n console.log('Event received:', JSON.stringify(event));\n return { hookStatus: 'SUCCEEDED' }; \n };"},"handler":"index.handler","role":{"Fn::GetAtt":["LambdaHookServiceRole9AAAD33B","Arn"]},"runtime":"nodejs22.x"}}},"LogGroup":{"id":"LogGroup","path":"aws-ecs-blue-green-deployment/LambdaHook/LogGroup","constructInfo":{"fqn":"aws-cdk-lib.aws_logs.LogGroup","version":"0.0.0","metadata":[{"logGroupName":"*"}]},"children":{"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/LambdaHook/LogGroup/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_logs.CfnLogGroup","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::Logs::LogGroup","aws:cdk:cloudformation:props":{"logGroupName":{"Fn::Join":["",["/aws/lambda/",{"Ref":"LambdaHookBF1BC8B4"}]]},"retentionInDays":731}}}}}}},"TaskDef":{"id":"TaskDef","path":"aws-ecs-blue-green-deployment/TaskDef","constructInfo":{"fqn":"aws-cdk-lib.aws_ecs.FargateTaskDefinition","version":"0.0.0","metadata":["*","*","*","*"]},"children":{"TaskRole":{"id":"TaskRole","path":"aws-ecs-blue-green-deployment/TaskDef/TaskRole","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Role","version":"0.0.0","metadata":[{"assumedBy":{"principalAccount":"*","assumeRoleAction":"*"}}]},"children":{"ImportTaskRole":{"id":"ImportTaskRole","path":"aws-ecs-blue-green-deployment/TaskDef/TaskRole/ImportTaskRole","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":["*"]}},"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/TaskDef/TaskRole/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnRole","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Role","aws:cdk:cloudformation:props":{"assumeRolePolicyDocument":{"Statement":[{"Action":"sts:AssumeRole","Effect":"Allow","Principal":{"Service":"ecs-tasks.amazonaws.com"}}],"Version":"2012-10-17"}}}}}},"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/TaskDef/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_ecs.CfnTaskDefinition","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::ECS::TaskDefinition","aws:cdk:cloudformation:props":{"containerDefinitions":[{"essential":true,"image":"public.ecr.aws/nginx/nginx:latest","name":"nginx","portMappings":[{"containerPort":80,"protocol":"tcp","appProtocol":"http","name":"api"}]}],"cpu":"256","family":"awsecsbluegreendeploymentTaskDef51D80572","memory":"512","networkMode":"awsvpc","requiresCompatibilities":["FARGATE"],"taskRoleArn":{"Fn::GetAtt":["TaskDefTaskRole1EDB4A67","Arn"]}}}},"container":{"id":"container","path":"aws-ecs-blue-green-deployment/TaskDef/container","constructInfo":{"fqn":"aws-cdk-lib.aws_ecs.ContainerDefinition","version":"0.0.0"}}}},"Service":{"id":"Service","path":"aws-ecs-blue-green-deployment/Service","constructInfo":{"fqn":"aws-cdk-lib.aws_ecs.FargateService","version":"0.0.0","metadata":["*"]},"children":{"Service":{"id":"Service","path":"aws-ecs-blue-green-deployment/Service/Service","constructInfo":{"fqn":"aws-cdk-lib.aws_ecs.CfnService","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::ECS::Service","aws:cdk:cloudformation:props":{"cluster":{"Ref":"FargateCluster7CCD5F93"},"deploymentConfiguration":{"maximumPercent":200,"minimumHealthyPercent":50,"strategy":"BLUE_GREEN","lifecycleHooks":[{"hookTargetArn":{"Fn::GetAtt":["LambdaHookBF1BC8B4","Arn"]},"roleArn":{"Fn::GetAtt":["ServicePreScaleUpRoleD002A553","Arn"]},"lifecycleStages":["PRE_SCALE_UP"]}]},"enableEcsManagedTags":false,"healthCheckGracePeriodSeconds":60,"launchType":"FARGATE","loadBalancers":[{"targetGroupArn":{"Ref":"BlueTG7C058B2C"},"containerName":"nginx","containerPort":80,"advancedConfiguration":{"alternateTargetGroupArn":{"Ref":"GreenTG71A27F2F"},"roleArn":{"Fn::GetAtt":["ServiceLBAlternateOptionsRole06C91D94","Arn"]},"productionListenerRule":{"Ref":"ALBProductionListenerRule243D0687"}}}],"networkConfiguration":{"awsvpcConfiguration":{"assignPublicIp":"DISABLED","subnets":[{"Ref":"VpcPrivateSubnet1Subnet536B997A"},{"Ref":"VpcPrivateSubnet2Subnet3788AAA1"}],"securityGroups":[{"Fn::GetAtt":["ECSSecurityGroupA14DBE7D","GroupId"]}]}},"taskDefinition":{"Ref":"TaskDef54694570"}}}},"LBAlternateOptionsRole":{"id":"LBAlternateOptionsRole","path":"aws-ecs-blue-green-deployment/Service/LBAlternateOptionsRole","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Role","version":"0.0.0","metadata":[{"assumedBy":{"principalAccount":"*","assumeRoleAction":"*"},"managedPolicies":[{"managedPolicyArn":"*"}]}]},"children":{"ImportLBAlternateOptionsRole":{"id":"ImportLBAlternateOptionsRole","path":"aws-ecs-blue-green-deployment/Service/LBAlternateOptionsRole/ImportLBAlternateOptionsRole","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":["*"]}},"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/Service/LBAlternateOptionsRole/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnRole","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Role","aws:cdk:cloudformation:props":{"assumeRolePolicyDocument":{"Statement":[{"Action":"sts:AssumeRole","Effect":"Allow","Principal":{"Service":"ecs.amazonaws.com"}}],"Version":"2012-10-17"},"managedPolicyArns":[{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":iam::aws:policy/AmazonECSInfrastructureRolePolicyForLoadBalancers"]]}]}}}}},"PreScaleUpRole":{"id":"PreScaleUpRole","path":"aws-ecs-blue-green-deployment/Service/PreScaleUpRole","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Role","version":"0.0.0","metadata":[{"assumedBy":{"principalAccount":"*","assumeRoleAction":"*"}},{"addToPrincipalPolicy":[{}]},{"attachInlinePolicy":["*"]},{"attachInlinePolicy":["*"]}]},"children":{"ImportPreScaleUpRole":{"id":"ImportPreScaleUpRole","path":"aws-ecs-blue-green-deployment/Service/PreScaleUpRole/ImportPreScaleUpRole","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":["*"]}},"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/Service/PreScaleUpRole/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnRole","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Role","aws:cdk:cloudformation:props":{"assumeRolePolicyDocument":{"Statement":[{"Action":"sts:AssumeRole","Effect":"Allow","Principal":{"Service":"ecs.amazonaws.com"}}],"Version":"2012-10-17"}}}},"DefaultPolicy":{"id":"DefaultPolicy","path":"aws-ecs-blue-green-deployment/Service/PreScaleUpRole/DefaultPolicy","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Policy","version":"0.0.0","metadata":["*",{"attachToRole":["*"]},{"attachToRole":["*"]},{"addStatements":[{}]}]},"children":{"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/Service/PreScaleUpRole/DefaultPolicy/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnPolicy","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Policy","aws:cdk:cloudformation:props":{"policyDocument":{"Statement":[{"Action":"lambda:InvokeFunction","Effect":"Allow","Resource":[{"Fn::GetAtt":["LambdaHookBF1BC8B4","Arn"]},{"Fn::Join":["",[{"Fn::GetAtt":["LambdaHookBF1BC8B4","Arn"]},":*"]]}]}],"Version":"2012-10-17"},"policyName":"ServicePreScaleUpRoleDefaultPolicyF1032E86","roles":[{"Ref":"ServicePreScaleUpRoleD002A553"}]}}}}}}}}},"BootstrapVersion":{"id":"BootstrapVersion","path":"aws-ecs-blue-green-deployment/BootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnParameter","version":"0.0.0"}},"CheckBootstrapVersion":{"id":"CheckBootstrapVersion","path":"aws-ecs-blue-green-deployment/CheckBootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnRule","version":"0.0.0"}}}},"aws-ecs-blue-green":{"id":"aws-ecs-blue-green","path":"aws-ecs-blue-green","constructInfo":{"fqn":"@aws-cdk/integ-tests-alpha.IntegTest","version":"0.0.0"},"children":{"DefaultTest":{"id":"DefaultTest","path":"aws-ecs-blue-green/DefaultTest","constructInfo":{"fqn":"@aws-cdk/integ-tests-alpha.IntegTestCase","version":"0.0.0"},"children":{"Default":{"id":"Default","path":"aws-ecs-blue-green/DefaultTest/Default","constructInfo":{"fqn":"constructs.Construct","version":"10.4.2"}},"DeployAssert":{"id":"DeployAssert","path":"aws-ecs-blue-green/DefaultTest/DeployAssert","constructInfo":{"fqn":"aws-cdk-lib.Stack","version":"0.0.0"},"children":{"BootstrapVersion":{"id":"BootstrapVersion","path":"aws-ecs-blue-green/DefaultTest/DeployAssert/BootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnParameter","version":"0.0.0"}},"CheckBootstrapVersion":{"id":"CheckBootstrapVersion","path":"aws-ecs-blue-green/DefaultTest/DeployAssert/CheckBootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnRule","version":"0.0.0"}}}}}}}},"Tree":{"id":"Tree","path":"Tree","constructInfo":{"fqn":"constructs.Construct","version":"10.4.2"}}}}} \ No newline at end of file +{"version":"tree-0.1","tree":{"id":"App","path":"","constructInfo":{"fqn":"aws-cdk-lib.App","version":"0.0.0"},"children":{"aws-ecs-blue-green-deployment":{"id":"aws-ecs-blue-green-deployment","path":"aws-ecs-blue-green-deployment","constructInfo":{"fqn":"aws-cdk-lib.Stack","version":"0.0.0"},"children":{"Vpc":{"id":"Vpc","path":"aws-ecs-blue-green-deployment/Vpc","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.Vpc","version":"0.0.0","metadata":[{"maxAzs":"*","restrictDefaultSecurityGroup":false}]},"children":{"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/Vpc/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnVPC","version":"0.0.0"},"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-blue-green-deployment/Vpc"}]}}},"PublicSubnet1":{"id":"PublicSubnet1","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet1","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.PublicSubnet","version":"0.0.0","metadata":[{"availabilityZone":"*","vpcId":"*","cidrBlock":"*","mapPublicIpOnLaunch":true,"ipv6CidrBlock":"*","assignIpv6AddressOnCreation":"*"},{"availabilityZone":"*","vpcId":"*","cidrBlock":"*","mapPublicIpOnLaunch":true,"ipv6CidrBlock":"*","assignIpv6AddressOnCreation":"*"},{},{"addNatGateway":["*"]}]},"children":{"Subnet":{"id":"Subnet","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet1/Subnet","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSubnet","version":"0.0.0"},"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-blue-green-deployment/Vpc/PublicSubnet1"}],"vpcId":{"Ref":"Vpc8378EB38"}}}},"Acl":{"id":"Acl","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet1/Acl","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":[]}},"RouteTable":{"id":"RouteTable","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet1/RouteTable","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnRouteTable","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::RouteTable","aws:cdk:cloudformation:props":{"tags":[{"key":"Name","value":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet1"}],"vpcId":{"Ref":"Vpc8378EB38"}}}},"RouteTableAssociation":{"id":"RouteTableAssociation","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet1/RouteTableAssociation","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::SubnetRouteTableAssociation","aws:cdk:cloudformation:props":{"routeTableId":{"Ref":"VpcPublicSubnet1RouteTable6C95E38E"},"subnetId":{"Ref":"VpcPublicSubnet1Subnet5C2D37C4"}}}},"DefaultRoute":{"id":"DefaultRoute","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet1/DefaultRoute","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnRoute","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::Route","aws:cdk:cloudformation:props":{"destinationCidrBlock":"0.0.0.0/0","gatewayId":{"Ref":"VpcIGWD7BA715C"},"routeTableId":{"Ref":"VpcPublicSubnet1RouteTable6C95E38E"}}}},"EIP":{"id":"EIP","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet1/EIP","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnEIP","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::EIP","aws:cdk:cloudformation:props":{"domain":"vpc","tags":[{"key":"Name","value":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet1"}]}}},"NATGateway":{"id":"NATGateway","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet1/NATGateway","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnNatGateway","version":"0.0.0"},"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-blue-green-deployment/Vpc/PublicSubnet1"}]}}}}},"PublicSubnet2":{"id":"PublicSubnet2","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet2","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.PublicSubnet","version":"0.0.0","metadata":[{"availabilityZone":"*","vpcId":"*","cidrBlock":"*","mapPublicIpOnLaunch":true,"ipv6CidrBlock":"*","assignIpv6AddressOnCreation":"*"},{"availabilityZone":"*","vpcId":"*","cidrBlock":"*","mapPublicIpOnLaunch":true,"ipv6CidrBlock":"*","assignIpv6AddressOnCreation":"*"},{},{"addNatGateway":["*"]}]},"children":{"Subnet":{"id":"Subnet","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet2/Subnet","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSubnet","version":"0.0.0"},"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-blue-green-deployment/Vpc/PublicSubnet2"}],"vpcId":{"Ref":"Vpc8378EB38"}}}},"Acl":{"id":"Acl","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet2/Acl","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":[]}},"RouteTable":{"id":"RouteTable","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet2/RouteTable","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnRouteTable","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::RouteTable","aws:cdk:cloudformation:props":{"tags":[{"key":"Name","value":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet2"}],"vpcId":{"Ref":"Vpc8378EB38"}}}},"RouteTableAssociation":{"id":"RouteTableAssociation","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet2/RouteTableAssociation","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::SubnetRouteTableAssociation","aws:cdk:cloudformation:props":{"routeTableId":{"Ref":"VpcPublicSubnet2RouteTable94F7E489"},"subnetId":{"Ref":"VpcPublicSubnet2Subnet691E08A3"}}}},"DefaultRoute":{"id":"DefaultRoute","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet2/DefaultRoute","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnRoute","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::Route","aws:cdk:cloudformation:props":{"destinationCidrBlock":"0.0.0.0/0","gatewayId":{"Ref":"VpcIGWD7BA715C"},"routeTableId":{"Ref":"VpcPublicSubnet2RouteTable94F7E489"}}}},"EIP":{"id":"EIP","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet2/EIP","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnEIP","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::EIP","aws:cdk:cloudformation:props":{"domain":"vpc","tags":[{"key":"Name","value":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet2"}]}}},"NATGateway":{"id":"NATGateway","path":"aws-ecs-blue-green-deployment/Vpc/PublicSubnet2/NATGateway","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnNatGateway","version":"0.0.0"},"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-blue-green-deployment/Vpc/PublicSubnet2"}]}}}}},"PrivateSubnet1":{"id":"PrivateSubnet1","path":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet1","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.PrivateSubnet","version":"0.0.0","metadata":[{"availabilityZone":"*","vpcId":"*","cidrBlock":"*","mapPublicIpOnLaunch":false,"ipv6CidrBlock":"*","assignIpv6AddressOnCreation":"*"},{"availabilityZone":"*","vpcId":"*","cidrBlock":"*","mapPublicIpOnLaunch":false,"ipv6CidrBlock":"*","assignIpv6AddressOnCreation":"*"},{}]},"children":{"Subnet":{"id":"Subnet","path":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet1/Subnet","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSubnet","version":"0.0.0"},"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-blue-green-deployment/Vpc/PrivateSubnet1"}],"vpcId":{"Ref":"Vpc8378EB38"}}}},"Acl":{"id":"Acl","path":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet1/Acl","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":[]}},"RouteTable":{"id":"RouteTable","path":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet1/RouteTable","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnRouteTable","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::RouteTable","aws:cdk:cloudformation:props":{"tags":[{"key":"Name","value":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet1"}],"vpcId":{"Ref":"Vpc8378EB38"}}}},"RouteTableAssociation":{"id":"RouteTableAssociation","path":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet1/RouteTableAssociation","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::SubnetRouteTableAssociation","aws:cdk:cloudformation:props":{"routeTableId":{"Ref":"VpcPrivateSubnet1RouteTableB2C5B500"},"subnetId":{"Ref":"VpcPrivateSubnet1Subnet536B997A"}}}},"DefaultRoute":{"id":"DefaultRoute","path":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet1/DefaultRoute","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnRoute","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::Route","aws:cdk:cloudformation:props":{"destinationCidrBlock":"0.0.0.0/0","natGatewayId":{"Ref":"VpcPublicSubnet1NATGateway4D7517AA"},"routeTableId":{"Ref":"VpcPrivateSubnet1RouteTableB2C5B500"}}}}}},"PrivateSubnet2":{"id":"PrivateSubnet2","path":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet2","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.PrivateSubnet","version":"0.0.0","metadata":[{"availabilityZone":"*","vpcId":"*","cidrBlock":"*","mapPublicIpOnLaunch":false,"ipv6CidrBlock":"*","assignIpv6AddressOnCreation":"*"},{"availabilityZone":"*","vpcId":"*","cidrBlock":"*","mapPublicIpOnLaunch":false,"ipv6CidrBlock":"*","assignIpv6AddressOnCreation":"*"},{}]},"children":{"Subnet":{"id":"Subnet","path":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet2/Subnet","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSubnet","version":"0.0.0"},"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-blue-green-deployment/Vpc/PrivateSubnet2"}],"vpcId":{"Ref":"Vpc8378EB38"}}}},"Acl":{"id":"Acl","path":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet2/Acl","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":[]}},"RouteTable":{"id":"RouteTable","path":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet2/RouteTable","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnRouteTable","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::RouteTable","aws:cdk:cloudformation:props":{"tags":[{"key":"Name","value":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet2"}],"vpcId":{"Ref":"Vpc8378EB38"}}}},"RouteTableAssociation":{"id":"RouteTableAssociation","path":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet2/RouteTableAssociation","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSubnetRouteTableAssociation","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::SubnetRouteTableAssociation","aws:cdk:cloudformation:props":{"routeTableId":{"Ref":"VpcPrivateSubnet2RouteTableA678073B"},"subnetId":{"Ref":"VpcPrivateSubnet2Subnet3788AAA1"}}}},"DefaultRoute":{"id":"DefaultRoute","path":"aws-ecs-blue-green-deployment/Vpc/PrivateSubnet2/DefaultRoute","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnRoute","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::Route","aws:cdk:cloudformation:props":{"destinationCidrBlock":"0.0.0.0/0","natGatewayId":{"Ref":"VpcPublicSubnet2NATGateway9182C01D"},"routeTableId":{"Ref":"VpcPrivateSubnet2RouteTableA678073B"}}}}}},"IGW":{"id":"IGW","path":"aws-ecs-blue-green-deployment/Vpc/IGW","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnInternetGateway","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::InternetGateway","aws:cdk:cloudformation:props":{"tags":[{"key":"Name","value":"aws-ecs-blue-green-deployment/Vpc"}]}}},"VPCGW":{"id":"VPCGW","path":"aws-ecs-blue-green-deployment/Vpc/VPCGW","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnVPCGatewayAttachment","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::VPCGatewayAttachment","aws:cdk:cloudformation:props":{"internetGatewayId":{"Ref":"VpcIGWD7BA715C"},"vpcId":{"Ref":"Vpc8378EB38"}}}}}},"FargateCluster":{"id":"FargateCluster","path":"aws-ecs-blue-green-deployment/FargateCluster","constructInfo":{"fqn":"aws-cdk-lib.aws_ecs.Cluster","version":"0.0.0","metadata":[{"vpc":"*","defaultCloudMapNamespace":{"name":"*","useForServiceConnect":true}},{"addDefaultCloudMapNamespace":[{"name":"*","useForServiceConnect":true}]}]},"children":{"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/FargateCluster/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_ecs.CfnCluster","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::ECS::Cluster","aws:cdk:cloudformation:props":{"serviceConnectDefaults":{"namespace":{"Fn::GetAtt":["FargateClusterDefaultServiceDiscoveryNamespace04381E1E","Arn"]}}}}},"DefaultServiceDiscoveryNamespace":{"id":"DefaultServiceDiscoveryNamespace","path":"aws-ecs-blue-green-deployment/FargateCluster/DefaultServiceDiscoveryNamespace","constructInfo":{"fqn":"aws-cdk-lib.aws_servicediscovery.PrivateDnsNamespace","version":"0.0.0","metadata":[{"name":"*","vpc":"*"}]},"children":{"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/FargateCluster/DefaultServiceDiscoveryNamespace/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_servicediscovery.CfnPrivateDnsNamespace","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::ServiceDiscovery::PrivateDnsNamespace","aws:cdk:cloudformation:props":{"name":"bluegreendeployment.com","vpc":{"Ref":"Vpc8378EB38"}}}}}}}},"BlueTG":{"id":"BlueTG","path":"aws-ecs-blue-green-deployment/BlueTG","constructInfo":{"fqn":"aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationTargetGroup","version":"0.0.0"},"children":{"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/BlueTG/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_elasticloadbalancingv2.CfnTargetGroup","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::ElasticLoadBalancingV2::TargetGroup","aws:cdk:cloudformation:props":{"healthCheckPath":"/","matcher":{"httpCode":"200"},"port":80,"protocol":"HTTP","targetGroupAttributes":[{"key":"stickiness.enabled","value":"false"}],"targetType":"ip","vpcId":{"Ref":"Vpc8378EB38"}}}}}},"GreenTG":{"id":"GreenTG","path":"aws-ecs-blue-green-deployment/GreenTG","constructInfo":{"fqn":"aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationTargetGroup","version":"0.0.0"},"children":{"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/GreenTG/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_elasticloadbalancingv2.CfnTargetGroup","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::ElasticLoadBalancingV2::TargetGroup","aws:cdk:cloudformation:props":{"healthCheckPath":"/","matcher":{"httpCode":"200"},"port":80,"protocol":"HTTP","targetGroupAttributes":[{"key":"stickiness.enabled","value":"false"}],"targetType":"ip","vpcId":{"Ref":"Vpc8378EB38"}}}}}},"LBSecurityGroup":{"id":"LBSecurityGroup","path":"aws-ecs-blue-green-deployment/LBSecurityGroup","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.SecurityGroup","version":"0.0.0","metadata":[{"vpc":"*","allowAllOutbound":true},{"addIngressRule":[{"canInlineRule":true,"connections":"*","uniqueId":"*"},{}]},{"addIngressRule":[{"canInlineRule":true,"connections":"*","uniqueId":"*"},{},"*",false]},{"addEgressRule":["*",{},"*",true]}]},"children":{"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/LBSecurityGroup/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSecurityGroup","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::SecurityGroup","aws:cdk:cloudformation:props":{"groupDescription":"aws-ecs-blue-green-deployment/LBSecurityGroup","securityGroupEgress":[{"cidrIp":"0.0.0.0/0","description":"Allow all outbound traffic by default","ipProtocol":"-1"}],"securityGroupIngress":[{"cidrIp":"0.0.0.0/0","ipProtocol":"tcp","fromPort":80,"toPort":80,"description":"from 0.0.0.0/0:80"}],"vpcId":{"Ref":"Vpc8378EB38"}}}}}},"ECSSecurityGroup":{"id":"ECSSecurityGroup","path":"aws-ecs-blue-green-deployment/ECSSecurityGroup","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.SecurityGroup","version":"0.0.0","metadata":[{"vpc":"*","allowAllOutbound":true},{"addIngressRule":["*",{}]},{"addIngressRule":["*",{},"*",false]}]},"children":{"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/ECSSecurityGroup/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSecurityGroup","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::SecurityGroup","aws:cdk:cloudformation:props":{"groupDescription":"aws-ecs-blue-green-deployment/ECSSecurityGroup","securityGroupEgress":[{"cidrIp":"0.0.0.0/0","description":"Allow all outbound traffic by default","ipProtocol":"-1"}],"vpcId":{"Ref":"Vpc8378EB38"}}}},"from awsecsbluegreendeploymentLBSecurityGroup67E4A783:80":{"id":"from awsecsbluegreendeploymentLBSecurityGroup67E4A783:80","path":"aws-ecs-blue-green-deployment/ECSSecurityGroup/from awsecsbluegreendeploymentLBSecurityGroup67E4A783:80","constructInfo":{"fqn":"aws-cdk-lib.aws_ec2.CfnSecurityGroupIngress","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::EC2::SecurityGroupIngress","aws:cdk:cloudformation:props":{"description":"from awsecsbluegreendeploymentLBSecurityGroup67E4A783:80","fromPort":80,"groupId":{"Fn::GetAtt":["ECSSecurityGroupA14DBE7D","GroupId"]},"ipProtocol":"tcp","sourceSecurityGroupId":{"Fn::GetAtt":["LBSecurityGroup4464B654","GroupId"]},"toPort":80}}}}},"ALB":{"id":"ALB","path":"aws-ecs-blue-green-deployment/ALB","constructInfo":{"fqn":"aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationLoadBalancer","version":"0.0.0","metadata":["*","*"]},"children":{"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/ALB/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_elasticloadbalancingv2.CfnLoadBalancer","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::ElasticLoadBalancingV2::LoadBalancer","aws:cdk:cloudformation:props":{"loadBalancerAttributes":[{"key":"deletion_protection.enabled","value":"false"},{"key":"idle_timeout.timeout_seconds","value":"60"}],"scheme":"internet-facing","securityGroups":[{"Fn::GetAtt":["LBSecurityGroup4464B654","GroupId"]}],"subnets":[{"Ref":"VpcPublicSubnet1Subnet5C2D37C4"},{"Ref":"VpcPublicSubnet2Subnet691E08A3"}],"type":"application"}}},"ALBListenerHTTP":{"id":"ALBListenerHTTP","path":"aws-ecs-blue-green-deployment/ALB/ALBListenerHTTP","constructInfo":{"fqn":"aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationListener","version":"0.0.0","metadata":["*","*"]},"children":{"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/ALB/ALBListenerHTTP/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_elasticloadbalancingv2.CfnListener","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::ElasticLoadBalancingV2::Listener","aws:cdk:cloudformation:props":{"defaultActions":[{"type":"fixed-response","fixedResponseConfig":{"statusCode":"404"}}],"loadBalancerArn":{"Ref":"ALBAEE750D2"},"port":80,"protocol":"HTTP"}}}}}}},"ALBProductionListenerRule":{"id":"ALBProductionListenerRule","path":"aws-ecs-blue-green-deployment/ALBProductionListenerRule","constructInfo":{"fqn":"aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationListenerRule","version":"0.0.0"},"children":{"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/ALBProductionListenerRule/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_elasticloadbalancingv2.CfnListenerRule","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::ElasticLoadBalancingV2::ListenerRule","aws:cdk:cloudformation:props":{"actions":[{"type":"forward","forwardConfig":{"targetGroups":[{"targetGroupArn":{"Ref":"BlueTG7C058B2C"},"weight":100},{"targetGroupArn":{"Ref":"GreenTG71A27F2F"},"weight":0}]}}],"conditions":[{"field":"path-pattern","pathPatternConfig":{"values":["/*"]}}],"listenerArn":{"Ref":"ALBALBListenerHTTP413250C3"},"priority":1}}}}},"LambdaHook":{"id":"LambdaHook","path":"aws-ecs-blue-green-deployment/LambdaHook","constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.Function","version":"0.0.0","metadata":[{"handler":"*","runtime":"*","code":"*"}]},"children":{"ServiceRole":{"id":"ServiceRole","path":"aws-ecs-blue-green-deployment/LambdaHook/ServiceRole","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Role","version":"0.0.0","metadata":[]},"children":{"ImportServiceRole":{"id":"ImportServiceRole","path":"aws-ecs-blue-green-deployment/LambdaHook/ServiceRole/ImportServiceRole","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":["*"]}},"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/LambdaHook/ServiceRole/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnRole","version":"0.0.0"},"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"]]}]}}}}},"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/LambdaHook/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_lambda.CfnFunction","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::Lambda::Function","aws:cdk:cloudformation:props":{"code":{"zipFile":"exports.handler = async (event, context) => {\n console.log('Event received:', JSON.stringify(event));\n return { hookStatus: 'SUCCEEDED' }; \n };"},"handler":"index.handler","role":{"Fn::GetAtt":["LambdaHookServiceRole9AAAD33B","Arn"]},"runtime":"nodejs22.x"}}},"LogGroup":{"id":"LogGroup","path":"aws-ecs-blue-green-deployment/LambdaHook/LogGroup","constructInfo":{"fqn":"aws-cdk-lib.aws_logs.LogGroup","version":"0.0.0","metadata":[{"logGroupName":"*"}]},"children":{"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/LambdaHook/LogGroup/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_logs.CfnLogGroup","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::Logs::LogGroup","aws:cdk:cloudformation:props":{"logGroupName":{"Fn::Join":["",["/aws/lambda/",{"Ref":"LambdaHookBF1BC8B4"}]]},"retentionInDays":731}}}}}}},"TaskDef":{"id":"TaskDef","path":"aws-ecs-blue-green-deployment/TaskDef","constructInfo":{"fqn":"aws-cdk-lib.aws_ecs.FargateTaskDefinition","version":"0.0.0","metadata":["*","*","*","*"]},"children":{"TaskRole":{"id":"TaskRole","path":"aws-ecs-blue-green-deployment/TaskDef/TaskRole","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Role","version":"0.0.0","metadata":[{"assumedBy":{"principalAccount":"*","assumeRoleAction":"*"}}]},"children":{"ImportTaskRole":{"id":"ImportTaskRole","path":"aws-ecs-blue-green-deployment/TaskDef/TaskRole/ImportTaskRole","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":["*"]}},"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/TaskDef/TaskRole/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnRole","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Role","aws:cdk:cloudformation:props":{"assumeRolePolicyDocument":{"Statement":[{"Action":"sts:AssumeRole","Effect":"Allow","Principal":{"Service":"ecs-tasks.amazonaws.com"}}],"Version":"2012-10-17"}}}}}},"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/TaskDef/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_ecs.CfnTaskDefinition","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::ECS::TaskDefinition","aws:cdk:cloudformation:props":{"containerDefinitions":[{"essential":true,"image":"public.ecr.aws/nginx/nginx:latest","name":"nginx","portMappings":[{"containerPort":80,"protocol":"tcp","appProtocol":"http","name":"api"}]}],"cpu":"256","family":"awsecsbluegreendeploymentTaskDef51D80572","memory":"512","networkMode":"awsvpc","requiresCompatibilities":["FARGATE"],"taskRoleArn":{"Fn::GetAtt":["TaskDefTaskRole1EDB4A67","Arn"]}}}},"container":{"id":"container","path":"aws-ecs-blue-green-deployment/TaskDef/container","constructInfo":{"fqn":"aws-cdk-lib.aws_ecs.ContainerDefinition","version":"0.0.0"}}}},"Service":{"id":"Service","path":"aws-ecs-blue-green-deployment/Service","constructInfo":{"fqn":"aws-cdk-lib.aws_ecs.FargateService","version":"0.0.0","metadata":["*"]},"children":{"Service":{"id":"Service","path":"aws-ecs-blue-green-deployment/Service/Service","constructInfo":{"fqn":"aws-cdk-lib.aws_ecs.CfnService","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::ECS::Service","aws:cdk:cloudformation:props":{"cluster":{"Ref":"FargateCluster7CCD5F93"},"deploymentConfiguration":{"maximumPercent":200,"minimumHealthyPercent":50,"alarms":{"enable":true,"alarmNames":[{"Ref":"MyCustomAlarmBBB0BEE1"},{"Ref":"AnotherCustomAlarm221DEB18"}],"rollback":true},"strategy":"BLUE_GREEN","lifecycleHooks":[{"hookTargetArn":{"Fn::GetAtt":["LambdaHookBF1BC8B4","Arn"]},"roleArn":{"Fn::GetAtt":["ServicePreScaleUpRoleD002A553","Arn"]},"lifecycleStages":["PRE_SCALE_UP"]}]},"enableEcsManagedTags":false,"healthCheckGracePeriodSeconds":60,"launchType":"FARGATE","loadBalancers":[{"targetGroupArn":{"Ref":"BlueTG7C058B2C"},"containerName":"nginx","containerPort":80,"advancedConfiguration":{"alternateTargetGroupArn":{"Ref":"GreenTG71A27F2F"},"roleArn":{"Fn::GetAtt":["ServiceLBAlternateOptionsRole06C91D94","Arn"]},"productionListenerRule":{"Ref":"ALBProductionListenerRule243D0687"}}}],"networkConfiguration":{"awsvpcConfiguration":{"assignPublicIp":"DISABLED","subnets":[{"Ref":"VpcPrivateSubnet1Subnet536B997A"},{"Ref":"VpcPrivateSubnet2Subnet3788AAA1"}],"securityGroups":[{"Fn::GetAtt":["ECSSecurityGroupA14DBE7D","GroupId"]}]}},"taskDefinition":{"Ref":"TaskDef54694570"}}}},"LBAlternateOptionsRole":{"id":"LBAlternateOptionsRole","path":"aws-ecs-blue-green-deployment/Service/LBAlternateOptionsRole","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Role","version":"0.0.0","metadata":[]},"children":{"ImportLBAlternateOptionsRole":{"id":"ImportLBAlternateOptionsRole","path":"aws-ecs-blue-green-deployment/Service/LBAlternateOptionsRole/ImportLBAlternateOptionsRole","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":["*"]}},"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/Service/LBAlternateOptionsRole/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnRole","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Role","aws:cdk:cloudformation:props":{"assumeRolePolicyDocument":{"Statement":[{"Action":"sts:AssumeRole","Effect":"Allow","Principal":{"Service":"ecs.amazonaws.com"}}],"Version":"2012-10-17"},"managedPolicyArns":[{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":iam::aws:policy/AmazonECSInfrastructureRolePolicyForLoadBalancers"]]}]}}}}},"PreScaleUpRole":{"id":"PreScaleUpRole","path":"aws-ecs-blue-green-deployment/Service/PreScaleUpRole","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Role","version":"0.0.0","metadata":[{"assumedBy":{"principalAccount":"*","assumeRoleAction":"*"}},{"addToPrincipalPolicy":[{}]},{"attachInlinePolicy":["*"]},{"attachInlinePolicy":["*"]}]},"children":{"ImportPreScaleUpRole":{"id":"ImportPreScaleUpRole","path":"aws-ecs-blue-green-deployment/Service/PreScaleUpRole/ImportPreScaleUpRole","constructInfo":{"fqn":"aws-cdk-lib.Resource","version":"0.0.0","metadata":["*"]}},"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/Service/PreScaleUpRole/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnRole","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Role","aws:cdk:cloudformation:props":{"assumeRolePolicyDocument":{"Statement":[{"Action":"sts:AssumeRole","Effect":"Allow","Principal":{"Service":"ecs.amazonaws.com"}}],"Version":"2012-10-17"}}}},"DefaultPolicy":{"id":"DefaultPolicy","path":"aws-ecs-blue-green-deployment/Service/PreScaleUpRole/DefaultPolicy","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.Policy","version":"0.0.0","metadata":["*",{"attachToRole":["*"]},{"attachToRole":["*"]},{"addStatements":[{}]}]},"children":{"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/Service/PreScaleUpRole/DefaultPolicy/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_iam.CfnPolicy","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::IAM::Policy","aws:cdk:cloudformation:props":{"policyDocument":{"Statement":[{"Action":"lambda:InvokeFunction","Effect":"Allow","Resource":[{"Fn::GetAtt":["LambdaHookBF1BC8B4","Arn"]},{"Fn::Join":["",[{"Fn::GetAtt":["LambdaHookBF1BC8B4","Arn"]},":*"]]}]}],"Version":"2012-10-17"},"policyName":"ServicePreScaleUpRoleDefaultPolicyF1032E86","roles":[{"Ref":"ServicePreScaleUpRoleD002A553"}]}}}}}}}}},"MyCustomAlarm":{"id":"MyCustomAlarm","path":"aws-ecs-blue-green-deployment/MyCustomAlarm","constructInfo":{"fqn":"aws-cdk-lib.aws_cloudwatch.Alarm","version":"0.0.0","metadata":[{"metric":{"warnings":"*","warningsV2":"*"},"threshold":"*","evaluationPeriods":"*"}]},"children":{"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/MyCustomAlarm/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_cloudwatch.CfnAlarm","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::CloudWatch::Alarm","aws:cdk:cloudformation:props":{"comparisonOperator":"GreaterThanOrEqualToThreshold","evaluationPeriods":2,"metricName":"MyCustomMetric","namespace":"Custom","period":300,"statistic":"Average","threshold":80}}}}},"AnotherCustomAlarm":{"id":"AnotherCustomAlarm","path":"aws-ecs-blue-green-deployment/AnotherCustomAlarm","constructInfo":{"fqn":"aws-cdk-lib.aws_cloudwatch.Alarm","version":"0.0.0","metadata":[{"metric":{"warnings":"*","warningsV2":"*"},"threshold":"*","evaluationPeriods":"*"}]},"children":{"Resource":{"id":"Resource","path":"aws-ecs-blue-green-deployment/AnotherCustomAlarm/Resource","constructInfo":{"fqn":"aws-cdk-lib.aws_cloudwatch.CfnAlarm","version":"0.0.0"},"attributes":{"aws:cdk:cloudformation:type":"AWS::CloudWatch::Alarm","aws:cdk:cloudformation:props":{"comparisonOperator":"GreaterThanOrEqualToThreshold","evaluationPeriods":2,"metricName":"AnotherCustomMetric","namespace":"Custom","period":300,"statistic":"Average","threshold":80}}}}},"BootstrapVersion":{"id":"BootstrapVersion","path":"aws-ecs-blue-green-deployment/BootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnParameter","version":"0.0.0"}},"CheckBootstrapVersion":{"id":"CheckBootstrapVersion","path":"aws-ecs-blue-green-deployment/CheckBootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnRule","version":"0.0.0"}}}},"aws-ecs-blue-green":{"id":"aws-ecs-blue-green","path":"aws-ecs-blue-green","constructInfo":{"fqn":"@aws-cdk/integ-tests-alpha.IntegTest","version":"0.0.0"},"children":{"DefaultTest":{"id":"DefaultTest","path":"aws-ecs-blue-green/DefaultTest","constructInfo":{"fqn":"@aws-cdk/integ-tests-alpha.IntegTestCase","version":"0.0.0"},"children":{"Default":{"id":"Default","path":"aws-ecs-blue-green/DefaultTest/Default","constructInfo":{"fqn":"constructs.Construct","version":"10.4.3"}},"DeployAssert":{"id":"DeployAssert","path":"aws-ecs-blue-green/DefaultTest/DeployAssert","constructInfo":{"fqn":"aws-cdk-lib.Stack","version":"0.0.0"},"children":{"BootstrapVersion":{"id":"BootstrapVersion","path":"aws-ecs-blue-green/DefaultTest/DeployAssert/BootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnParameter","version":"0.0.0"}},"CheckBootstrapVersion":{"id":"CheckBootstrapVersion","path":"aws-ecs-blue-green/DefaultTest/DeployAssert/CheckBootstrapVersion","constructInfo":{"fqn":"aws-cdk-lib.CfnRule","version":"0.0.0"}}}}}}}},"Tree":{"id":"Tree","path":"Tree","constructInfo":{"fqn":"constructs.Construct","version":"10.4.3"}}}}} \ No newline at end of file diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.ts index c9888ee7d1c00..de071fdd7ba82 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.ts @@ -1,3 +1,4 @@ +import * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch'; import * as ec2 from 'aws-cdk-lib/aws-ec2'; import * as elbv2 from 'aws-cdk-lib/aws-elasticloadbalancingv2'; import * as lambda from 'aws-cdk-lib/aws-lambda'; @@ -123,6 +124,29 @@ const service = new ecs.FargateService(stack, 'Service', { deploymentStrategy: ecs.DeploymentStrategy.BLUE_GREEN, }); +// Create deployment alarm for CPU utilization +const alarm1 = new cloudwatch.Alarm(stack, 'MyCustomAlarm', { + metric: new cloudwatch.Metric({ + namespace: 'Custom', + metricName: 'MyCustomMetric', + }), + threshold: 80, + evaluationPeriods: 2, +}); + +// Create deployment alarm for memory utilization +const alarm2 = new cloudwatch.Alarm(stack, 'AnotherCustomAlarm', { + metric: new cloudwatch.Metric({ + namespace: 'Custom', + metricName: 'AnotherCustomMetric', + }), + threshold: 80, + evaluationPeriods: 2, +}); + +// Enable deployment alarms +service.enableDeploymentAlarms([alarm1.alarmName, alarm2.alarmName]); + service.addLifecycleHook(new ecs.DeploymentLifecycleLambdaTarget(lambdaHook, 'PreScaleUp', { lifecycleStages: [ecs.DeploymentLifecycleStage.PRE_SCALE_UP], })); From 62166e0a0336b02aaacc47466bb62b66d9bba856 Mon Sep 17 00:00:00 2001 From: Vito Laurenza Date: Tue, 9 Dec 2025 11:09:36 -0500 Subject: [PATCH 4/4] chore: slight test case improvement --- .../integ.blue-green-deployment-strategy.ts | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.ts index de071fdd7ba82..5db03b99e6e13 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.ts @@ -116,15 +116,7 @@ taskDefinition.addContainer('container', { }], }); -// Create Fargate service with escape hatching for B/G deployment -const service = new ecs.FargateService(stack, 'Service', { - cluster, - taskDefinition, - securityGroups: [ecsSecurityGroup], - deploymentStrategy: ecs.DeploymentStrategy.BLUE_GREEN, -}); - -// Create deployment alarm for CPU utilization +// Create first deployment alarm const alarm1 = new cloudwatch.Alarm(stack, 'MyCustomAlarm', { metric: new cloudwatch.Metric({ namespace: 'Custom', @@ -134,7 +126,7 @@ const alarm1 = new cloudwatch.Alarm(stack, 'MyCustomAlarm', { evaluationPeriods: 2, }); -// Create deployment alarm for memory utilization +// Create second deployment alarm const alarm2 = new cloudwatch.Alarm(stack, 'AnotherCustomAlarm', { metric: new cloudwatch.Metric({ namespace: 'Custom', @@ -144,8 +136,19 @@ const alarm2 = new cloudwatch.Alarm(stack, 'AnotherCustomAlarm', { evaluationPeriods: 2, }); -// Enable deployment alarms -service.enableDeploymentAlarms([alarm1.alarmName, alarm2.alarmName]); +// Create Fargate service with escape hatching for B/G deployment +const service = new ecs.FargateService(stack, 'Service', { + cluster, + taskDefinition, + securityGroups: [ecsSecurityGroup], + deploymentStrategy: ecs.DeploymentStrategy.BLUE_GREEN, + deploymentAlarms: { + alarmNames: [alarm1.alarmName], // First deployment alarm + }, +}); + +// Enable second deployment alarm +service.enableDeploymentAlarms([alarm2.alarmName]); service.addLifecycleHook(new ecs.DeploymentLifecycleLambdaTarget(lambdaHook, 'PreScaleUp', { lifecycleStages: [ecs.DeploymentLifecycleStage.PRE_SCALE_UP],