Skip to content

Conversation

@tiagovmvieira
Copy link
Contributor

@tiagovmvieira tiagovmvieira commented Aug 15, 2025

Description

This PR adds support for deletion protection functionality to the table replicas configuration through a new deletion_protection_enabled argument in the aws_dynamodb_table resource block, replica configuation. This feature allows users to enable AWS's built-in deletion protection safeguard for table replicas helping prevent accidental or unauthorized deletion of critical infrastructure.

hashicorp/terraform-provider-aws#43240

Motivation and Context

This feature was recently introduced in the Terraform AWS Provider, allowing users to enable deletion protection on DynamoDB table replicas. Adding support for this new argument ensures that our module stays up to date with the latest capabilities provided by the AWS provider and allows users to take advantage of built-in safeguards to protect critical infrastructure.

This feature was added in terraform-provider-aws v6.9.0, so a provider upgrade in our module must take place.

Breaking Changes

None. This is a backward-compatible addition. The new deletion_protection_enabled argument defaults to false, preserving existing behavior for current module users.

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

@tiagovmvieira
Copy link
Contributor Author

pre-commit hook is failing in the following hook -> terraform_wrapper_module_for_each

main.tf Outdated
kms_key_arn = lookup(replica.value, "kms_key_arn", null)
propagate_tags = lookup(replica.value, "propagate_tags", null)
point_in_time_recovery = lookup(replica.value, "point_in_time_recovery", null)
deletion_protection_enabled = lookup(replica.value, "deletion_protection_enabled", false)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
deletion_protection_enabled = lookup(replica.value, "deletion_protection_enabled", false)
deletion_protection_enabled = lookup(replica.value, "deletion_protection_enabled", null)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion. Updated accordingly ;)

@tiagovmvieira
Copy link
Contributor Author

@bryantbiggs may I get your approval in here?

@tiagovmvieira
Copy link
Contributor Author

@antonbabenko may I get your approval in here?

@bryantbiggs bryantbiggs merged commit b45a0b6 into terraform-aws-modules:master Aug 26, 2025
9 checks passed
antonbabenko pushed a commit that referenced this pull request Aug 26, 2025
## [5.1.0](v5.0.0...v5.1.0) (2025-08-26)

### Features

* Add support for deletion protection functionality to table repl… ([#105](#105)) ([b45a0b6](b45a0b6))
@antonbabenko
Copy link
Member

This PR is included in version 5.1.0 🎉

@tiagovmvieira
Copy link
Contributor Author

Thanks for your help @bryantbiggs and @antonbabenko
Happy to contribute :)

@github-actions
Copy link

I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants