diff --git a/aws/resource_aws_lambda_function.go b/aws/resource_aws_lambda_function.go index 3f57ae7b620..d18377d3ff6 100644 --- a/aws/resource_aws_lambda_function.go +++ b/aws/resource_aws_lambda_function.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) const awsMutexLambdaKey = `aws_lambda_function` @@ -426,8 +427,8 @@ func resourceAwsLambdaFunctionCreate(d *schema.ResourceData, meta interface{}) e params.Tags = keyvaluetags.New(v.(map[string]interface{})).IgnoreAws().LambdaTags() } - // IAM changes can take 1 minute to propagate in AWS - err := resource.Retry(1*time.Minute, func() *resource.RetryError { + // IAM changes can take some time to propagate in AWS + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { _, err := conn.CreateFunction(params) if err != nil { log.Printf("[DEBUG] Error creating Lambda Function: %s", err)