-
Log into AWS.
-
Search for the IAM service and select it.
-
In option Roles click Create Role:
- Select AWS service as type of trusted entity and EC2 for the service that will use the role, then click Next: Permissions.
- Select and attach to the role the predefined polices AmazonEC2RoleforAWSCodeDeploy and AWSCodePipelineCustomActionAccess, then click Next: Review.
- Review that both polices were attached and assign a name for the role, then click Create role.
- Verify on Roles pane the creation of the new Role.
- Return to EC2 Dashboard and select Actions > Instance settings > Attach/Replace IAM Role option.
- Finally select the Role just created and click Apply.
This role enable AWS CodePipeline to deploy artifacts on the EC2 Instance selected.








