Skip to content

Commit

Permalink
Merge pull request #6304 from saravanan30erd/issue-6144
Browse files Browse the repository at this point in the history
Issue #6144 Resource 'aws_iam_role_policy.example_policy' does not have attribute 'name'
  • Loading branch information
bflad committed Oct 30, 2018
2 parents acb7785 + 355ad3b commit 680cbb0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion aws/resource_aws_iam_role_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func resourceAwsIamRolePolicyPut(d *schema.ResourceData, meta interface{}) error
}

d.SetId(fmt.Sprintf("%s:%s", *request.RoleName, *request.PolicyName))
return nil
return resourceAwsIamRolePolicyRead(d, meta)
}

func resourceAwsIamRolePolicyRead(d *schema.ResourceData, meta interface{}) error {
Expand Down
4 changes: 4 additions & 0 deletions aws/resource_aws_iam_role_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ func TestAccAWSIAMRolePolicy_namePrefix(t *testing.T) {
"aws_iam_role_policy.test",
&rolePolicy1,
),
resource.TestCheckResourceAttrSet("aws_iam_role_policy.test", "name"),
),
},
{
Expand All @@ -107,6 +108,7 @@ func TestAccAWSIAMRolePolicy_namePrefix(t *testing.T) {
&rolePolicy2,
),
testAccCheckAWSIAMRolePolicyNameMatches(&rolePolicy1, &rolePolicy2),
resource.TestCheckResourceAttrSet("aws_iam_role_policy.test", "name"),
),
},
},
Expand All @@ -131,6 +133,7 @@ func TestAccAWSIAMRolePolicy_generatedName(t *testing.T) {
"aws_iam_role_policy.test",
&rolePolicy1,
),
resource.TestCheckResourceAttrSet("aws_iam_role_policy.test", "name"),
),
},
{
Expand All @@ -142,6 +145,7 @@ func TestAccAWSIAMRolePolicy_generatedName(t *testing.T) {
&rolePolicy2,
),
testAccCheckAWSIAMRolePolicyNameMatches(&rolePolicy1, &rolePolicy2),
resource.TestCheckResourceAttrSet("aws_iam_role_policy.test", "name"),
),
},
},
Expand Down

0 comments on commit 680cbb0

Please sign in to comment.