Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #5808 aws_iam_policy does not have a description attribute #5815

Merged
merged 3 commits into from
Sep 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions aws/resource_aws_iam_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,7 @@ func iamPolicyListVersions(arn string, iamconn *iam.IAM) ([]*iam.PolicyVersion,

func readIamPolicy(d *schema.ResourceData, policy *iam.Policy) error {
d.SetId(*policy.Arn)
if policy.Description != nil {
// the description isn't present in the response to CreatePolicy.
if err := d.Set("description", policy.Description); err != nil {
return err
}
}
d.Set("description", policy.Description)
if err := d.Set("path", policy.Path); err != nil {
return err
}
Expand Down
1 change: 1 addition & 0 deletions aws/resource_aws_iam_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func TestAWSPolicy_namePrefix(t *testing.T) {
testAccCheckAWSPolicyExists("aws_iam_policy.policy", &out),
testAccCheckAWSPolicyGeneratedNamePrefix(
"aws_iam_policy.policy", "test-policy-"),
resource.TestCheckResourceAttr("aws_iam_policy.policy", "description", ""),
),
},
},
Expand Down