From dc8e4e9e74ecf21be9d237f21bc1d436f06ef59e Mon Sep 17 00:00:00 2001 From: Jiashu Chen Date: Mon, 19 Jul 2021 14:45:16 +1000 Subject: [PATCH 1/2] Ignore InvalidParameterValueException error caused by IAM propagation when creating lambda event source mapping with kinesis stream --- .changelog/20229.txt | 3 +++ aws/resource_aws_lambda_event_source_mapping.go | 4 ++++ 2 files changed, 7 insertions(+) create mode 100644 .changelog/20229.txt diff --git a/.changelog/20229.txt b/.changelog/20229.txt new file mode 100644 index 00000000000..e5abd82c049 --- /dev/null +++ b/.changelog/20229.txt @@ -0,0 +1,3 @@ +```release-note:bug +aws/resource_aws_lambda_event_source_mapping: Ignore `InvalidParameterValueException` error caused by IAM propagation when creating lambda event source mapping with kinesis streamstream +``` diff --git a/aws/resource_aws_lambda_event_source_mapping.go b/aws/resource_aws_lambda_event_source_mapping.go index b48c61b646a..a9968884905 100644 --- a/aws/resource_aws_lambda_event_source_mapping.go +++ b/aws/resource_aws_lambda_event_source_mapping.go @@ -388,6 +388,10 @@ func resourceAwsLambdaEventSourceMappingCreate(d *schema.ResourceData, meta inte return resource.RetryableError(err) } + if tfawserr.ErrMessageContains(err, lambda.ErrCodeInvalidParameterValueException, "Please ensure the role can perform") { + return resource.RetryableError(err) + } + if err != nil { return resource.NonRetryableError(err) } From a1db1a8e8fd3f998f85bea14d067a8e2a570df8f Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 19 Jul 2021 09:03:08 -0400 Subject: [PATCH 2/2] Minor CHANGELOG entry edits. --- .changelog/20229.txt | 2 +- aws/resource_aws_lambda_event_source_mapping.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.changelog/20229.txt b/.changelog/20229.txt index e5abd82c049..36326020b2b 100644 --- a/.changelog/20229.txt +++ b/.changelog/20229.txt @@ -1,3 +1,3 @@ ```release-note:bug -aws/resource_aws_lambda_event_source_mapping: Ignore `InvalidParameterValueException` error caused by IAM propagation when creating lambda event source mapping with kinesis streamstream +aws/resource_aws_lambda_event_source_mapping: Ignore `InvalidParameterValueException` error caused by IAM propagation when creating Lambda event source mapping with Kinesis stream source ``` diff --git a/aws/resource_aws_lambda_event_source_mapping.go b/aws/resource_aws_lambda_event_source_mapping.go index a9968884905..cb606aa14f6 100644 --- a/aws/resource_aws_lambda_event_source_mapping.go +++ b/aws/resource_aws_lambda_event_source_mapping.go @@ -388,7 +388,7 @@ func resourceAwsLambdaEventSourceMappingCreate(d *schema.ResourceData, meta inte return resource.RetryableError(err) } - if tfawserr.ErrMessageContains(err, lambda.ErrCodeInvalidParameterValueException, "Please ensure the role can perform") { + if tfawserr.ErrMessageContains(err, lambda.ErrCodeInvalidParameterValueException, "ensure the role can perform") { return resource.RetryableError(err) }