Terraform import aws_iam_role_policy_attachment

  # aws_iam_role_policy_attachment.xxx will be created
  + resource "aws_iam_role_policy_attachment" "xxx" {
      + id         = (known after apply)
      + policy_arn = "arn:aws:iam::aws:policy/AmazonCognitoPowerUser"
      + role       = "YourNameOfRole"

For anyone looking for a quick import snippet of the above resource here it is…

terraform import aws_iam_role_policy_attachment.xxx YourNameOfRole/arn:aws:iam::aws:policy/AmazonCognitoPowerUser

So it comes down to import using RoleName/arn-of-the-policy


Leave a Reply

Your email address will not be published. Required fields are marked *