mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
provider/aws: Retry ECS svc update on ServiceNotFoundException (#15073)
This commit is contained in:
parent
bb29789582
commit
cf58139378
@ -404,8 +404,7 @@ func resourceAwsEcsServiceUpdate(d *schema.ResourceData, meta interface{}) error
|
||||
}
|
||||
}
|
||||
|
||||
// Retry due to AWS IAM policy eventual consistency
|
||||
// See https://github.com/hashicorp/terraform/issues/4375
|
||||
// Retry due to IAM & ECS eventual consistency
|
||||
err := resource.Retry(2*time.Minute, func() *resource.RetryError {
|
||||
out, err := conn.UpdateService(&input)
|
||||
if err != nil {
|
||||
@ -414,6 +413,10 @@ func resourceAwsEcsServiceUpdate(d *schema.ResourceData, meta interface{}) error
|
||||
log.Printf("[DEBUG] Trying to update ECS service again: %#v", err)
|
||||
return resource.RetryableError(err)
|
||||
}
|
||||
if ok && awsErr.Code() == "ServiceNotFoundException" {
|
||||
log.Printf("[DEBUG] Trying to update ECS service again: %#v", err)
|
||||
return resource.RetryableError(err)
|
||||
}
|
||||
|
||||
return resource.NonRetryableError(err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user