diff --git a/builtin/providers/aws/resource_aws_lambda_event_source_mapping.go b/builtin/providers/aws/resource_aws_lambda_event_source_mapping.go index 055c991cc..053b2adaf 100644 --- a/builtin/providers/aws/resource_aws_lambda_event_source_mapping.go +++ b/builtin/providers/aws/resource_aws_lambda_event_source_mapping.go @@ -91,6 +91,13 @@ func resourceAwsLambdaEventSourceMappingCreate(d *schema.ResourceData, meta inte Enabled: aws.Bool(d.Get("enabled").(bool)), } + // IAM profiles and roles can take some time 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 + // function defined for the task cannot be assumed by Lambda. + // + // The role may exist, but the permissions may not have propagated, so we + // retry err := resource.Retry(1*time.Minute, func() error { eventSourceMappingConfiguration, err := conn.CreateEventSourceMapping(params) if err != nil {