AWS IAM Group Policy

This page shows how to write Terraform and CloudFormation for IAM Group Policy and write them securely.

aws_group_policy (Terraform)

The Group Policy in IAM can be configured in Terraform with the resource name aws_group_policy. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Parameters

The following arguments are supported:

  • policy - (Required) The policy document. This is a JSON formatted string. For more information about building IAM policy documents with Terraform, see the AWS IAM Policy Document Guide
  • name - (Optional) The name of the policy. If omitted, Terraform will assign a random, unique name.
  • name_prefix - (Optional) Creates a unique name beginning with the specified prefix. Conflicts with name.
  • group - (Required) The IAM group to attach to the policy.

In addition to all arguments above, the following attributes are exported:

  • id - The group policy ID.
  • group - The group to which this policy applies.
  • name - The name of the policy.
  • policy - The policy document attached to the group.

Explanation in Terraform Registry

Provides an IAM policy attached to a group.

AWS::IAM::Group Policy (CloudFormation)

The Group Policy in IAM can be configured in CloudFormation with the resource name AWS::IAM::Group Policy. The following sections describe how to use the resource and its parameters.

Parameters

PolicyDocument The policy document.
Required: Yes
Type: Json
Minimum: 1
Maximum: 131072
Pattern: [\u0009\u000A\u000D\u0020-\u00FF]+
Update requires: No interruption

PolicyName The friendly name (not ARN) identifying the policy.
Required: Yes
Type: String
Minimum: 1
Maximum: 128
Pattern: [\w+=,.@-]+
Update requires: No interruption

Explanation in CloudFormation Registry

Contains information about an attached policy.

An attached policy is a managed policy that has been attached to a user, group, or role.

For more information about managed policies, see Managed Policies and Inline Policies in the IAM User Guide.

Frequently asked questions

What is AWS IAM Group Policy?

AWS IAM Group Policy is a resource for IAM of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.