Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore error caused by IAM propagation during lambda event source mapping creation #20229

Merged
merged 2 commits into from
Jul 19, 2021
Merged

Ignore error caused by IAM propagation during lambda event source mapping creation #20229

merged 2 commits into from
Jul 19, 2021

Conversation

jiashuChen
Copy link
Contributor

@jiashuChen jiashuChen commented Jul 19, 2021

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

As part of change in this pull request #14042, the lambda event source mapping creation behaviour has changed from ignoring all InvalidParameterValueException to ignoring a subset of InvalidParameterValueException error caused by IAM propagation.

The new whitelist does not cover all edge cases. This causes the following error when creating a lambda event source on a new lambda function and execution role.

╷
│ Error: error creating Lambda Event Source Mapping (KINESIS STREAM ARN): InvalidParameterValueException: Cannot access stream KINESIS STREAM ARN. Please ensure the role can perform the GetRecords, GetShardIterator, DescribeStream, ListShards, and ListStreams Actions on your stream in IAM.
│ {
│   RespMetadata: {
│     StatusCode: 400,
│     RequestID: "REQUEST ID"
│   },
│   Message_: "Cannot access stream KINESIS STREAM ARN. Please ensure the role can perform the GetRecords, GetShardIterator, DescribeStream, ListShards, and ListStreams Actions on your stream in IAM.",
│   Type: "User"
│ }
│ 

I can see we have another pull request here #19425 fixing an similar issue #14042

@jiashuChen jiashuChen marked this pull request as draft July 19, 2021 05:29
@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/lambda Issues and PRs that pertain to the lambda service. size/XS Managed by automation to categorize the size of a PR. and removed service/lambda Issues and PRs that pertain to the lambda service. labels Jul 19, 2021
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome @jiashuChen 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@jiashuChen jiashuChen marked this pull request as ready for review July 19, 2021 05:45
… when creating lambda event source mapping with kinesis stream
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Jul 19, 2021
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀.

