Skip to content

Commit

Permalink
Fix discouraged usage of iam_policy_attachment
Browse files Browse the repository at this point in the history
The comment above also links to an IAM role policy attachment.

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy_attachment is discouraging, pointing out issues/limitations using iam_policy_attachment.

This should allow the same functionality
  • Loading branch information
Phileas Lebada authored Aug 12, 2021
1 parent 9022013 commit 19047f2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions examples/bottlerocket/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ EOT

# SSM policy for bottlerocket control container access
# https://github.com/bottlerocket-os/bottlerocket/blob/develop/QUICKSTART-EKS.md#enabling-ssm
resource "aws_iam_policy_attachment" "ssm" {
name = "ssm"
roles = [module.eks.worker_iam_role_name]
resource "aws_iam_role_policy_attachment" "ssm" {
roles = module.eks.worker_iam_role_name
policy_arn = data.aws_iam_policy.ssm.arn
}

0 comments on commit 19047f2

Please sign in to comment.