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(backup): Add vault lock configuration #4

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Balsir
Copy link

@Balsir Balsir commented Dec 18, 2024

Description

Add vault lock configuration

Type of change

  • A bug fix (PR prefix fix)
  • A new feature (PR prefix feat)
  • A code change that neither fixes a bug nor adds a feature (PR prefix refactor)
  • Adding missing tests or correcting existing tests (PR prefix test)
  • Changes that do not affect the meaning of the code like white-spaces, formatting, missing semi-colons, etc. (PR prefix style)
  • Changes to our CI configuration files and scripts (PR prefix ci)
  • Documentation only changes (PR prefix docs)

How Has This Been Tested?

@Balsir Balsir requested a review from jaygridley December 18, 2024 19:19
@Balsir Balsir self-assigned this Dec 18, 2024
variables.tf Outdated Show resolved Hide resolved
variables.tf Show resolved Hide resolved
@@ -127,3 +135,11 @@ resource "aws_backup_vault_policy" "target" {
backup_vault_name = aws_backup_vault.target[0].name
policy = data.aws_iam_policy_document.target_vault[0].json
}

resource "aws_backup_vault_lock_configuration" "target" {
count = var.enabled && var.is_cross_account_backup_enabled && var.vault_lock_enabled ? 1 : 0
Copy link
Member

Choose a reason for hiding this comment

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

Would it make sense to have vault lock enabled only in the target account, but not in the source one? If so, can we add support for this setup?

Copy link
Author

Choose a reason for hiding this comment

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

Personally, I would only have this module handle just one vault, and have source/target replication handled in the integration via 2 module calls and extra params.

I haven't found any evidence as to how Backup behaves if lock is enabled only on one side, but yeah, we can split the config.

Co-authored-by: Martin Odstrčilík <[email protected]>
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.

2 participants