12

I've encountered following error when I'm trying to create Deployment Group for ECS Cluster in Code Deploy. I've created IAM that based on CodeDeploy ECS and its policy:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "ecs:DescribeServices",
                "ecs:CreateTaskSet",
                "ecs:UpdateServicePrimaryTaskSet",
                "ecs:DeleteTaskSet",
                "elasticloadbalancing:DescribeTargetGroups",
                "elasticloadbalancing:DescribeListeners",
                "elasticloadbalancing:ModifyListener",
                "elasticloadbalancing:DescribeRules",
                "elasticloadbalancing:ModifyRule",
                "lambda:InvokeFunction",
                "cloudwatch:DescribeAlarms",
                "sns:Publish",
                "s3:GetObject",
                "s3:GetObjectMetadata",
                "s3:GetObjectVersion"
            ],
            "Resource": "*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "iam:PassRole"
            ],
            "Effect": "Allow",
            "Resource": "*",
            "Condition": {
                "StringLike": {
                    "iam:PassedToService": [
                        "ecs-tasks.amazonaws.com"
                    ]
                }
            }
        }
    ]
}

Please let me know when I made mistake?

enter image description here

PPShein
  • 10,951
  • 34
  • 129
  • 188

1 Answers1

13

If you are using CodeDeploy, your ECS service has to be defined so that it uses Blue/Green code deployments rather than Rolling Updates:

snapshot of AWS Management Console > ECS > Create Service

HTH!

Community
  • 1
  • 1
diginoise
  • 6,666
  • 1
  • 25
  • 32
  • 3
    I have created my ecs service using cloudformation template. There is no property in cloudformation to specify to use Blue/Green Deployment model. I am following a thread https://stackoverflow.com/questions/54304700/required-cloudformation-script-for-blue-green-deployment-on-ecs which says support for this hasn't been added in cloudformation yet. – kk. Jun 21 '19 at 10:16