terraform-aws-rds-aurora icon indicating copy to clipboard operation
terraform-aws-rds-aurora copied to clipboard

KMS_KEY_ID recreates database everytime

Open sabinayakc opened this issue 1 year ago β€’ 1 comments

How do we solve the problem of kms_key_id field?

When creating the rds for the first time kms_key_id = arn.

image

Then running terraform again, kms_key_id = is not the id and hence it force replaces. since arn is being passed.

Is there a way we could add a ignore change lifecyle for the kms_key_id

I can create a PR if you'd like.

Thank you.

sabinayakc avatar Sep 09 '24 16:09 sabinayakc

I guess it would be possible to use a lifecycle hook to ignore changes, but to be honest the issue here is that you're passing a ID not an ARN, so the setting was never valid and in that case ignoring the change seems misguided at best, and pointless at worst.

The preferred solution would be to distroy the instance, and recreate it with a correctly-specified ARN. Or if your DB is in-use and cannot be replaced then don't update the ARN leaving it without encryption at rest.

skx avatar Sep 26 '24 11:09 skx

This issue has been automatically marked as stale because it has been open 30 days with no activity. Remove stale label or comment or this issue will be closed in 10 days

github-actions[bot] avatar Oct 27 '24 00:10 github-actions[bot]

This issue was automatically closed because of stale in 10 days

github-actions[bot] avatar Nov 07 '24 00:11 github-actions[bot]

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

github-actions[bot] avatar Dec 07 '24 02:12 github-actions[bot]