【发布时间】:2020-05-16 08:42:44
【问题描述】:
问题陈述:
我想使用 Terraform 为多个 AWS 账户创建和管理代入 IAM Assume 角色。
要实现的目标
- 使用 Terraform 模块在所有 AWS 账户中创建 IAM 代入角色
背景
IAM 角色将存在于每个账户中,并且每个账户将具有不同数量的 Assume 角色,因为它将被不同规模的不同团队使用。将通过 Jump AWS 账户授予对该账户的访问权限,用户将从该账户进行身份验证,然后使用 Assume Role URL 切换账户。
例如。
Account A has two IAM roles: admin_role and developer_role
Account B has three IAM roles: admin_role, poweruser_role and developer_role
Account C is a jump account, and it also has admin_role, poweruser_role and developer_role IAM role
User A log into Account C(with poweruser_role attached to them user) then assumes to Account B(this account has a trust relationship with Account C) using the same poweruser_role.
对于这种多账户基础设施设置,合适的 Terraform IAM 解决方案是什么?
This solution 说明了如何为所有账户拥有唯一的 IAM 角色,但没有说明当每个账户的 AWS 角色不同时如何处理。
提前致谢。
【问题讨论】:
标签: amazon-web-services terraform terraform-provider-aws