BAU: use well-known for cribl kinesis arns#1842
Conversation
💰 Infracost reportMonthly estimate generatedEstimate details (includes details of unsupported resources and skipped projects due to errors) |
b5b9ff3 to
226680d
Compare
e80e616 to
b4abcf6
Compare
226680d to
2209f2e
Compare
21dbff8 to
a321e98
Compare
There was a problem hiding this comment.
Pull Request Overview
This pull request refactors the Cribl Kinesis logging infrastructure to use a well-known module for managing Kinesis destination ARNs. The change centralizes the destination ARN definitions and removes the need to pass them as variables through multiple layers of the infrastructure code.
Key changes:
- Created a new
well-known/criblmodule that provides Kinesis destination names and ARNs for botheu-west-2andus-east-1regions - Simplified variable interfaces by replacing the
log_to_splunk_settingsobject with a singlekinesis_subscription_role_arnstring variable - Removed hardcoded Kinesis destination ARNs from tfvars files across all environments
Reviewed Changes
Copilot reviewed 41 out of 41 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| infra/modules/well-known/cribl/kinesis.tf | New module defining well-known Kinesis destination names and ARN construction logic |
| infra/modules/ecs-service/logging.tf | Updated to use well-known module for Kinesis destination ARN |
| infra/modules/cloudfront_waf_protection/waf.tf | Updated to use well-known module for Kinesis destination ARN (us-east-1) |
| infra/modules/alb_waf_protection/waf.tf | Updated to use well-known module for Kinesis destination ARN |
| infra/modules/forms-runner/variables.tf | Simplified variable from object to string for kinesis_subscription_role_arn |
| infra/modules/forms-product-page/variables.tf | Simplified variable from object to string for kinesis_subscription_role_arn |
| infra/modules/forms-admin/variables.tf | Simplified variable from object to string for kinesis_subscription_role_arn |
| infra/modules/environment/variables.tf | Simplified variable from object to string for kinesis_subscription_role_arn |
| infra/modules/cloudfront/variables.tf | Simplified variable from object to string for kinesis_subscription_role_arn |
| infra/deployments/integration/account/cloudwatch-log-to-splunk.tf | Converted counted resources to single resources with moved blocks, uses well-known module |
| infra/deployments/integration/account/outputs.tf | Removed kinesis_destination_arn outputs (but contains bug with [0] index) |
| infra/deployments/integration/account/inputs.tf | Removed kinesis_destination_arn input variables |
| infra/deployments/integration/tfvars/integration.tfvars | Removed hardcoded Kinesis destination ARNs |
| infra/deployments/integration/review/logging.tf | Updated to use well-known module for Kinesis destination ARN |
| infra/deployments/integration/review/cloudfront.tf | Updated module call to pass kinesis_subscription_role_arn directly |
| infra/deployments/integration/review/alb/waf.tf | Updated module call to pass kinesis_subscription_role_arn directly |
| infra/deployments/forms/account/cloudwatch-log-to-splunk.tf | Converted counted resources to single resources with moved blocks, uses well-known module |
| infra/deployments/forms/account/outputs.tf | Removed kinesis_destination_arn outputs (but contains bug with [0] index) |
| infra/deployments/forms/account/inputs.tf | Removed kinesis_destination_arn input variables |
| infra/deployments/forms/account/tfvars/*.tfvars | Removed hardcoded Kinesis destination ARNs from all environment tfvars files |
| infra/deployments/forms/environment/main.tf | Updated module call to pass kinesis_subscription_role_arn directly |
| infra/deployments/forms/forms-admin/main.tf | Updated module call to pass kinesis_subscription_role_arn directly |
| infra/deployments/forms/forms-product-page/main.tf | Updated module call with simplified variable |
| infra/deployments/forms/forms-runner/main.tf | Updated module call with simplified variable |
| infra/deployments/deploy/tools/log_to_splunk/outputs.tf | Removed destination_arn outputs |
| infra/deployments/deploy/tools/log_to_splunk/kinesis-stream.tf | Updated to use well-known module for destination names |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
503bed5 to
d0e36a8
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 41 out of 41 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d0e36a8 to
0e5ba91
Compare
2209f2e to
762f235
Compare
0e5ba91 to
ad427c0
Compare
We were passing around a lot of ARNs for the CloudWatch Log Destinations as tfvars, which were all the same string. Instead, use a well-known module to create and reference these resources.
ad427c0 to
0b346b0
Compare
sarahseewhy
left a comment
There was a problem hiding this comment.
I'm a bit late to the well-known module so I appreciate I may lack some context.
I'd like to propose a name change to the module to align it with the existing module naming convention (service-oriented nouns): canonical-identifiers or shared-identifiers.
For example: module.canonical-identifiers.kinesis_destination_names["eu-west-2"]
As I understand it, based on the helpful README (thank you!), the purpose of the well-known module is a central catalogue of canonical identifiers (names/ARNs/IDs) that are shared across environments, with lookup via outputs instead of repeated in each environment’s tfvars.
I know a request for this kind of change is a pain and I do apologise -- I'm also happy to chat about it if that would help. Maybe this is a drop in the bucket for having a forms-deploy style guide.
We had a really good chat in stand-up about the naming and I retract my proposal. Instead, I'm going to update the directory README to include a section on why we named it |
sarahseewhy
left a comment
There was a problem hiding this comment.
Thanks for the extra context in stand-up!
What problem does this pull request solve?
Things to consider when reviewing
Reminders
If you've made changes to the deployer role (files in
modules/deployer-access):make <environment> forms/account applyon the relevant environments (dev,staging,user-research, and/orprod)apply-forms-terraform-<environment>pipelines have run successfully