Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
531 views
in Technique[技术] by (71.8m points)

amazon web services - Find aws-elasticbeanstalk-ec2-role in Terraform?

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?

question from:https://stackoverflow.com/questions/65921462/find-aws-elasticbeanstalk-ec2-role-in-terraform

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...