Code Deployment


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": "" }, "Action": "sts:AssumeRole" } ] }

asked 9 months ago195 views
1 Answer
Accepted Answer

You cannot attach a role with "Principal": { "Service": "" } 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
answered 9 months ago
profile picture
reviewed 9 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