Skip to main content
IAM Policy Map

AWSCodeDeployRoleForECS

OperatorAWS managedActivePermissions reviewedShow on mapCompare

Summary

Provides CodeDeploy service wide access to perform an ECS blue/green deployment on your behalf. Grants full access to support services, such as full access to read all S3 objects, invoke all Lambda functions, publish to all SNS topics within the account and update all ECS services.

Permissions imported from the AWS Managed Policy Reference Guide; other sections pending editorial review.

Identity

ARN
arn:aws:iam::aws:policy/AWSCodeDeployRoleForECS
Default version
v3
Created
Last edited
Services
cloudwatch, ecs, elasticloadbalancing, iam, lambda, s3, sns

Control-plane actions (11)

By access level: 5 Read, 6 Write.

Control-plane actions by service
ServiceGrantedAccess levels and limitsGranted by
CloudWatch1 of 1601 Read; 0 restricted, 0 conditionalcloudwatch:DescribeAlarms
Elastic Container Service4 of 921 Read, 3 Write; 0 restricted, 0 conditionalecs:CreateTaskSet, ecs:DeleteTaskSet, ecs:DescribeServices, ecs:UpdateServicePrimaryTaskSet
ELB5 of 773 Read, 2 Write; 0 restricted, 0 conditionalelasticloadbalancing:DescribeListeners, elasticloadbalancing:DescribeRules, elasticloadbalancing:DescribeTargetGroups, elasticloadbalancing:ModifyListener, elasticloadbalancing:ModifyRule
IAM1 of 1901 Write; 1 restricted, 1 conditionaliam:PassRole
CloudWatch: 1 actions
  • cloudwatch:DescribeAlarms (Read)
Elastic Container Service: 4 actions
  • ecs:CreateTaskSet (Write)
  • ecs:DeleteTaskSet (Write)
  • ecs:DescribeServices (Read)
  • ecs:UpdateServicePrimaryTaskSet (Write)
ELB: 5 actions
  • elasticloadbalancing:DescribeListeners (Read)
  • elasticloadbalancing:DescribeRules (Read)
  • elasticloadbalancing:DescribeTargetGroups (Read)
  • elasticloadbalancing:ModifyListener (Write)
  • elasticloadbalancing:ModifyRule (Write)
IAM: 1 actions
  • iam:PassRole (Write)

Data-plane actions (4)

By access level: 2 Read, 2 Write.

Data-plane actions by service
ServiceGrantedAccess levels and limitsGranted by
Lambda1 of 141 Write; 0 restricted, 0 conditionallambda:InvokeFunction
S32 of 252 Read; 0 restricted, 0 conditionals3:GetObject, s3:GetObjectVersion
SNSAll 1 actions (see the SNS page)1 Write; 0 restricted, 0 conditionalsns:Publish
Lambda: 1 actions
  • lambda:InvokeFunction (Write)
S3: 2 actions
  • s3:GetObject (Read)
  • s3:GetObjectVersion (Read)

Excluded and conditional actions

No patterns are excluded by NotAction or Deny statements.

Resource scope and attachment

Resource scope across granted actions: all-resources.

Can be attached: Yes, to users, groups and roles.

Why this tier

  • Grants 8 write, tagging or permissions-management actions, short of full control of any service.
  • Grants iam:PassRole, but only for scoped roles or under conditions (for example iam:PassedToService).

Guidance

Pending editorial review. The permission data on this page comes straight from AWS; this section will be filled in once a reviewed guide exists.

Same service

Same domain

Frequently asked questions

Pending editorial review. The permission data on this page comes straight from AWS; this section will be filled in once a reviewed guide exists.

Policy JSON

Download policy.json

{
  "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:GetObjectVersion"
      ],
      "Resource": "*",
      "Effect": "Allow"
    },
    {
      "Action": [
        "iam:PassRole"
      ],
      "Effect": "Allow",
      "Resource": "*",
      "Condition": {
        "StringLike": {
          "iam:PassedToService": [
            "ecs-tasks.amazonaws.com"
          ]
        }
      }
    }
  ]
}

Version history

Current version v3, edited by AWS on 2019-09-23. Version history is recorded from 2026-11-11. Earlier versions are in the IAM console under Policy versions.

Attach snippets

AWS CLI

aws iam attach-role-policy --role-name ROLE_NAME --policy-arn arn:aws:iam::aws:policy/AWSCodeDeployRoleForECS
aws iam attach-user-policy --user-name USER_NAME --policy-arn arn:aws:iam::aws:policy/AWSCodeDeployRoleForECS
aws iam attach-group-policy --group-name GROUP_NAME --policy-arn arn:aws:iam::aws:policy/AWSCodeDeployRoleForECS

CloudFormation

Resources:
  ExampleRole:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument: {}  # replace with your trust policy
      ManagedPolicyArns:
        - arn:aws:iam::aws:policy/AWSCodeDeployRoleForECS

Terraform

resource "aws_iam_role_policy_attachment" "awscodedeployroleforecs" {
  role       = aws_iam_role.example.name
  policy_arn = "arn:aws:iam::aws:policy/AWSCodeDeployRoleForECS"
}

CDK (TypeScript)

role.addManagedPolicy(
  iam.ManagedPolicy.fromAwsManagedPolicyName("AWSCodeDeployRoleForECS"),
);

Sources

Pending editorial review. No editorial sources are listed yet.