简体   繁体   English

使用 cloudFormation 将角色附加到现有 EC2 实例

[英]attach a role to an existing EC2 instance, using cloudFormation

it's all said in the title都在标题里说了

I'm looking to attach a role to an EC2 instance already created, using cloudFormation.我希望使用 cloudFormation 将角色附加到已创建的 EC2 实例。

I want to know if it's possible with cloudformation我想知道是否可以使用 cloudformation

Yes it is possible:对的,这是可能的:

  1. You need an AWS::IAM::InstanceProfile in your resources section where you can reference the role ARN.您的资源部分需要一个AWS::IAM::InstanceProfile ,您可以在其中引用角色 ARN。
  2. And then you can use IamInstanceProfile property in your EC2 instance to reference the instance profile resource you created然后您可以在 EC2 实例中使用IamInstanceProfile属性来引用您创建的实例配置文件资源

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM