-
Notifications
You must be signed in to change notification settings - Fork 3
Allow backup plans to be unset. #116
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -88,14 +88,15 @@ variable "backup_copy_vault_account_id" { | |
| variable "backup_plan_config" { | ||
| description = "Configuration for backup plans" | ||
| type = object({ | ||
| selection_tag = string | ||
| enable = bool | ||
| selection_tag = optional(string) | ||
| selection_tag_value = optional(string) | ||
| selection_tags = optional(list(object({ | ||
| key = optional(string) | ||
| value = optional(string) | ||
| }))) | ||
| compliance_resource_types = list(string) | ||
| rules = list(object({ | ||
| compliance_resource_types = optional(list(string)) | ||
| rules = optional(list(object({ | ||
| name = string | ||
| schedule = string | ||
| completion_window = optional(number) | ||
|
|
@@ -107,9 +108,10 @@ variable "backup_plan_config" { | |
| copy_action = optional(object({ | ||
| delete_after = optional(number) | ||
| })) | ||
| })) | ||
| }))) | ||
| }) | ||
| default = { | ||
| enable = true | ||
| selection_tag = "BackupLocal" | ||
| selection_tag_value = "True" | ||
| selection_tags = [] | ||
|
|
@@ -165,13 +167,13 @@ variable "backup_plan_config_dynamodb" { | |
| description = "Configuration for backup plans with dynamodb" | ||
| type = object({ | ||
| enable = bool | ||
| selection_tag = string | ||
| selection_tag = optional(string) | ||
| selection_tag_value = optional(string) | ||
| selection_tags = optional(list(object({ | ||
| key = optional(string) | ||
| value = optional(string) | ||
| }))) | ||
| compliance_resource_types = list(string) | ||
| compliance_resource_types = optional(list(string)) | ||
| rules = optional(list(object({ | ||
| name = string | ||
| schedule = string | ||
|
|
@@ -242,13 +244,13 @@ variable "backup_plan_config_ebsvol" { | |
| description = "Configuration for backup plans with EBS" | ||
| type = object({ | ||
| enable = bool | ||
| selection_tag = string | ||
| selection_tag = optional(string) | ||
| selection_tag_value = optional(string) | ||
| selection_tags = optional(list(object({ | ||
| key = optional(string) | ||
| value = optional(string) | ||
| }))) | ||
| compliance_resource_types = list(string) | ||
| compliance_resource_types = optional(list(string)) | ||
| rules = optional(list(object({ | ||
| name = string | ||
| schedule = string | ||
|
|
@@ -306,8 +308,8 @@ variable "backup_plan_config_aurora" { | |
| description = "Configuration for backup plans with aurora" | ||
| type = object({ | ||
| enable = bool | ||
| selection_tag = string | ||
| compliance_resource_types = list(string) | ||
| selection_tag = optional(string) | ||
| compliance_resource_types = optional(list(string)) | ||
| restore_testing_overrides = optional(string) | ||
| rules = optional(list(object({ | ||
| name = string | ||
|
|
@@ -366,7 +368,7 @@ variable "backup_plan_config_parameter_store" { | |
| description = "Configuration for backup plans with parameter store" | ||
| type = object({ | ||
| enable = bool | ||
| selection_tag = string | ||
| selection_tag = optional(string) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can't be optional, would fail on aws_backup_framework creation as tag keys can't be null
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It can, if there's a
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The default would only work if backup_plan_config isn't passed, if backup_plan_config is passed but without selection_tag it would read it as null
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But that's true for all the other
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see the requirement for optional in the scenario where the enable is set to false. some of the keys need to be set when enable is set to true, or terraform will fail. would it be possible to add those defaults on the optional. so optional(string, "default") to add that fallback
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's the point of this PR, to allow these (all) to be unset, and then their |
||
| selection_tag_value = optional(string) | ||
| selection_tags = optional(list(object({ | ||
| key = optional(string) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.