AWSCodeDeployRoleForECS
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.
| Service | Granted | Access levels and limits | Granted by |
|---|---|---|---|
| CloudWatch | 1 of 160 | 1 Read; 0 restricted, 0 conditional | cloudwatch:DescribeAlarms |
| Elastic Container Service | 4 of 92 | 1 Read, 3 Write; 0 restricted, 0 conditional | ecs:CreateTaskSet, ecs:DeleteTaskSet, ecs:DescribeServices, ecs:UpdateServicePrimaryTaskSet |
| ELB | 5 of 77 | 3 Read, 2 Write; 0 restricted, 0 conditional | elasticloadbalancing:DescribeListeners, elasticloadbalancing:DescribeRules, elasticloadbalancing:DescribeTargetGroups, elasticloadbalancing:ModifyListener, elasticloadbalancing:ModifyRule |
| IAM | 1 of 190 | 1 Write; 1 restricted, 1 conditional | iam: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.
| Service | Granted | Access levels and limits | Granted by |
|---|---|---|---|
| Lambda | 1 of 14 | 1 Write; 0 restricted, 0 conditional | lambda:InvokeFunction |
| S3 | 2 of 25 | 2 Read; 0 restricted, 0 conditional | s3:GetObject, s3:GetObjectVersion |
| SNS | All 1 actions (see the SNS page) | 1 Write; 0 restricted, 0 conditional | sns: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.
Related policies
Same service
- AccessAnalyzerServiceRolePolicy
- AdministratorAccess-AWSElasticBeanstalk
- AmazonAppFlowFullAccess
- AmazonAppStreamServiceAccess
- AmazonBedrockStudioPermissionsBoundary
- AmazonBraketJobsExecutionPolicy
- AmazonBraketServiceRolePolicy
- AmazonCloudWatchEvidentlyFullAccess
Same domain
- AmazonAPIGatewayAdministrator
- AmazonAPIGatewayInvokeFullAccess
- AmazonApplicationRecoveryControllerRegionSwitchPlanExecutionPolicy
- AmazonECSInfrastructureRoleforExpressGatewayServices
- AmazonECSInfrastructureRoleForGatewayHostSharedALB
- AmazonECSInfrastructureRolePolicyForLoadBalancers
- AmazonECSInfrastructureRolePolicyForVpcLattice
- AmazonEKSClusterPolicy
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
{
"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/AWSCodeDeployRoleForECSCloudFormation
Resources:
ExampleRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument: {} # replace with your trust policy
ManagedPolicyArns:
- arn:aws:iam::aws:policy/AWSCodeDeployRoleForECSTerraform
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.