amazon-web-services - 使用 Iam 角色从 Autoscaling 组启动 EC2 节点

标签 amazon-web-services amazon-s3 aws-cloudformation

我在 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.

  • LT:IamInstanceProfile

    The IAM instance profile.

关于amazon-web-services - 使用 Iam 角色从 Autoscaling 组启动 EC2 节点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62026231/

相关文章:

javascript - gzip 不适用于 aws s3 Assets

dependencies - AWS CloudFormation 不遵守隐式依赖关系

amazon-web-services - 如何使用 aws cloudformation 将 RDS 实例添加到 VPC

ruby-on-rails - 在线价格 Amazon API

amazon-web-services - S3 存储桶策略中的 AWS 多个 CloudFront 分配

amazon-s3 - 在 Amazon EC2、S3 和/或 EBS 上托管和访问 HDF5 文件

amazon-web-services - Kinesis分片迭代器解释

amazon-web-services - 从 S3 存储桶 (AWS) 上的 cdk.out 文件夹部署 CDK Stack

amazon-web-services - 无法通过 CloudFormation 创建 EC2 key 对

amazon-web-services - 调用UpdateStack操作时发生错误(ValidationError): No updates are to be performed