0

According to this, the role aws-elasticbeanstalk-ec2-role should be used for Elastic Beanstalk instances.

I would like to find this role so that I can refer to it in other places in my scripts.

data aws_iam_role "elasticbeanstalk_ec2_role" {
  name = "aws-elasticbeanstalk-ec2-role"
}

This isn't right though:

NoSuchEntity: The role with name aws-elasticbeanstalk-ec2-role cannot be found.

How can I find this role?

sdgfsdh
  • 33,689
  • 26
  • 132
  • 245

2 Answers2

1

According to the documentation here:

When you launch an environment using the Elastic Beanstalk console or the EB CLI, Elastic Beanstalk creates a default instance profile, called aws-elasticbeanstalk-ec2-role, and assigns managed policies with default permissions to it.

Since you appear to be deploying your application through Terraform, instead of using the AWS EB CLI or Console, that role doesn't exist. You will need to create a role for your EB instances yourself.

Mark B
  • 183,023
  • 24
  • 297
  • 295
0

I confirm that you need to create role by yourself if deploying with Terraform. See official documentation for informations : https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/iam-instanceprofile.html