provider/aws: Explain better why we retry IAM role creation (#8286)
This commit is contained in:
parent
6990db497a
commit
b2a3104118
|
@ -108,8 +108,8 @@ func resourceAwsIamRoleCreate(d *schema.ResourceData, meta interface{}) error {
|
||||||
err := resource.Retry(30*time.Second, func() *resource.RetryError {
|
err := resource.Retry(30*time.Second, func() *resource.RetryError {
|
||||||
var err error
|
var err error
|
||||||
createResp, err = iamconn.CreateRole(request)
|
createResp, err = iamconn.CreateRole(request)
|
||||||
// IAM roles can take ~30 seconds to propagate in AWS:
|
// IAM users (referenced in Principal field of assume policy)
|
||||||
// http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html#launch-instance-with-role-console
|
// can take ~30 seconds to propagate in AWS
|
||||||
if isAWSErr(err, "MalformedPolicyDocument", "Invalid principal in policy") {
|
if isAWSErr(err, "MalformedPolicyDocument", "Invalid principal in policy") {
|
||||||
return resource.RetryableError(err)
|
return resource.RetryableError(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue