Add the infrastructure required to process AWS support emails and post newly exposed AWS API key tokens to the corresponding tokens server.
Types of changes
What types of changes does your code introduce to this repository?
[x] New feature (non-breaking change which adds functionality)
Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.
[x] Lint and unit tests pass locally with my changes (if applicable)
[x] I have run pre-commit (pre-commit in the repo)
[x] I have added tests that prove my fix is effective or that my feature works
Testing
Manual tests
I applied the terraform config to my dev account in multiple different configurations to test the processing and error handling. tokens_post_url_override was set to a webhook.site URL to check POSTs.
Manually ran lambda and verified that the correct items were processed and POSTed to the webhook.site URL and saved in DynamoDB
Manually ran lambda again and verified that the already processed items were skipped
Applied the config with tokens_servers_allow_list set to a different server. Manually ran the lambda and verified that items were skipped because their tokens server wasn't in the allow list
Added incorrect Zendesk auth data. Manually ran lambda and verified that ticket was created.
Changed webhook.site URL to return 400. Manually ran lambda and verified that ticket was created and that item was not marked as processed in DynamoDB
Changed schedule expression to every 5 minutes. Checked cloud trail logs to verify that lambda was triggered twice in 10 minutes and ran successfully.
Proposed changes
Add the infrastructure required to process AWS support emails and post newly exposed AWS API key tokens to the corresponding tokens server.
Types of changes
What types of changes does your code introduce to this repository?
Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.pre-commit
in the repo)Testing
Manual tests
I applied the terraform config to my dev account in multiple different configurations to test the processing and error handling.
tokens_post_url_override
was set to a webhook.site URL to check POSTs.tokens_servers_allow_list
set to a different server. Manually ran the lambda and verified that items were skipped because their tokens server wasn't in the allow listUnit tests
I ran the lambda-specific unit tests: