File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -256,13 +256,17 @@ resource "aws_iam_role" "this" {
256256}
257257
258258resource "aws_iam_role_policy_attachment" "this" {
259- for_each = toset (module. this . enabled ? [
260- " arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore" ,
261- resource . aws_iam_policy . this [0 ]. arn
262- ] : [])
259+ count = module. this . enabled ? 1 : 0
260+
261+ role = resource. aws_iam_role . this [0 ]. name
262+ policy_arn = resource. aws_iam_policy . this [0 ]. arn
263+ }
264+
265+ resource "aws_iam_role_policy_attachment" "ssm_managed_instance_core" {
266+ count = module. this . enabled ? 1 : 0
263267
264268 role = resource. aws_iam_role . this [0 ]. name
265- policy_arn = each . key
269+ policy_arn = " arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore "
266270}
267271
268272resource "aws_iam_policy" "this" {
You can’t perform that action at this time.
0 commit comments