The solution backups all Terraform Cloud's workspaces' states in case of an accedential deletion.
- AWS credentials
- Terraform Cloud Token to allow to call the API
- fully automated
- CRON expression allows individual time for backup
- State backups of all Terraform Organizations' workspaces' are taken and stored in S3
- Report is sent to provided email addresses via SNS
- States may be replicated to another AWS account
An example can be found in ./examples
.
Name | Version |
---|---|
aws | >= 4.0.0 |
Name | Version |
---|---|
archive | 2.2.0 |
aws | 4.12.1 |
No modules.
Name | Description | Type | Default | Required |
---|---|---|---|---|
aws_region | AWS region | string |
"eu-central-1" |
no |
cw_cron_expression | Cron job to schedule the state backup | string |
"cron(0 23 * * ? *)" |
no |
default_tags | Tags to apply to all resources | map(any) |
{} |
no |
kms_destination_arn | KMS key arn in for repilcation s3 destination | string |
"" |
no |
kms_key_alias | KMS key alias | string |
"" |
no |
s3_destination_arn | S3 destination arn for object replication | string |
"" |
no |
s3_force_destroy | Force destruction of S3 bucket by emptying it | bool |
false |
no |
s3_versioning_is_enabled | Enable/Disable versioning for s3 | bool |
true |
no |
sns_email_addresses | List of email addresses to send reports to | list(string) |
[] |
no |
state_backup_retention_time | Retention time in days for state backup | number |
30 |
no |
subnet_ids | List of subnet ids if creating vpc vonfig for lambdas | list(string) |
[] |
no |
tfc_ssl_verify | Enable HTTPS | bool |
true |
no |
tfc_token | Token for authenticating against Terraform Cloud | string |
n/a | yes |
tfc_url | URL of the Terraform host | string |
"https://app.terraform.io" |
no |
vpc_id | VPC id if creating vpc config for lambdas | string |
"" |
no |
Name | Description |
---|---|
s3_bucket | Name of the S3 bucket for state backups |
s3_replication_role_arn | Role ARN for object replication |
sfn_state_machine_arn | ARN of the sfn state machine |
sns_topic_arn | ARN of the sns topic |