UPD: Adding input of backup-rule-cron

This commit is contained in:
xpk 2024-04-29 14:30:22 +08:00
parent c9b2d250fb
commit 6e3067d8d9
Signed by: xpk
GPG Key ID: CD4FF6793F09AB86
3 changed files with 15 additions and 10 deletions

View File

@ -32,9 +32,9 @@ No modules.
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| backup-plan-cron | n/a | `string` | `"cron(0 20 * * ? *)"` | no |
| backup-plan-name | n/a | `any` | n/a | yes |
| backup-plan-retention | n/a | `any` | n/a | yes |
| backup-plan-name | Backup plan name | `string` | n/a | yes |
| backup-plan-retention | Backup retention period | `number` | n/a | yes |
| backup-rule-cron | Backup rule cron expression | `string` | n/a | yes |
| opt-in-aurora | Opt in audora backup | `bool` | n/a | yes |
| opt-in-dynamodb | Opt in dynamodb backup | `bool` | n/a | yes |
| opt-in-ebs | Opt in ebs backup | `bool` | n/a | yes |

View File

@ -69,7 +69,7 @@ resource "aws_backup_plan" "ab-plan" {
rule {
rule_name = var.backup-plan-name
target_vault_name = each.value.name
schedule = var.backup-plan-cron
schedule = var.backup-rule-cron
start_window = 60
completion_window = 240

View File

@ -1,12 +1,17 @@
variable "backup-plan-name" {}
variable "backup-plan-cron" {
variable "backup-plan-name" {
type = string
default = "cron(0 20 * * ? *)"
# cron(Minutes Hours Day-of-month Month Day-of-week Year)
description = "Backup plan name"
}
variable "backup-plan-retention" {}
variable "backup-rule-cron" {
type = string
description = "Backup rule cron expression"
}
variable "backup-plan-retention" {
type = number
description = "Backup retention period"
}
variable "opt-in-aurora" {
type = bool