Skip to content

Commit

Permalink
r/aws_lambda_event_source_mapping: Focus Create retry on IAM propagat…
Browse files Browse the repository at this point in the history
…ion errors only (hashicorp#14042).
  • Loading branch information
ewbankkit committed May 27, 2021
1 parent 31540bf commit 64c6e05
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions aws/resource_aws_lambda_event_source_mapping.go
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ func resourceAwsLambdaEventSourceMappingCreate(d *schema.ResourceData, meta inte
err = resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError {
eventSourceMappingConfiguration, err = conn.CreateEventSourceMapping(input)

if tfawserr.ErrCodeEquals(err, lambda.ErrCodeInvalidParameterValueException) {
if tfawserr.ErrMessageContains(err, lambda.ErrCodeInvalidParameterValueException, "cannot be assumed by Lambda") {
return resource.RetryableError(err)
}

Expand Down Expand Up @@ -497,10 +497,6 @@ func resourceAwsLambdaEventSourceMappingUpdate(d *schema.ResourceData, meta inte
err := resource.Retry(waiter.EventSourceMappingPropagationTimeout, func() *resource.RetryError {
_, err := conn.UpdateEventSourceMapping(input)

if tfawserr.ErrCodeEquals(err, lambda.ErrCodeInvalidParameterValueException) {
return resource.RetryableError(err)
}

if tfawserr.ErrCodeEquals(err, lambda.ErrCodeResourceInUseException) {
return resource.RetryableError(err)
}
Expand Down

0 comments on commit 64c6e05

Please sign in to comment.