diff --git a/aws/resource_aws_kms_key.go b/aws/resource_aws_kms_key.go index 81e3bbf0c28..a3f86df978b 100644 --- a/aws/resource_aws_kms_key.go +++ b/aws/resource_aws_kms_key.go @@ -165,14 +165,17 @@ func resourceAwsKmsKeyRead(d *schema.ResourceData, meta interface{}) error { d.Set("key_usage", metadata.KeyUsage) d.Set("is_enabled", metadata.Enabled) - p, err := conn.GetKeyPolicy(&kms.GetKeyPolicyInput{ - KeyId: metadata.KeyId, - PolicyName: aws.String("default"), + pOut, err := retryOnAwsCode("NotFoundException", func() (interface{}, error) { + return conn.GetKeyPolicy(&kms.GetKeyPolicyInput{ + KeyId: metadata.KeyId, + PolicyName: aws.String("default"), + }) }) if err != nil { return err } + p := pOut.(*kms.GetKeyPolicyOutput) policy, err := normalizeJsonString(*p.Policy) if err != nil { return errwrap.Wrapf("policy contains an invalid JSON: {{err}}", err)