From e149fbcc20344cb00eeb24fb713363e4901280a6 Mon Sep 17 00:00:00 2001 From: lucasmacedot Date: Thu, 7 Nov 2024 19:59:34 -0400 Subject: [PATCH] add: outputs --- _locals.tf | 2 +- _outputs.tf | 7 +++++++ _versions.tf | 7 +++++++ main.tf | 1 - variables.tf | 18 +++++++++--------- 5 files changed, 24 insertions(+), 11 deletions(-) create mode 100644 _outputs.tf create mode 100644 _versions.tf diff --git a/_locals.tf b/_locals.tf index 53f518f..0baf774 100644 --- a/_locals.tf +++ b/_locals.tf @@ -3,4 +3,4 @@ locals { workload = "workload" backup = "backup" } -} \ No newline at end of file +} diff --git a/_outputs.tf b/_outputs.tf new file mode 100644 index 0000000..d064bc7 --- /dev/null +++ b/_outputs.tf @@ -0,0 +1,7 @@ +output "vault_arn" { + value = aws_backup_vault.backup_vault.arn +} + +output "plan_id" { + value = aws_backup_plan.backup_plan.id +} diff --git a/_versions.tf b/_versions.tf new file mode 100644 index 0000000..f2702bf --- /dev/null +++ b/_versions.tf @@ -0,0 +1,7 @@ +terraform { + required_providers { + aws = { + source = "hashicorp/aws" + } + } +} diff --git a/main.tf b/main.tf index bfd9cc0..aec6065 100644 --- a/main.tf +++ b/main.tf @@ -1,4 +1,3 @@ -# AWS Backup vault resource "aws_backup_vault" "backup_vault" { name = "${var.name}-vault" kms_key_arn = var.vault_kms_key_arn diff --git a/variables.tf b/variables.tf index dde9988..ede6d99 100644 --- a/variables.tf +++ b/variables.tf @@ -153,19 +153,19 @@ variable "changeable_for_days" { variable "rules" { description = "List of backup rules" -type = list(object({ - rule_name = string - schedule = optional(string) - start_window = optional(number, 60) - completion_window = optional(number, 120) - enable_continuous_backup = optional(bool, false) - lifecycle = optional(object({ + type = list(object({ + rule_name = string + schedule = optional(string) + start_window = optional(number, 60) + completion_window = optional(number, 120) + enable_continuous_backup = optional(bool, false) + lifecycle = optional(object({ cold_storage_after = optional(number) delete_after = optional(number, 30) })) })) default = [{ - rule_name = "backup-rule" + rule_name = "backup-rule" }] } @@ -173,4 +173,4 @@ variable "enabled" { description = "Change to false to avoid deploying any AWS Backup resources" type = bool default = true -} \ No newline at end of file +}