Code Deployment

0

Hi, I tried creating an AWS CI/CD pipeline. I was successful in doing the CI part and for the CD part, I created a code deployment application. After that, I made a Ubuntu EC2 instance and installed the necessary code deployment agent. It was all good up to this but when I tried to attach an IAM role to the EC2 instance, it was not showing up. It's showing only the option of- "No IAM Role". I used "CodeDeploy" for the use case in the CodeDeploy service. Please help me solve this situation. I will attach the IAM role trust entity: { "Version": "2012-10-17", "Statement": [ { "Sid": "", "Effect": "Allow", "Principal": { "Service": "codedeploy.amazonaws.com" }, "Action": "sts:AssumeRole" } ] }

Rois
asked 7 months ago168 views
1 Answer
0
Accepted Answer

You cannot attach a role with "Principal": { "Service": "codedeploy.amazonaws.com" } to your EC2 instance. You need to create a separate role that EC2 instance can assume. A sample guide to create a role for EC2 instance can be found at this page.

profile picture
HS
answered 7 months ago
profile picture
EXPERT
reviewed 7 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions