Skip to content

Commit

Permalink
Merge pull request #8058 from devinburnette/update-policy-attachment-…
Browse files Browse the repository at this point in the history
…docs

add policy examples to iam policy attachment docs
  • Loading branch information
bflad authored Mar 23, 2019
2 parents b4d6106 + cafadcd commit 06544e6
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion website/docs/r/iam_policy_attachment.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@ resource "aws_iam_user" "user" {
resource "aws_iam_role" "role" {
name = "test-role"
assume_role_policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "sts:AssumeRole",
"Principal": {
"Service": "ec2.amazonaws.com"
},
"Effect": "Allow",
"Sid": ""
}
]
}
EOF
}
resource "aws_iam_group" "group" {
Expand All @@ -32,7 +47,20 @@ resource "aws_iam_group" "group" {
resource "aws_iam_policy" "policy" {
name = "test-policy"
description = "A test policy"
policy = "" # insert policy here
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"ec2:Describe*"
],
"Effect": "Allow",
"Resource": "*"
}
]
}
EOF
}
resource "aws_iam_policy_attachment" "test-attach" {
Expand Down

0 comments on commit 06544e6

Please sign in to comment.