Skip to content

Commit 88696e9

Browse files
revert(ecs): add support for native blue/green deployments in ECS L2 (#35061) (#35170)
This reverts commit 3723aca. ### Issue # (if applicable) Closes #35167 ### Reason for this change The change broke a function contract in Python, which resulted in a customer's CI/CD pipelines breaking. ### Description of changes Clean revert of the ECS blue/green functionality. ### Describe any new or updated permissions being added N/A ### Description of how you validated changes N/A ### Checklist - [ ] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent e128b29 commit 88696e9

15 files changed

+371
-1289
lines changed

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

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 161 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,143 @@
614614
"Priority": 1
615615
}
616616
},
617+
"EcsTaskExecutionRoleC0B6A84D": {
618+
"Type": "AWS::IAM::Role",
619+
"Properties": {
620+
"AssumeRolePolicyDocument": {
621+
"Statement": [
622+
{
623+
"Action": "sts:AssumeRole",
624+
"Effect": "Allow",
625+
"Principal": {
626+
"Service": "ecs-tasks.amazonaws.com"
627+
}
628+
}
629+
],
630+
"Version": "2012-10-17"
631+
},
632+
"ManagedPolicyArns": [
633+
{
634+
"Fn::Join": [
635+
"",
636+
[
637+
"arn:",
638+
{
639+
"Ref": "AWS::Partition"
640+
},
641+
":iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy"
642+
]
643+
]
644+
}
645+
]
646+
}
647+
},
648+
"ServiceRole4288B192": {
649+
"Type": "AWS::IAM::Role",
650+
"Properties": {
651+
"AssumeRolePolicyDocument": {
652+
"Statement": [
653+
{
654+
"Action": "sts:AssumeRole",
655+
"Effect": "Allow",
656+
"Principal": {
657+
"Service": "ecs.amazonaws.com"
658+
}
659+
}
660+
],
661+
"Version": "2012-10-17"
662+
},
663+
"ManagedPolicyArns": [
664+
{
665+
"Fn::Join": [
666+
"",
667+
[
668+
"arn:",
669+
{
670+
"Ref": "AWS::Partition"
671+
},
672+
":iam::aws:policy/service-role/AmazonEC2ContainerServiceRole"
673+
]
674+
]
675+
}
676+
],
677+
"Policies": [
678+
{
679+
"PolicyDocument": {
680+
"Statement": [
681+
{
682+
"Action": "lambda:InvokeFunction",
683+
"Effect": "Allow",
684+
"Resource": "*"
685+
}
686+
],
687+
"Version": "2012-10-17"
688+
},
689+
"PolicyName": "LambdaInvokePolicy"
690+
},
691+
{
692+
"PolicyDocument": {
693+
"Statement": [
694+
{
695+
"Action": [
696+
"elasticloadbalancing:ModifyListener",
697+
"elasticloadbalancing:ModifyRule"
698+
],
699+
"Effect": "Allow",
700+
"Resource": {
701+
"Ref": "ALBProductionListenerRule243D0687"
702+
}
703+
}
704+
],
705+
"Version": "2012-10-17"
706+
},
707+
"PolicyName": "ELBPolicy"
708+
}
709+
]
710+
}
711+
},
712+
"ServiceRoleDefaultPolicy94CF55F6": {
713+
"Type": "AWS::IAM::Policy",
714+
"Properties": {
715+
"PolicyDocument": {
716+
"Statement": [
717+
{
718+
"Action": "lambda:InvokeFunction",
719+
"Effect": "Allow",
720+
"Resource": [
721+
{
722+
"Fn::GetAtt": [
723+
"LambdaHookBF1BC8B4",
724+
"Arn"
725+
]
726+
},
727+
{
728+
"Fn::Join": [
729+
"",
730+
[
731+
{
732+
"Fn::GetAtt": [
733+
"LambdaHookBF1BC8B4",
734+
"Arn"
735+
]
736+
},
737+
":*"
738+
]
739+
]
740+
}
741+
]
742+
}
743+
],
744+
"Version": "2012-10-17"
745+
},
746+
"PolicyName": "ServiceRoleDefaultPolicy94CF55F6",
747+
"Roles": [
748+
{
749+
"Ref": "ServiceRole4288B192"
750+
}
751+
]
752+
}
753+
},
617754
"LambdaHookServiceRole9AAAD33B": {
618755
"Type": "AWS::IAM::Role",
619756
"Properties": {
@@ -719,6 +856,12 @@
719856
}
720857
],
721858
"Cpu": "256",
859+
"ExecutionRoleArn": {
860+
"Fn::GetAtt": [
861+
"EcsTaskExecutionRoleC0B6A84D",
862+
"Arn"
863+
]
864+
},
722865
"Family": "awsecsbluegreendeploymentTaskDef51D80572",
723866
"Memory": "512",
724867
"NetworkMode": "awsvpc",
@@ -740,6 +883,11 @@
740883
"Ref": "FargateCluster7CCD5F93"
741884
},
742885
"DeploymentConfiguration": {
886+
"BakeTimeInMinutes": 0,
887+
"DeploymentCircuitBreaker": {
888+
"Enable": false,
889+
"Rollback": false
890+
},
743891
"LifecycleHooks": [
744892
{
745893
"HookTargetArn": {
@@ -748,21 +896,24 @@
748896
"Arn"
749897
]
750898
},
751-
"LifecycleStages": [
752-
"PRE_SCALE_UP"
753-
],
754899
"RoleArn": {
755900
"Fn::GetAtt": [
756-
"ServicePreScaleUpRoleD002A553",
901+
"ServiceRole4288B192",
757902
"Arn"
758903
]
759-
}
904+
},
905+
"LifecycleStages": [
906+
"POST_TEST_TRAFFIC_SHIFT"
907+
]
760908
}
761909
],
762910
"MaximumPercent": 200,
763-
"MinimumHealthyPercent": 50,
911+
"MinimumHealthyPercent": 100,
764912
"Strategy": "BLUE_GREEN"
765913
},
914+
"DeploymentController": {
915+
"Type": "ECS"
916+
},
766917
"EnableECSManagedTags": false,
767918
"HealthCheckGracePeriodSeconds": 60,
768919
"LaunchType": "FARGATE",
@@ -772,14 +923,14 @@
772923
"AlternateTargetGroupArn": {
773924
"Ref": "GreenTG71A27F2F"
774925
},
775-
"ProductionListenerRule": {
776-
"Ref": "ALBProductionListenerRule243D0687"
777-
},
778926
"RoleArn": {
779927
"Fn::GetAtt": [
780-
"ServiceLBAlternateOptionsRole06C91D94",
928+
"ServiceRole4288B192",
781929
"Arn"
782930
]
931+
},
932+
"ProductionListenerRule": {
933+
"Ref": "ALBProductionListenerRule243D0687"
783934
}
784935
},
785936
"ContainerName": "nginx",
@@ -818,99 +969,6 @@
818969
"ALBProductionListenerRule243D0687",
819970
"TaskDefTaskRole1EDB4A67"
820971
]
821-
},
822-
"ServiceLBAlternateOptionsRole06C91D94": {
823-
"Type": "AWS::IAM::Role",
824-
"Properties": {
825-
"AssumeRolePolicyDocument": {
826-
"Statement": [
827-
{
828-
"Action": "sts:AssumeRole",
829-
"Effect": "Allow",
830-
"Principal": {
831-
"Service": "ecs.amazonaws.com"
832-
}
833-
}
834-
],
835-
"Version": "2012-10-17"
836-
},
837-
"ManagedPolicyArns": [
838-
{
839-
"Fn::Join": [
840-
"",
841-
[
842-
"arn:",
843-
{
844-
"Ref": "AWS::Partition"
845-
},
846-
":iam::aws:policy/AmazonECSInfrastructureRolePolicyForLoadBalancers"
847-
]
848-
]
849-
}
850-
]
851-
},
852-
"DependsOn": [
853-
"TaskDefTaskRole1EDB4A67"
854-
]
855-
},
856-
"ServicePreScaleUpRoleD002A553": {
857-
"Type": "AWS::IAM::Role",
858-
"Properties": {
859-
"AssumeRolePolicyDocument": {
860-
"Statement": [
861-
{
862-
"Action": "sts:AssumeRole",
863-
"Effect": "Allow",
864-
"Principal": {
865-
"Service": "ecs.amazonaws.com"
866-
}
867-
}
868-
],
869-
"Version": "2012-10-17"
870-
}
871-
}
872-
},
873-
"ServicePreScaleUpRoleDefaultPolicyF1032E86": {
874-
"Type": "AWS::IAM::Policy",
875-
"Properties": {
876-
"PolicyDocument": {
877-
"Statement": [
878-
{
879-
"Action": "lambda:InvokeFunction",
880-
"Effect": "Allow",
881-
"Resource": [
882-
{
883-
"Fn::GetAtt": [
884-
"LambdaHookBF1BC8B4",
885-
"Arn"
886-
]
887-
},
888-
{
889-
"Fn::Join": [
890-
"",
891-
[
892-
{
893-
"Fn::GetAtt": [
894-
"LambdaHookBF1BC8B4",
895-
"Arn"
896-
]
897-
},
898-
":*"
899-
]
900-
]
901-
}
902-
]
903-
}
904-
],
905-
"Version": "2012-10-17"
906-
},
907-
"PolicyName": "ServicePreScaleUpRoleDefaultPolicyF1032E86",
908-
"Roles": [
909-
{
910-
"Ref": "ServicePreScaleUpRoleD002A553"
911-
}
912-
]
913-
}
914972
}
915973
},
916974
"Parameters": {

packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/base/integ.blue-green-deployment-strategy.js.snapshot/integ.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)