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

r/kms_key: Retry reading tags on NotFoundException #1900

Merged
merged 1 commit into from
Oct 16, 2017
Merged
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: 5 additions & 2 deletions aws/resource_aws_kms_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,15 @@ func resourceAwsKmsKeyRead(d *schema.ResourceData, meta interface{}) error {
krs, _ := out.(*kms.GetKeyRotationStatusOutput)
d.Set("enable_key_rotation", krs.KeyRotationEnabled)

tagList, err := conn.ListResourceTags(&kms.ListResourceTagsInput{
KeyId: metadata.KeyId,
tOut, err := retryOnAwsCode("NotFoundException", func() (interface{}, error) {
return conn.ListResourceTags(&kms.ListResourceTagsInput{
KeyId: metadata.KeyId,
})
})
if err != nil {
return fmt.Errorf("Failed to get KMS key tags (key: %s): %s", d.Get("key_id").(string), err)
}
tagList := tOut.(*kms.ListResourceTagsOutput)
d.Set("tags", tagsToMapKMS(tagList.Tags))

return nil
Expand Down