-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new resource aws_backup_vault_lock_configuration
A vault lock helps protect backups from lifecycle changes, accidental deletion, or malicious activities. Closes #71
- Loading branch information
Showing
8 changed files
with
167 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Simple plan using lists | ||
|
||
This example shows you how to create a simple plan using lists instead of variables: | ||
|
||
``` | ||
module "aws_backup_example" { | ||
source = "lgallard/backup/aws" | ||
# Vault | ||
vault_name = "vault-1" | ||
# Vault lock configuration | ||
locked = true | ||
changeable_for_days = 3 | ||
max_retention_days = 1200 | ||
min_retention_days = 7 | ||
# Plan | ||
plan_name = "simple-plan-list" | ||
# One rule using a list of maps | ||
rules = [ | ||
{ | ||
name = "rule-1" | ||
schedule = "cron(0 12 * * ? *)" | ||
start_window = 120 | ||
completion_window = 360 | ||
enable_continuous_backup = true | ||
lifecycle = { | ||
cold_storage_after = 0 | ||
delete_after = 90 | ||
}, | ||
recovery_point_tags = { | ||
Environment = "production" | ||
} | ||
}, | ||
] | ||
# One selection using a list of maps | ||
selections = [ | ||
{ | ||
name = "selection-1" | ||
resources = ["arn:aws:dynamodb:us-east-1:123456789101:table/mydynamodb-table1"] | ||
selection_tags = { | ||
type = "STRINGEQUALS" | ||
key = "Environment" | ||
value = "production" | ||
} | ||
}, | ||
{ | ||
name = "selection-2" | ||
resources = ["arn:aws:dynamodb:us-east-1:123456789101:table/mydynamodb-table2"] | ||
}, | ||
] | ||
tags = { | ||
Owner = "devops" | ||
Environment = "production" | ||
Terraform = true | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
module "aws_backup_example" { | ||
|
||
source = "lgallard/backup/aws" | ||
|
||
# Vault | ||
vault_name = "vault-1" | ||
|
||
# Vault lock configuration | ||
locked = true | ||
changeable_for_days = 3 | ||
max_retention_days = 1200 | ||
min_retention_days = 7 | ||
|
||
# Plan | ||
plan_name = "simple-plan-list" | ||
|
||
# One rule using a list of maps | ||
rules = [ | ||
{ | ||
name = "rule-1" | ||
schedule = "cron(0 12 * * ? *)" | ||
start_window = 120 | ||
completion_window = 360 | ||
enable_continuous_backup = true | ||
lifecycle = { | ||
cold_storage_after = 0 | ||
delete_after = 90 | ||
}, | ||
recovery_point_tags = { | ||
Environment = "production" | ||
} | ||
}, | ||
] | ||
|
||
# One selection using a list of maps | ||
selections = [ | ||
{ | ||
name = "selection-1" | ||
resources = ["arn:aws:dynamodb:us-east-1:123456789101:table/mydynamodb-table"] | ||
}, | ||
] | ||
|
||
tags = { | ||
Owner = "devops" | ||
Environment = "production" | ||
Terraform = true | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
provider "aws" { | ||
region = var.env["region"] | ||
profile = var.env["profile"] | ||
} |
4 changes: 4 additions & 0 deletions
4
examples/simple_plan_using_lock_configuration/terraform.tfvars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
env = { | ||
region = "us-east-1" | ||
profile = "default" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
variable "env" { | ||
type = map(any) | ||
default = {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters