Skip to content

feat: Allow resource names to be overridden when installing top-level module #85

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

Merged

Conversation

yotamat
Copy link
Contributor

@yotamat yotamat commented Mar 10, 2025

Fix violation of IAM naming constraints with postgresql in v1.3.1

Fixes the following error when using "postgresql" as db_engine:

Error: expected length of name to be in the range (1 - 64), got honeycomb-rds-cloudwatch-logs-honeycomb-rds-postgresql-log-parser

  with module.honeycomb-aws-integrations.module.rds_logs[0].module.rds_lambda_transform[0].aws_iam_role.lambda[0],
  on .terraform/modules/honeycomb-aws-integrations.rds_logs.rds_lambda_transform/iam.tf line 97, in resource "aws_iam_role" "lambda":
  97:   name                  = local.role_name

Reproduction

To reproduce the original error:

  1. Deploy the main wrapper module using v1.3.1 as described in documentation here.
  2. Set rds_db_engine = "postgresql".
  3. Observe IAM naming constraints being exceeded on first deployment

Solution

Extracted hardcoded resource names to allow configurable variables with backward-compatible defaults.

Changes

Extracted hardcoded "honeycomb-..." resource names to variables with configurable defaults:

  • cloudwatch_logs_name
  • rds_logs_name
  • cloudwatch_metrics_name
  • s3_logfile_name

rds_logs module variable `name` defaults to
honeycomb-rds-cloudwatch-logs, which leads to IAM names >64 characters
when used with `postgresql` DB engine name.

Exposed the name variables to allow external usage of the module with
flexible naming conventions.
@yotamat yotamat requested a review from a team as a code owner March 10, 2025 15:58
Copy link
Contributor

@MikeGoldsmith MikeGoldsmith left a comment

Choose a reason for hiding this comment

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

Looks great, thank you @yotamat 🎉

@MikeGoldsmith MikeGoldsmith changed the title Fix violation of IAM naming constraints in 1.3.1 when working with postgresql feat: Allow resource names to be overridden when installing top-level module Mar 18, 2025
@MikeGoldsmith MikeGoldsmith self-assigned this Mar 18, 2025
@MikeGoldsmith MikeGoldsmith added the type: enhancement New feature or request label Mar 18, 2025
@MikeGoldsmith MikeGoldsmith merged commit b2c640b into honeycombio:main Mar 18, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants