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

fix: Remove hardcoded aws partition in notifications sub-module #165

Merged
merged 4 commits into from
Jun 14, 2022
Merged

Conversation

matt-empson
Copy link
Contributor

@matt-empson matt-empson commented Jun 14, 2022

Description

In the notifications sub-module, the AWS partition in local.bucket_arn, is hardcoded to "aws". When deploying this module in China regions, with create_sqs_policy set to true, it fails with the error:

Error: error putting S3 Bucket Notification Configuration: InvalidArgument: Unable to validate the following destination configurations

This change replaces the hardcoded value with a data source to make it dynamic and allows for successful deployment in China.

Motivation and Context

To fix error messages when deploying to AWS China.

Fixes #159

Breaking Changes

No, this is a non-breaking change.

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects

Existing notifications example deployed prior to my changes. Updated module with my changes and re-deployed, Terraform reported no changes required.

Added China-specific resources to the example, behind a conditional check. Deployed resources to cn-north-1 region with my changes and I no longer get any errors.

  • I have executed pre-commit run -a on my pull request

@matt-empson matt-empson changed the title Remove hardcoded aws partition in notifications sub-module fix: Remove hardcoded aws partition in notifications sub-module Jun 14, 2022
Copy link
Member

@antonbabenko antonbabenko left a comment

Choose a reason for hiding this comment

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

LGTM, but please revert all changes in the examples directory.

@matt-empson
Copy link
Contributor Author

LGTM, but please revert all changes in the examples directory.

No worries, changes to examples reverted.

@matt-empson matt-empson requested a review from antonbabenko June 14, 2022 09:21
@antonbabenko antonbabenko merged commit c51db21 into terraform-aws-modules:master Jun 14, 2022
antonbabenko pushed a commit that referenced this pull request Jun 14, 2022
### [3.2.4](v3.2.3...v3.2.4) (2022-06-14)

### Bug Fixes

* Remove hardcoded aws partition in notifications sub-module ([#165](#165)) ([c51db21](c51db21))
@antonbabenko
Copy link
Member

This PR is included in version 3.2.4 🎉

@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 Oct 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Notifications submodule buckets ARN generation in alternate partitions (e.g. GovCloud)
2 participants