-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
provider/aws: Add per user, role and group policy attachment (superse…
…des #5816) (#6858) * Add per user, role and group policy attachment * Add docs for new IAM policy attachment resources. * Make policy attachment resources manage only 1 entity<->policy attachment * provider/aws: Tidy up IAM Group/User/Role attachments
- Loading branch information
Showing
3 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
layout: "aws" | ||
page_title: "AWS: aws_iam_group_policy_attachment" | ||
sidebar_current: "docs-aws-resource-iam-group-policy-attachment" | ||
description: |- | ||
Attaches a Managed IAM Policy to an IAM group | ||
--- | ||
|
||
# aws\_iam\_group\_policy\_attachment | ||
|
||
Attaches a Managed IAM Policy to an IAM group | ||
|
||
``` | ||
resource "aws_iam_group" "group" { | ||
name = "test-group" | ||
} | ||
resource "aws_iam_policy" "policy" { | ||
name = "test-policy" | ||
description = "A test policy" | ||
policy = #omitted | ||
} | ||
resource "aws_iam_group_policy_attachment" "test-attach" { | ||
group = "${aws_iam_group.group.name}" | ||
policy_arn = "${aws_iam_policy.policy.arn}" | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `group` (Required) - The group the policy should be applied to | ||
* `policy_arn` (Required) - The ARN of the policy you want to apply |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
layout: "aws" | ||
page_title: "AWS: aws_iam_role_policy_attachment" | ||
sidebar_current: "docs-aws-resource-iam-role-policy-attachment" | ||
description: |- | ||
Attaches a Managed IAM Policy to an IAM role | ||
--- | ||
|
||
# aws\_iam\_role\_policy\_attachment | ||
|
||
Attaches a Managed IAM Policy to an IAM role | ||
|
||
``` | ||
resource "aws_iam_role" "role" { | ||
name = "test-role" | ||
} | ||
resource "aws_iam_policy" "policy" { | ||
name = "test-policy" | ||
description = "A test policy" | ||
policy = #omitted | ||
} | ||
resource "aws_iam_role_policy_attachment" "test-attach" { | ||
role = "${aws_iam_role.role.name}" | ||
policy_arn = "${aws_iam_policy.policy.arn}" | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `role` (Required) - The role the policy should be applied to | ||
* `policy_arn` (Required) - The ARN of the policy you want to apply |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
layout: "aws" | ||
page_title: "AWS: aws_iam_user_policy_attachment" | ||
sidebar_current: "docs-aws-resource-iam-user-policy-attachment" | ||
description: |- | ||
Attaches a Managed IAM Policy to an IAM user | ||
--- | ||
|
||
# aws\_iam\_user\_policy\_attachment | ||
|
||
Attaches a Managed IAM Policy to an IAM user | ||
|
||
``` | ||
resource "aws_iam_user" "user" { | ||
name = "test-user" | ||
} | ||
resource "aws_iam_policy" "policy" { | ||
name = "test-policy" | ||
description = "A test policy" | ||
policy = #omitted | ||
} | ||
resource "aws_iam_user_policy_attachment" "test-attach" { | ||
user = "${aws_iam_user.user.name}" | ||
policy_arn = "${aws_iam_policy.policy.arn}" | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `user` (Required) - The user the policy should be applied to | ||
* `policy_arn` (Required) - The ARN of the policy you want to apply |