document why we retry in lambda source mapping

This commit is contained in:
clint shryock 2016-01-05 11:27:49 -06:00
parent 6b733a09eb
commit 312f2dd6e3
1 changed files with 7 additions and 0 deletions

View File

@ -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 {