Resource: aws_iam_group_policy_attachment

Attaches a Managed IAM Policy to an IAM group

Example Usage

resource "aws_iam_group" "group" {
  name = "test-group"
}

resource "aws_iam_policy" "policy" {
  name        = "test-policy"
  description = "A test policy"
  policy      = "{ ... policy JSON ... }"
}

resource "aws_iam_group_policy_attachment" "test-attach" {
  group      = aws_iam_group.group.name
  policy_arn = aws_iam_policy.policy.arn
}

Argument Reference

This resource supports the following arguments:

Attribute Reference

This resource exports no additional attributes.

Import

In Terraform v1.5.0 and later, use an import block to import IAM group policy attachments using the group name and policy arn separated by /. For example:

import {
  to = aws_iam_group_policy_attachment.test-attach
  id = "test-group/arn:aws:iam::xxxxxxxxxxxx:policy/test-policy"
}

Using terraform import, import IAM group policy attachments using the group name and policy arn separated by /. For example:

% terraform import aws_iam_group_policy_attachment.test-attach test-group/arn:aws:iam::xxxxxxxxxxxx:policy/test-policy