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

target_vault_name reference a resource not a variable #2

Merged
merged 8 commits into from
Nov 13, 2020
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Change Log

All notable changes to this project will be documented in this file.

<a name="1.0.0"></a>
## 1.0.0 - 2020-11-09

- Complete AWS Backup module ([#1](https://github.com/umotif-public/terraform-aws-backup/issues/1))
- Initial commit


[Unreleased]: https://github.com/umotif-public/terraform-aws-backup/compare/1.0.0...HEAD
4 changes: 3 additions & 1 deletion examples/external-vault/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,6 @@ module "backup" {
tags = {
Environment = "test"
}
}

depends_on = [aws_backup_vault.external_vault]
}
4 changes: 3 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ resource "aws_backup_plan" "main" {
for_each = var.rules
content {
rule_name = lookup(rule.value, "name")
target_vault_name = lookup(rule.value, "target_vault_name", null) == null ? var.vault_name : lookup(rule.value, "target_vault_name", "Default")
target_vault_name = lookup(rule.value, "target_vault_name", "Default")
Ohid25 marked this conversation as resolved.
Show resolved Hide resolved
schedule = lookup(rule.value, "schedule", null)
start_window = lookup(rule.value, "start_window", null)
completion_window = lookup(rule.value, "completion_window", null)
Expand Down Expand Up @@ -59,6 +59,8 @@ resource "aws_backup_plan" "main" {
}

tags = var.tags

depends_on = [aws_backup_vault.main]
}

#####
Expand Down