provider/aws: Make iam_role_attachment example not throw any errors (#13843)

Fixes: #13398
This commit is contained in:
Paul Stack 2017-04-21 14:33:27 +03:00 committed by GitHub
parent deea8d7603
commit 214a212704
1 changed files with 29 additions and 1 deletions

View File

@ -13,12 +13,40 @@ Attaches a Managed IAM Policy to an IAM role
```hcl ```hcl
resource "aws_iam_role" "role" { resource "aws_iam_role" "role" {
name = "test-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_policy" "policy" { resource "aws_iam_policy" "policy" {
name = "test-policy" name = "test-policy"
description = "A test policy" description = "A test policy"
policy = # omitted policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"ec2:Describe*"
],
"Effect": "Allow",
"Resource": "*"
}
]
}
EOF
} }
resource "aws_iam_role_policy_attachment" "test-attach" { resource "aws_iam_role_policy_attachment" "test-attach" {