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

Allow explicitly naming parameter group, so that Blue Green upgrades can be done across major versions #225

Open
philomory opened this issue Aug 19, 2024 · 1 comment

Comments

@philomory
Copy link

Describe the Feature

We would like to be able to explicitly specify the names of the parameter groups created by this module

Expected Behavior

We need to be able to explicitly set the name of the parameter groups created by this module.

Use Case

We are performing a Blue/Green upgrade on our Aurora MySQL database, moving from MySQL 5.7-compatible Aurora to MySQL 8.x-compatible Aurora. To do so, we had to create a new 8.x-compatible parameter group to attach to the green cluster and instances. Since the two parameter groups need to exist concurrently, the new parameter group must have a different name than the original one.

Once we have completed the Blue/Green upgrade, however, if we use terraform state rm to remove the old parameter group from state, and terraform state import to add the new one in its place, the module forces a replacement because the name is incorrect.

Describe Ideal Solution

The ideal solution would be to be able to explicitly specify the name of the parameter group, overriding the module's calculated name.

Alternatives Considered

We basically have two alternatives:

  1. We can create a fork of the module that allows us to explicitly set the parameter group name.
  2. After completing the Blue/Green upgrade, we can remove the original blue parameter group, and then allow terraform to perform a replacement of the new parameter group, creating a new one matching the original naming scheme. Of course, syncing a new parameter group forced a cluster reboot, generating downtime, which somewhat defeats (part of) the purpose of doing a Blue/Green upgrade to begin with.

Additional Context

No response

@nitrocode
Copy link
Member

Makes sense to me. I think all names should be overridable when it comes to upgrades and migrating existing resources to terraform modules

There are two parameter groups so each would need its own input

resource "aws_rds_cluster_parameter_group" "default" {
count = local.enabled ? 1 : 0
name_prefix = var.parameter_group_name_prefix_enabled ? "${module.this.id}${module.this.delimiter}" : null
name = !var.parameter_group_name_prefix_enabled ? module.this.id : null

resource "aws_db_parameter_group" "default" {
count = local.enabled ? 1 : 0
name_prefix = var.parameter_group_name_prefix_enabled ? "${module.this.id}${module.this.delimiter}" : null
name = !var.parameter_group_name_prefix_enabled ? module.this.id : null

Have you considered putting in a pr?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants