From c9b2d250fb0b0deb1b8a1c6f7ebd2d1ef4fc47cd Mon Sep 17 00:00:00 2001 From: xpk Date: Mon, 29 Apr 2024 14:25:25 +0800 Subject: [PATCH] UPD: updated awsbackup module --- modules/storage/aws-backup/README.md | 58 ++++++++++ modules/storage/aws-backup/awsbackup.tf | 117 -------------------- modules/storage/aws-backup/kms-key.tf | 80 +++++--------- modules/storage/aws-backup/main.tf | 137 ++++++++++++++++++++++++ modules/storage/aws-backup/variables.tf | 67 ++++++++++-- 5 files changed, 284 insertions(+), 175 deletions(-) create mode 100644 modules/storage/aws-backup/README.md delete mode 100644 modules/storage/aws-backup/awsbackup.tf create mode 100644 modules/storage/aws-backup/main.tf diff --git a/modules/storage/aws-backup/README.md b/modules/storage/aws-backup/README.md new file mode 100644 index 0000000..3731e7e --- /dev/null +++ b/modules/storage/aws-backup/README.md @@ -0,0 +1,58 @@ + +## Requirements + +No requirements. + +## Providers + +| Name | Version | +|------|---------| +| aws | n/a | + +## Modules + +No modules. + +## Resources + +| Name | Type | +|------|------| +| [aws_backup_plan.ab-plan](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_plan) | resource | +| [aws_backup_region_settings.ab-settings](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_region_settings) | resource | +| [aws_backup_selection.ab-selection-by-service-type](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_selection) | resource | +| [aws_backup_vault.ab-vault](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_vault) | resource | +| [aws_backup_vault_policy.ab-vault-policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_vault_policy) | resource | +| [aws_iam_role.ab-iam-role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource | +| [aws_iam_role_policy_attachment.ab-iam-role-policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | +| [aws_kms_alias.ab-kms-key-alias](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kms_alias) | resource | +| [aws_kms_key.ab-kms-key](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kms_key) | resource | +| [aws_caller_identity.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source | + +## Inputs + +| 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 | +| 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 | +| opt-in-ec2 | Opt in ec2 backup | `bool` | n/a | yes | +| opt-in-efs | Opt in efs backup | `bool` | n/a | yes | +| opt-in-fsx | Opt in fsx backup | `bool` | n/a | yes | +| opt-in-rds | Opt in rds backup | `bool` | n/a | yes | +| opt-in-redshift | Opt in redshift backup | `bool` | n/a | yes | +| opt-in-s3 | Opt in s3 backup | `bool` | n/a | yes | +| opt-in-storagegateway | Opt in storage gateway backup | `bool` | n/a | yes | +| opt-in-virtualmachine | Opt in virtualmachine backup | `bool` | n/a | yes | + +## Outputs + +| Name | Description | +|------|-------------| +| test | n/a | + +--- +## Authorship +This module was developed by xpk. \ No newline at end of file diff --git a/modules/storage/aws-backup/awsbackup.tf b/modules/storage/aws-backup/awsbackup.tf deleted file mode 100644 index 3a41769..0000000 --- a/modules/storage/aws-backup/awsbackup.tf +++ /dev/null @@ -1,117 +0,0 @@ -resource "aws_backup_vault" "ab-vault" { - name = "BackupVault" - kms_key_arn = aws_kms_key.ab-kms-key.arn - tags = var.default-tags -} - -resource "aws_backup_vault_policy" "ab-vault-policy" { - backup_vault_name = aws_backup_vault.ab-vault.name - policy = <