Single CloudWatch logging role for API Gateways #89
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.
API Gateway's CloudWatch logging role is account- and region-specific. This moves that role's creation to a single place rather than in both the cirrus and stac-server module as that leads to constant state drift.
Related issue(s)
Proposed Changes
aws_api_gateway_account
Terraform resource from thestac-server
andcirrus
module since having multiple instances will result in Terraform consistently switching between the two.aws_api_gateway_account
Terraform resource as part of thebase_infra
module such that all modules implementing API Gateways can rely on logging permissions being handled once elsewhere.Testing
This change was validated by the following observations:
Without this change, every
terraform apply
would produce the following state difference (switching betweenstac-server
andcirrus
roles):After applying this commit and redeploying, Terraform correctly reports that no resources have changed for consecutive
apply
's.Checklist