我正在尝试处理跨不同git repo保存的一些Terraform脚本。 存储库之一用于配置eks基础结构,另一个用于保存通用tf脚本。
在通用仓库中,我创建了一个自定义的IAM策略。我希望在创建eks基础结构存储库时将其附加到iam角色。有办法吗?
resource "aws_iam_role_policy_attachment" "eks-worker-node-data-access" {
policy_arn = "arn:aws:iam::aws:policy/base-data-capture"
role = "${module.eks-control-plane.worker_node_role_name}"
}
policy arn字段设置为将要创建的策略的名称,但是由于尚未导入而失败...
我想做的是类似的事情
resource "aws_iam_role_policy_attachment" "eks-worker-node-data-access" {
source = "my-git-repo.policy"
policy_arn = "arn:aws:iam::aws:policy/base-data-capture"
role = "${module.eks-control-plane.worker_node_role_name}"
}
我认为显而易见的答案是仅在同一tf文件夹中创建策略,而所有其他策略都在通用存储库中创建。