mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
provider/aws: Update Lambda create error handling to be more flexible
This commit is contained in:
parent
1510277f45
commit
f0d1193f8f
@ -157,7 +157,7 @@ func resourceAwsLambdaFunctionCreate(d *schema.ResourceData, meta interface{}) e
|
||||
// IAM profiles can take ~10 seconds to propagate in AWS:
|
||||
// http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html#launch-instance-with-role-console
|
||||
// Error creating Lambda function: InvalidParameterValueException: The role defined for the task cannot be assumed by Lambda.
|
||||
if awsErr.Code() == "InvalidParameterValueException" && strings.Contains(awsErr.Message(), "The role defined for the task cannot be assumed by Lambda.") {
|
||||
if awsErr.Code() == "InvalidParameterValueException" && strings.Contains(awsErr.Message(), "cannot be assumed by Lambda.") {
|
||||
log.Printf("[DEBUG] Invalid IAM Instance Profile referenced, retrying...")
|
||||
time.Sleep(2 * time.Second)
|
||||
continue
|
||||
|
Loading…
Reference in New Issue
Block a user