Skip to content

Commit

Permalink
Merge pull request #1818 from terraform-providers/b-kms-retry
Browse files Browse the repository at this point in the history
r/kms_key: Retry getting rotation status
  • Loading branch information
radeksimko authored Oct 9, 2017
2 parents 0f7c8e4 + 382ec99 commit c81df43
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions aws/resource_aws_kms_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,15 @@ func resourceAwsKmsKeyRead(d *schema.ResourceData, meta interface{}) error {
}
d.Set("policy", policy)

krs, err := conn.GetKeyRotationStatus(&kms.GetKeyRotationStatusInput{
KeyId: metadata.KeyId,
out, err := retryOnAwsCode("NotFoundException", func() (interface{}, error) {
return conn.GetKeyRotationStatus(&kms.GetKeyRotationStatusInput{
KeyId: metadata.KeyId,
})
})
if err != nil {
return err
}
krs, _ := out.(*kms.GetKeyRotationStatusOutput)
d.Set("enable_key_rotation", krs.KeyRotationEnabled)

tagList, err := conn.ListResourceTags(&kms.ListResourceTagsInput{
Expand Down

0 comments on commit c81df43

Please sign in to comment.