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

feat: Change final_snapshot_identifier when snapshot_identifier changes #591

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vincentclee
Copy link

@vincentclee vincentclee commented Apr 4, 2025

Description

This change modifies the random_id.snapshot_identifier resource to include var.snapshot_identifier in the keepers block. This ensures that when the snapshot_identifier input changes, a new final_snapshot_identifier is generated accordingly.

Motivation and Context

Previously, changes to the snapshot_identifier input did not trigger regeneration of the final snapshot identifier. This could lead to the DBSnapshotAlreadyExists error during the deletion of a DB instance. Including snapshot_identifier in the keepers ensures the final snapshot is uniquely tied to the correct input, improving consistency and reliability.

Breaking Changes

No, this change is backward compatible with existing configurations. However, users should be aware that any change to the snapshot_identifier input will now result in a new final_snapshot_identifier.

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
  • I have executed pre-commit run -a on my pull request

Run 0

module "database" {
  source = "../../terraform-aws-rds-vincentclee"

  identifier = "vlee"
...
}

Run 1

module "database" {
  source = "../../terraform-aws-rds-vincentclee"

  identifier          = "vlee"
  snapshot_identifier = "final-vlee-ebd61569"
...
}

Run 2

module "database" {
  source = "../../terraform-aws-rds-vincentclee"

  identifier          = "vlee"
  snapshot_identifier = "final-vlee-5f3f46f8"
...
}

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

Successfully merging this pull request may close these issues.

1 participant