Skip to content

Commit

Permalink
Merge pull request #9632 from terraform-providers/rfd-retry-secrets
Browse files Browse the repository at this point in the history
Final retries after timeouts creating and updating secrets
  • Loading branch information
ryndaniels authored Aug 7, 2019
2 parents 93b7c79 + 0416447 commit ff74f86
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions aws/resource_aws_secretsmanager_secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ func resourceAwsSecretsManagerSecretCreate(d *schema.ResourceData, meta interfac
}
return nil
})
if isResourceTimeoutError(err) {
output, err = conn.CreateSecret(input)
}
if err != nil {
return fmt.Errorf("error creating Secrets Manager Secret: %s", err)
}
Expand Down Expand Up @@ -182,6 +185,9 @@ func resourceAwsSecretsManagerSecretCreate(d *schema.ResourceData, meta interfac
}
return nil
})
if isResourceTimeoutError(err) {
_, err = conn.RotateSecret(input)
}
if err != nil {
return fmt.Errorf("error enabling Secrets Manager Secret %q rotation: %s", d.Id(), err)
}
Expand Down Expand Up @@ -318,6 +324,9 @@ func resourceAwsSecretsManagerSecretUpdate(d *schema.ResourceData, meta interfac
}
return nil
})
if isResourceTimeoutError(err) {
_, err = conn.RotateSecret(input)
}
if err != nil {
return fmt.Errorf("error updating Secrets Manager Secret %q rotation: %s", d.Id(), err)
}
Expand Down

0 comments on commit ff74f86

Please sign in to comment.