From 07ca5ed7c91707179cc88d74f975b71a25ee232c Mon Sep 17 00:00:00 2001 From: Yuki Matsuda <13781813+mazyu36@users.noreply.github.com> Date: Sat, 9 Aug 2025 18:51:08 +0900 Subject: [PATCH] docs(ecs): remove outdated blue/green deployment examples from README --- packages/aws-cdk-lib/aws-ecs/README.md | 82 -------------------------- 1 file changed, 82 deletions(-) diff --git a/packages/aws-cdk-lib/aws-ecs/README.md b/packages/aws-cdk-lib/aws-ecs/README.md index 8a346ae0c936a..cae8cbb27c494 100644 --- a/packages/aws-cdk-lib/aws-ecs/README.md +++ b/packages/aws-cdk-lib/aws-ecs/README.md @@ -2076,8 +2076,6 @@ Amazon ECS supports native blue/green deployments that allow you to deploy new v [Amazon ECS blue/green deployments](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-blue-green.html) -### Using Fargate L2 constructs for Blue/Green Feature - ```ts import * as lambda from 'aws-cdk-lib/aws-lambda'; @@ -2111,86 +2109,6 @@ const target = service.loadBalancerTarget({ target.attachToApplicationTargetGroup(blueTargetGroup); ``` -### Using Escape Hatches for Blue/Green Features - -The new blue/green deployment features are added to CloudFormation but not yet available in the CDK L2 constructs, you can use escape hatches to access them through the L1 (CfnService) construct. - -#### Load Balancer Advanced Configuration - -Configure advanced load balancer settings for blue/green deployments with alternate target groups and listener rules: - -```ts -declare const service: ecs.FargateService; - -const cfnService = service.node.defaultChild as ecs.CfnService; -cfnService.loadBalancers = [{ - containerName: 'web', - containerPort: 80, - targetGroupArn: 'arn:aws:elasticloadbalancing:region:account:targetgroup/production', - advancedConfiguration: { - alternateTargetGroupArn: 'arn:aws:elasticloadbalancing:region:account:targetgroup/test', - productionListenerRule: 'arn:aws:elasticloadbalancing:region:account:listener-rule/production-rule', - testListenerRule: 'arn:aws:elasticloadbalancing:region:account:listener-rule/test-rule', - roleArn: 'arn:aws:iam::account:role/ecs-blue-green-role' - } -}]; -``` - -#### Blue/Green Deployment Configuration - -Configure deployment strategy with bake time and lifecycle hooks: - -```ts -declare const service: ecs.FargateService; - -const cfnService = service.node.defaultChild as ecs.CfnService; -cfnService.deploymentConfiguration = { - maximumPercent: 200, - minimumHealthyPercent: 100, - strategy: 'BLUE_GREEN', - bakeTimeInMinutes: 15, - lifecycleHooks: [{ - hookTargetArn: 'arn:aws:lambda:region:account:function:pre-deployment-hook', - roleArn: 'arn:aws:iam::account:role/deployment-hook-role', - lifecycleStages: ['PRE_STOP', 'POST_START'] - }] -}; -``` - -#### Service Connect Test Traffic Rules - -Configure test traffic routing for Service Connect during blue/green deployments: - -```ts -declare const cluster: ecs.Cluster; -declare const taskDefinition: ecs.TaskDefinition; - -const service = new ecs.FargateService(this, 'Service', { - cluster, - taskDefinition, -}); - -const cfnService = service.node.defaultChild as ecs.CfnService; -cfnService.serviceConnectConfiguration = { - enabled: true, - services: [{ - portName: 'api', - clientAliases: [{ - port: 80, - dnsName: 'my-service', - testTrafficRules: { - header: { - name: 'x-canary-test', - value: { - exact: 'beta-version' - } - } - } - }] - }] -}; -``` - ## Daemon Scheduling Strategy You can specify whether service use Daemon scheduling strategy by specifying `daemon` option in Service constructs. See [differences between Daemon and Replica scheduling strategy](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs_services.html)