我在 CloudFormation 中配置一个 Autoscaling 组,并尝试启动所有附加了 IAM 角色的 ec2 节点(例如,可以允许访问 s3 的角色)。
我知道在 CloudFormation 中有 ServiceLinkedRoleARN
键。根据文档,此 key 默认使用 AutoScalingServiceRolePolicy 角色,并且没有 S3 访问权限。我无法创建同时包含 S3 角色和 AutoScalingServiceRole 角色的自定义角色,因为出现错误:
Cannot attach a Service Role Policy to a Customer Role.
那么我应该只将 s3 的自定义角色附加到扩展组吗?最佳实践方法是什么?
最佳答案
您可以在 LaunchConfiguration
(LC) 或 LaunchTemplate
(LT) 中为 ASG 中的实例指定实例角色:
信用证:IamInstanceProfile :
Provides the name or the Amazon Resource Name (ARN) of the instance profile associated with the IAM role for the instance. The instance profile contains the IAM role.
-
The IAM instance profile.
关于amazon-web-services - 使用 Iam 角色从 Autoscaling 组启动 EC2 节点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62026231/