Commercial
% make testacc TESTARGS='-run=TestAccAWSLambdaEventSourceMapping_Kinesis_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSLambdaEventSourceMapping_Kinesis_ -timeout 180m
=== RUN   TestAccAWSLambdaEventSourceMapping_Kinesis_basic
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_basic
=== RUN   TestAccAWSLambdaEventSourceMapping_Kinesis_StartingPositionTimestamp
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_StartingPositionTimestamp
=== RUN   TestAccAWSLambdaEventSourceMapping_Kinesis_BatchWindow
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_BatchWindow
=== RUN   TestAccAWSLambdaEventSourceMapping_Kinesis_ParallelizationFactor
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_ParallelizationFactor
=== RUN   TestAccAWSLambdaEventSourceMapping_Kinesis_TumblingWindowInSeconds
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_TumblingWindowInSeconds
=== RUN   TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttempts
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttempts
=== RUN   TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsZero
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsZero
=== RUN   TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsNegativeOne
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsNegativeOne
=== RUN   TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSeconds
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSeconds
=== RUN   TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSecondsNegativeOne
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSecondsNegativeOne
=== RUN   TestAccAWSLambdaEventSourceMapping_Kinesis_BisectBatch
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_BisectBatch
=== RUN   TestAccAWSLambdaEventSourceMapping_Kinesis_DestinationConfig
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_DestinationConfig
=== CONT  TestAccAWSLambdaEventSourceMapping_Kinesis_basic
=== CONT  TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsNegativeOne
=== CONT  TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttempts
=== CONT  TestAccAWSLambdaEventSourceMapping_Kinesis_TumblingWindowInSeconds
=== CONT  TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsZero
=== CONT  TestAccAWSLambdaEventSourceMapping_Kinesis_BisectBatch
=== CONT  TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSecondsNegativeOne
=== CONT  TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSeconds
=== CONT  TestAccAWSLambdaEventSourceMapping_Kinesis_ParallelizationFactor
=== CONT  TestAccAWSLambdaEventSourceMapping_Kinesis_BatchWindow
=== CONT  TestAccAWSLambdaEventSourceMapping_Kinesis_DestinationConfig
=== CONT  TestAccAWSLambdaEventSourceMapping_Kinesis_StartingPositionTimestamp
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_StartingPositionTimestamp (75.12s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_ParallelizationFactor (91.37s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_BatchWindow (97.52s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsNegativeOne (97.78s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_TumblingWindowInSeconds (105.72s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_DestinationConfig (123.65s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSecondsNegativeOne (127.35s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSeconds (131.95s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_BisectBatch (139.78s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_basic (142.82s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttempts (152.04s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsZero (159.12s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	163.153s
GovCloud
% make testacc TESTARGS='-run=TestAccAWSLambdaEventSourceMapping_Kinesis_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSLambdaEventSourceMapping_Kinesis_ -timeout 180m
=== RUN   TestAccAWSLambdaEventSourceMapping_Kinesis_basic
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_basic
=== RUN   TestAccAWSLambdaEventSourceMapping_Kinesis_StartingPositionTimestamp
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_StartingPositionTimestamp
=== RUN   TestAccAWSLambdaEventSourceMapping_Kinesis_BatchWindow
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_BatchWindow
=== RUN   TestAccAWSLambdaEventSourceMapping_Kinesis_ParallelizationFactor
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_ParallelizationFactor
=== RUN   TestAccAWSLambdaEventSourceMapping_Kinesis_TumblingWindowInSeconds
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_TumblingWindowInSeconds
=== RUN   TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttempts
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttempts
=== RUN   TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsZero
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsZero
=== RUN   TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsNegativeOne
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsNegativeOne
=== RUN   TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSeconds
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSeconds
=== RUN   TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSecondsNegativeOne
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSecondsNegativeOne
=== RUN   TestAccAWSLambdaEventSourceMapping_Kinesis_BisectBatch
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_BisectBatch
=== RUN   TestAccAWSLambdaEventSourceMapping_Kinesis_DestinationConfig
=== PAUSE TestAccAWSLambdaEventSourceMapping_Kinesis_DestinationConfig
=== CONT  TestAccAWSLambdaEventSourceMapping_Kinesis_basic
=== CONT  TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsNegativeOne
=== CONT  TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSecondsNegativeOne
=== CONT  TestAccAWSLambdaEventSourceMapping_Kinesis_BisectBatch
=== CONT  TestAccAWSLambdaEventSourceMapping_Kinesis_ParallelizationFactor
=== CONT  TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSeconds
=== CONT  TestAccAWSLambdaEventSourceMapping_Kinesis_BatchWindow
=== CONT  TestAccAWSLambdaEventSourceMapping_Kinesis_DestinationConfig
=== CONT  TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttempts
=== CONT  TestAccAWSLambdaEventSourceMapping_Kinesis_TumblingWindowInSeconds
=== CONT  TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsZero
=== CONT  TestAccAWSLambdaEventSourceMapping_Kinesis_StartingPositionTimestamp
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_StartingPositionTimestamp (89.67s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSecondsNegativeOne (92.48s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_DestinationConfig (94.84s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_TumblingWindowInSeconds (95.56s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_BatchWindow (102.99s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsNegativeOne (112.40s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_BisectBatch (122.44s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttempts (127.66s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_ParallelizationFactor (132.64s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_basic (135.69s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRecordAgeInSeconds (145.70s)
--- PASS: TestAccAWSLambdaEventSourceMapping_Kinesis_MaximumRetryAttemptsZero (157.64s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	160.831s

@ewbankkit
Copy link
Contributor

@jiashuChen Thanks for the contribution 🎉 👏.

@ewbankkit ewbankkit merged commit 84d813c into hashicorp:main Jul 19, 2021
@github-actions github-actions bot added this to the v3.51.0 milestone Jul 19, 2021
@jiashuChen jiashuChen deleted the b-lambda-event-source-map-kinesis branch July 19, 2021 23:23
@github-actions
Copy link

This functionality has been released in v3.51.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/lambda Issues and PRs that pertain to the lambda service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants