fix(job-retry): wait for IAM policy before creating SQS event source mapping#5098
Open
phergoualch wants to merge 1 commit intogithub-aws-runners:mainfrom
Open
Conversation
Member
|
I have no seen this problem, can you give a bit more details on what type of configuration is causing this. I not had this problem with the multi-runner setup. As far I see terraform should calculate the dependency |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5097
Summary
Problem
When
job_retryis enabled, Terraform creates the retry queue, retry Lambda, retry role, retry IAM policy, and event source mapping in the same apply.The retry IAM policy already contains the correct queue permissions, but the event source mapping did not explicitly depend on that policy resource. As a result, AWS could validate the Lambda execution role before the policy was attached and reject the mapping with:
In my case this was consistently reproducible. Apply failed every time before this change.
Change
This PR adds:
to
aws_lambda_event_source_mapping.job_retryinmodules/runners/job-retry/main.tf.Result
With this change in place, I was able to apply the same configuration successfully without the event source mapping errors.
Why this is safe