AmazonEC2RoleforAWSCodeDeployLimited
Summary
Provides EC2 limited access to S3 bucket to download revision. This role is needed by the CodeDeploy agent on EC2 instances.
Permissions imported from the AWS Managed Policy Reference Guide; other sections pending editorial review.
Identity
- ARN
arn:aws:iam::aws:policy/service-role/AmazonEC2RoleforAWSCodeDeployLimited- Default version
- v2
- Created
- Last edited
- Services
- s3
Control-plane actions (0)
By access level: none.
This policy grants no actions in this plane.
Data-plane actions (3)
By access level: 1 List, 2 Read.
| Service | Granted | Access levels and limits | Granted by |
|---|---|---|---|
| S3 | 3 of 25 | 1 List, 2 Read; 3 restricted, 0 conditional | s3:GetObject, s3:GetObjectVersion, s3:ListBucket |
S3: 3 actions
- s3:GetObject (Read)
- s3:GetObjectVersion (Read)
- s3:ListBucket (List)
Excluded and conditional actions
No patterns are excluded by NotAction or Deny statements.
Resource scope and attachment
Resource scope across granted actions: mixed.
Can be attached: Yes, to users, groups and roles.
Why this tier
- Grants only List and Read actions.
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
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": [
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:GetObjectVersion",
"s3:ListBucket"
],
"Resource": "arn:aws:s3:::*/CodeDeploy/*"
},
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:GetObjectVersion"
],
"Resource": "*",
"Condition": {
"StringEquals": {
"s3:ExistingObjectTag/UseWithCodeDeploy": "true"
}
}
}
]
}
Version history
Current version v2, edited by AWS on 2022-01-20. 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/service-role/AmazonEC2RoleforAWSCodeDeployLimited
aws iam attach-user-policy --user-name USER_NAME --policy-arn arn:aws:iam::aws:policy/service-role/AmazonEC2RoleforAWSCodeDeployLimited
aws iam attach-group-policy --group-name GROUP_NAME --policy-arn arn:aws:iam::aws:policy/service-role/AmazonEC2RoleforAWSCodeDeployLimitedCloudFormation
Resources:
ExampleRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument: {} # replace with your trust policy
ManagedPolicyArns:
- arn:aws:iam::aws:policy/service-role/AmazonEC2RoleforAWSCodeDeployLimitedTerraform
resource "aws_iam_role_policy_attachment" "service_role_amazonec2roleforawscodedeploylimited" {
role = aws_iam_role.example.name
policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonEC2RoleforAWSCodeDeployLimited"
}CDK (TypeScript)
role.addManagedPolicy(
iam.ManagedPolicy.fromAwsManagedPolicyName("service-role/AmazonEC2RoleforAWSCodeDeployLimited"),
);Sources
Pending editorial review. No editorial sources are listed yet.