diff --git a/.github/workflows/cicd-2-publish.yaml b/.github/workflows/cicd-2-publish.yaml index dad3923..51affce 100644 --- a/.github/workflows/cicd-2-publish.yaml +++ b/.github/workflows/cicd-2-publish.yaml @@ -61,4 +61,3 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} default_bump: patch tag_prefix: "v" - diff --git a/.tool-versions b/.tool-versions index 0d035de..acdecd3 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,8 +1,8 @@ # This file is for you! Please, updated to the versions agreed by your team. terraform 1.13.2 -terraform-docs 0.19.0 -pre-commit 3.6.0 +terraform-docs 0.23.0 +pre-commit 4.6.0 python 3.12 vale 3.6.0 diff --git a/.tool-versions.yaml b/.tool-versions.yaml index 72ca576..8e788f8 100644 --- a/.tool-versions.yaml +++ b/.tool-versions.yaml @@ -1,7 +1,7 @@ infrastructure: terraform: 1.13.2 - terraform-docs: 0.19.0 - pre-commit: 3.6.0 + terraform-docs: 0.23.0 + pre-commit: 4.6.0 vale: 3.6.0 python: 3.12.0 nodejs: 24.8.0 diff --git a/docs/developer-guides/Scripting_Docker.md b/docs/developer-guides/Scripting_Docker.md index 304920d..08b6a4f 100644 --- a/docs/developer-guides/Scripting_Docker.md +++ b/docs/developer-guides/Scripting_Docker.md @@ -228,7 +228,7 @@ Here is a step-by-step guide for an image which packages a third-party tool. It You can specify the version tags that the automated build process applies to your images with a `VERSION` file. This file must be located adjacent to the `Dockerfile` where each image is defined. -It may be a "_statically defined_" version, such as `1.2.3`, `20230601`, etc., or a "_dynamic pattern_" based on the current time and commit hash, e.g. `${yyyy}${mm}${dd}${HH}${MM}${SS}-${hash}`. This pattern will be substituted during the build process to create a `.version` file in the same directory, containing effective content like `20230601153000-123abcd`. See [this function](https://github.com/nhs-england-tools/repository-template/blob/main/scripts/docker/docker.lib.sh#L118) for what template substitutions are available. +It may be a "_statically defined_" version, such as `1.2.3`, `20230601`, etc., or a "_dynamic pattern_" based on the current time and commit hash, e.g. `${yyyy}${mm}${dd}${HH}${MM}${SS}-${hash}`. This pattern will be substituted during the build process to create a `.version` file in the same directory, containing effective content like `20230601153000-123abcd`. See [this function](https://github.com/nhs-england-tools/repository-template/blob/ec475e15f049b8ec1ac1b69088297e70ea5c1291/scripts/docker/docker.lib.sh#L118) for what template substitutions are available. This file is then used by functions defined in [docker.lib.sh](../../scripts/docker/docker.lib.sh) but is ignored by Git, and is not checked in with other files. diff --git a/docs/developer-guides/Scripting_Terraform.md b/docs/developer-guides/Scripting_Terraform.md index 837288f..a8508c2 100644 --- a/docs/developer-guides/Scripting_Terraform.md +++ b/docs/developer-guides/Scripting_Terraform.md @@ -56,7 +56,7 @@ Here are some key features built into this repository's Terraform module: - [`check-terraform-format.sh`](../../scripts/githooks/check-terraform-format.sh): Git hook - Usage example - Declarative infrastructure definition example [`terraform-state-aws-s3`](../../scripts/terraform/examples/terraform-state-aws-s3) to store Terraform state - - A set of [make targets](https://github.com/nhs-england-tools/repository-template/blob/main/scripts/terraform/terraform.mk#L44) to run the example + - A set of [make targets](https://github.com/nhs-england-tools/repository-template/blob/ec475e15f049b8ec1ac1b69088297e70ea5c1291/scripts/terraform/terraform.mk#L44) to run the example ## Usage diff --git a/infrastructure/modules/api-gateway/main.tf b/infrastructure/modules/api-gateway/main.tf index 9417850..1b5d1ae 100644 --- a/infrastructure/modules/api-gateway/main.tf +++ b/infrastructure/modules/api-gateway/main.tf @@ -250,5 +250,3 @@ resource "aws_api_gateway_base_path_mapping" "custom_domain_mapping" { depends_on = [aws_api_gateway_stage.stage] } - - diff --git a/infrastructure/modules/api-gateway/outputs.tf b/infrastructure/modules/api-gateway/outputs.tf index 51dc20b..8e68c1f 100644 --- a/infrastructure/modules/api-gateway/outputs.tf +++ b/infrastructure/modules/api-gateway/outputs.tf @@ -22,4 +22,3 @@ output "api_key_secret_arn" { description = "The ARN of the API key secret in Secrets Manager" value = aws_secretsmanager_secret.api_token.arn } - diff --git a/infrastructure/modules/api-gateway/readme.md b/infrastructure/modules/api-gateway/readme.md index e928a0c..5729566 100644 --- a/infrastructure/modules/api-gateway/readme.md +++ b/infrastructure/modules/api-gateway/readme.md @@ -9,9 +9,9 @@ No requirements. ## Providers | Name | Version | -|------|---------| -| [aws](#provider_aws) | n/a | -| [random](#provider_random) | n/a | +| ---- | ------- | +| [aws](#provider\_aws) | 6.43.0 | +| [random](#provider\_random) | 3.8.1 | ## Modules @@ -20,7 +20,7 @@ No modules. ## Resources | Name | Type | -|------|------| +| ---- | ---- | | [aws_acm_certificate.cert](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/acm_certificate) | resource | | [aws_acm_certificate_validation.cert_validation](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/acm_certificate_validation) | resource | | [aws_api_gateway_account.account](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/api_gateway_account) | resource | @@ -48,31 +48,31 @@ No modules. ## Inputs | Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [api_gateway_description](#input_api_gateway_description) | Description for the API Gateway | `string` | n/a | yes | -| [api_gateway_name](#input_api_gateway_name) | the name of the API Gateway | `any` | n/a | yes | -| [api_path_part](#input_api_path_part) | the url path for the API | `any` | n/a | yes | -| [aws_account_id](#input_aws_account_id) | n/a | `any` | n/a | yes | -| [aws_lambda_arn](#input_aws_lambda_arn) | n/a | `any` | n/a | yes | -| [aws_lambda_name](#input_aws_lambda_name) | n/a | `any` | n/a | yes | -| [aws_region](#input_aws_region) | The AWS region where the API Gateway is deployed | `string` | `"eu-west-2"` | no | -| [certificate_arn](#input_certificate_arn) | The ARN of the ACM certificate to use for the custom domain (optional, will create if not provided) | `string` | `null` | no | -| [domain_name_prefix](#input_domain_name_prefix) | Prefix for the custom domain name | `string` | n/a | yes | -| [hosted_zone_name](#input_hosted_zone_name) | The hosted zone name for the custom domain | `string` | n/a | yes | -| [http_method](#input_http_method) | The HTTP method to use for the API Gateway | `string` | n/a | yes | -| [name_prefix](#input_name_prefix) | Prefix for naming resources | `string` | n/a | yes | -| [route53_hosted_zone_id](#input_route53_hosted_zone_id) | The ID of the Route53 hosted zone | `string` | n/a | yes | -| [secret_replication_regions](#input_secret_replication_regions) | List of additional regions where created secrets should be replicated | `list(string)` | n/a | yes | -| [stage_name](#input_stage_name) | the API stage name | `any` | n/a | yes | +| ---- | ----------- | ---- | ------- | :------: | +| [api\_gateway\_description](#input\_api\_gateway\_description) | Description for the API Gateway | `string` | n/a | yes | +| [api\_gateway\_name](#input\_api\_gateway\_name) | the name of the API Gateway | `any` | n/a | yes | +| [api\_path\_part](#input\_api\_path\_part) | the url path for the API | `any` | n/a | yes | +| [aws\_account\_id](#input\_aws\_account\_id) | n/a | `any` | n/a | yes | +| [aws\_lambda\_arn](#input\_aws\_lambda\_arn) | n/a | `any` | n/a | yes | +| [aws\_lambda\_name](#input\_aws\_lambda\_name) | n/a | `any` | n/a | yes | +| [aws\_region](#input\_aws\_region) | The AWS region where the API Gateway is deployed | `string` | `"eu-west-2"` | no | +| [certificate\_arn](#input\_certificate\_arn) | The ARN of the ACM certificate to use for the custom domain (optional, will create if not provided) | `string` | `null` | no | +| [domain\_name\_prefix](#input\_domain\_name\_prefix) | Prefix for the custom domain name | `string` | n/a | yes | +| [hosted\_zone\_name](#input\_hosted\_zone\_name) | The hosted zone name for the custom domain | `string` | n/a | yes | +| [http\_method](#input\_http\_method) | The HTTP method to use for the API Gateway | `string` | n/a | yes | +| [name\_prefix](#input\_name\_prefix) | Prefix for naming resources | `string` | n/a | yes | +| [route53\_hosted\_zone\_id](#input\_route53\_hosted\_zone\_id) | The ID of the Route53 hosted zone | `string` | n/a | yes | +| [secret\_replication\_regions](#input\_secret\_replication\_regions) | List of additional regions where created secrets should be replicated | `list(string)` | n/a | yes | +| [stage\_name](#input\_stage\_name) | the API stage name | `any` | n/a | yes | ## Outputs | Name | Description | -|------|-------------| -| [api_gateway_id](#output_api_gateway_id) | The ID of the API Gateway | -| [api_gateway_invoke_url](#output_api_gateway_invoke_url) | The invoke URL of the API Gateway stage | -| [api_gateway_url](#output_api_gateway_url) | The URL of the API Gateway custom domain | -| [api_key_id](#output_api_key_id) | The ID of the API key | -| [api_key_secret_arn](#output_api_key_secret_arn) | The ARN of the API key secret in Secrets Manager | +| ---- | ----------- | +| [api\_gateway\_id](#output\_api\_gateway\_id) | The ID of the API Gateway | +| [api\_gateway\_invoke\_url](#output\_api\_gateway\_invoke\_url) | The invoke URL of the API Gateway stage | +| [api\_gateway\_url](#output\_api\_gateway\_url) | The URL of the API Gateway custom domain | +| [api\_key\_id](#output\_api\_key\_id) | The ID of the API key | +| [api\_key\_secret\_arn](#output\_api\_key\_secret\_arn) | The ARN of the API key secret in Secrets Manager | diff --git a/infrastructure/modules/aws-backup-destination/readme.md b/infrastructure/modules/aws-backup-destination/readme.md index fb5fb21..865c67f 100644 --- a/infrastructure/modules/aws-backup-destination/readme.md +++ b/infrastructure/modules/aws-backup-destination/readme.md @@ -34,16 +34,15 @@ module "test_backup_vault" { ``` - ## Requirements No requirements. ## Providers -| Name | Version | -| ------------------------------------------------ | ------- | -| [aws](#provider_aws) | n/a | +| Name | Version | +| ---- | ------- | +| [aws](#provider\_aws) | 6.43.0 | ## Modules @@ -51,41 +50,40 @@ No modules. ## Resources -| Name | Type | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | -| [aws_backup_vault.vault](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_vault) | resource | -| [aws_backup_vault_lock_configuration.vault_lock](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_vault_lock_configuration) | resource | -| [aws_backup_vault_policy.vault_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_vault_policy) | resource | -| [aws_iam_role.copy_recovery_point](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource | -| [aws_iam_role_policy.copy_recovery_point_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | resource | -| [aws_iam_policy_document.copy_recovery_point_assume](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | +| Name | Type | +| ---- | ---- | +| [aws_backup_vault.vault](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_vault) | resource | +| [aws_backup_vault_lock_configuration.vault_lock](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_vault_lock_configuration) | resource | +| [aws_backup_vault_policy.vault_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_vault_policy) | resource | +| [aws_iam_role.copy_recovery_point](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource | +| [aws_iam_role_policy.copy_recovery_point_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | resource | +| [aws_iam_policy_document.copy_recovery_point_assume](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | | [aws_iam_policy_document.copy_recovery_point_permissions](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | -| [aws_iam_policy_document.vault_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | - -## Module Inputs - -| Name | Description | Type | Default | Required | -| ------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- | -------------- | :------: | -| [account_id](#input_account_id) | The id of the account that the vault will be in | `string` | n/a | yes | -| [changeable_for_days](#input_changeable_for_days) | How long you want the vault lock to be changeable for, only applies to compliance mode. This value is expressed in days no less than 3 and no greater than 36,500; otherwise, an error will return. | `number` | `14` | no | -| [enable_cross_account_vault_access](#input_enable_cross_account_vault_access) | Flag to enable cross account vault access for AWS Backup | `bool` | `false` | no | -| [enable_vault_protection](#input_enable_vault_protection) | Flag which controls if the vault lock is enabled | `bool` | `false` | no | -| [kms_key](#input_kms_key) | The KMS key used to secure the vault | `string` | n/a | yes | -| [name_prefix](#input_name_prefix) | Optional name prefix for vault resources | `string` | `null` | no | -| [region](#input_region) | The region we should be operating in | `string` | `"eu-west-2"` | no | -| [source_account_ids](#input_source_account_ids) | The ids of the accounts that backups will come from | `list(string)` | n/a | yes | -| [source_account_name](#input_source_account_name) | The name of the account that backups will come from | `string` | n/a | yes | -| [source_vault_arn](#input_source_vault_arn) | Source account vault arn, if set copies back are restricted to only this vault | `string` | `""` | no | -| [vault_lock_max_retention_days](#input_vault_lock_max_retention_days) | The maximum retention period required on recovery points when vault lock enabled | `number` | `365` | no | -| [vault_lock_min_retention_days](#input_vault_lock_min_retention_days) | The minimum retention period required on recovery points when vault lock enabled | `number` | `365` | no | -| [vault_lock_type](#input_vault_lock_type) | The type of lock that the vault should be, will default to governance | `string` | `"governance"` | no | +| [aws_iam_policy_document.vault_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | -## Outputs +## Inputs -| Name | Description | -| ----------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -| [copy_recovery_point_role_arn](#output_copy_recovery_point_role_arn) | arn of role to assume from source account lambda (set ASSUME_ROLE_ARN to this). Only present if enabled. | -| [vault_arn](#output_vault_arn) | n/a | -| [vault_name](#output_vault_name) | The name of the backup vault. | +| Name | Description | Type | Default | Required | +| ---- | ----------- | ---- | ------- | :------: | +| [account\_id](#input\_account\_id) | The id of the account that the vault will be in | `string` | n/a | yes | +| [changeable\_for\_days](#input\_changeable\_for\_days) | How long you want the vault lock to be changeable for, only applies to compliance mode. This value is expressed in days no less than 3 and no greater than 36,500; otherwise, an error will return. | `number` | `14` | no | +| [enable\_cross\_account\_vault\_access](#input\_enable\_cross\_account\_vault\_access) | Flag to enable cross account vault access for AWS Backup | `bool` | `false` | no | +| [enable\_vault\_protection](#input\_enable\_vault\_protection) | Flag which controls if the vault lock is enabled | `bool` | `false` | no | +| [kms\_key](#input\_kms\_key) | The KMS key used to secure the vault | `string` | n/a | yes | +| [name\_prefix](#input\_name\_prefix) | Optional name prefix for vault resources | `string` | `null` | no | +| [region](#input\_region) | The region we should be operating in | `string` | `"eu-west-2"` | no | +| [source\_account\_ids](#input\_source\_account\_ids) | The ids of the accounts that backups will come from | `list(string)` | n/a | yes | +| [source\_account\_name](#input\_source\_account\_name) | The name of the account that backups will come from | `string` | n/a | yes | +| [source\_vault\_arn](#input\_source\_vault\_arn) | Source account vault arn, if set copies back are restricted to only this vault | `string` | `""` | no | +| [vault\_lock\_max\_retention\_days](#input\_vault\_lock\_max\_retention\_days) | The maximum retention period required on recovery points when vault lock enabled | `number` | `365` | no | +| [vault\_lock\_min\_retention\_days](#input\_vault\_lock\_min\_retention\_days) | The minimum retention period required on recovery points when vault lock enabled | `number` | `365` | no | +| [vault\_lock\_type](#input\_vault\_lock\_type) | The type of lock that the vault should be, will default to governance | `string` | `"governance"` | no | + +## Outputs +| Name | Description | +| ---- | ----------- | +| [copy\_recovery\_point\_role\_arn](#output\_copy\_recovery\_point\_role\_arn) | ARN of role to assume from source account lambda (set ASSUME\_ROLE\_ARN to this). Only present if enabled. | +| [vault\_arn](#output\_vault\_arn) | n/a | +| [vault\_name](#output\_vault\_name) | The name of the backup vault. | diff --git a/infrastructure/modules/aws-backup-source/outputs.tf b/infrastructure/modules/aws-backup-source/outputs.tf index 8856d0b..f8f4845 100644 --- a/infrastructure/modules/aws-backup-source/outputs.tf +++ b/infrastructure/modules/aws-backup-source/outputs.tf @@ -27,4 +27,3 @@ output "restore_validation_eventbridge_rule_name" { value = var.backup_plan_config_rds.enable && var.restore_validation_enable ? aws_cloudwatch_event_rule.restore_testing_complete[0].name : null description = "Name of the EventBridge rule that triggers restore validation" } - diff --git a/infrastructure/modules/aws-backup-source/readme.md b/infrastructure/modules/aws-backup-source/readme.md index 1c09931..393535c 100644 --- a/infrastructure/modules/aws-backup-source/readme.md +++ b/infrastructure/modules/aws-backup-source/readme.md @@ -17,145 +17,143 @@ module "test_aws_backup" { ``` - ## Requirements -| Name | Version | -| ------------------------------------------------------------------------ | -------- | -| [terraform](#requirement_terraform) | >= 1.9.5 | -| [archive](#requirement_archive) | ~> 2 | -| [aws](#requirement_aws) | > 6 | +| Name | Version | +| ---- | ------- | +| [terraform](#requirement\_terraform) | >= 1.9.5 | +| [archive](#requirement\_archive) | ~> 2 | +| [aws](#requirement\_aws) | > 6 | ## Providers -| Name | Version | -| ------------------------------------------------------------------ | ------- | -| [archive](#provider_archive) | ~> 2 | -| [aws](#provider_aws) | > 6 | -| [terraform](#provider_terraform) | n/a | +| Name | Version | +| ---- | ------- | +| [archive](#provider\_archive) | 2.7.1 | +| [aws](#provider\_aws) | 6.43.0 | +| [terraform](#provider\_terraform) | n/a | ## Modules -| Name | Source | Version | -| ----------------------------------------------------------------------- | ------------------------------------- | ------- | -| [eventbridge](#module_eventbridge) | terraform-aws-modules/eventbridge/aws | 4.3.0 | -| [lambda_layer](#module_lambda_layer) | ../../modules/lambda-layer | n/a | +| Name | Source | Version | +| ---- | ------ | ------- | +| [eventbridge](#module\_eventbridge) | terraform-aws-modules/eventbridge/aws | 4.3.0 | +| [lambda\_layer](#module\_lambda\_layer) | ../../modules/lambda-layer | n/a | ## Resources -| Name | Type | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | -| [aws_backup_framework.rds](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_framework) | resource | -| [aws_backup_plan.rds](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_plan) | resource | -| [aws_backup_report_plan.backup_jobs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_report_plan) | resource | -| [aws_backup_report_plan.backup_restore_testing_jobs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_report_plan) | resource | -| [aws_backup_report_plan.copy_jobs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_report_plan) | resource | -| [aws_backup_report_plan.resource_compliance](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_report_plan) | resource | -| [aws_backup_restore_testing_plan.backup_restore_testing_plan](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_restore_testing_plan) | resource | -| [aws_backup_restore_testing_selection.backup_restore_testing_selection_rds](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_restore_testing_selection) | resource | -| [aws_backup_selection.rds](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_selection) | resource | -| [aws_backup_vault.intermediary_vault](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_vault) | resource | -| [aws_backup_vault.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_vault) | resource | -| [aws_backup_vault_notifications.backup_notification](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_vault_notifications) | resource | -| [aws_backup_vault_policy.vault_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_vault_policy) | resource | -| [aws_cloudwatch_event_rule.restore_testing_complete](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_rule) | resource | -| [aws_cloudwatch_event_target.restore_validation](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_target) | resource | -| [aws_cloudwatch_log_group.restore_validation](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group) | resource | -| [aws_iam_policy.iam_policy_for_lambda_copy_recovery_point](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource | -| [aws_iam_policy.restore_validation_lambda](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource | -| [aws_iam_role.backup](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource | -| [aws_iam_role.iam_for_lambda_copy_job](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource | -| [aws_iam_role.iam_for_lambda_copy_recovery_point](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource | -| [aws_iam_role.restore_validation_lambda](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource | -| [aws_iam_role_policy.cross_account_iam_permissions](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | resource | -| [aws_iam_role_policy_attachment.backup](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | -| [aws_iam_role_policy_attachment.lambda_copy_recovery_point_policy_attach](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | -| [aws_iam_role_policy_attachment.lambda_role_policy_attachment](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | -| [aws_iam_role_policy_attachment.restore](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | -| [aws_iam_role_policy_attachment.restore_validation_lambda_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | -| [aws_iam_role_policy_attachment.restore_validation_lambda_vpc](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | -| [aws_iam_role_policy_attachment.s3_backup](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | -| [aws_iam_role_policy_attachment.s3_restore](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | -| [aws_kms_alias.backup_key](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kms_alias) | resource | -| [aws_kms_key.aws_backup_key](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kms_key) | resource | -| [aws_kms_key_policy.backup_key_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kms_key_policy) | resource | -| [aws_lambda_function.lambda_copy_recovery_point](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function) | resource | -| [aws_lambda_function.restore_validation](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function) | resource | -| [aws_lambda_function.start_cross_account_copy_job_lambda](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function) | resource | -| [aws_lambda_permission.allow_eventbridge](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_permission) | resource | -| [aws_lambda_permission.eventbridge_invoke_validation](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_permission) | resource | -| [aws_security_group.lambda](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group) | resource | -| [aws_sns_topic.backup](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sns_topic) | resource | -| [aws_sns_topic_subscription.aws_backup_notifications_email_target](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sns_topic_subscription) | resource | -| [aws_vpc_security_group_egress_rule.lambda_egress_for_rds](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc_security_group_egress_rule) | resource | -| [aws_vpc_security_group_egress_rule.lambda_egress_https](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc_security_group_egress_rule) | resource | -| [aws_vpc_security_group_ingress_rule.lambda_ingress_for_rds](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc_security_group_ingress_rule) | resource | -| [archive_file.lambda_copy_recovery_point_zip](https://registry.terraform.io/providers/hashicorp/archive/latest/docs/data-sources/file) | data source | -| [archive_file.lambda_restore_validation_zip](https://registry.terraform.io/providers/hashicorp/archive/latest/docs/data-sources/file) | data source | -| [archive_file.start_cross_account_copy_job_lambda_zip](https://registry.terraform.io/providers/hashicorp/archive/latest/docs/data-sources/file) | data source | -| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source | -| [aws_iam_policy_document.allow_backup_to_sns](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | -| [aws_iam_policy_document.assume_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | -| [aws_iam_policy_document.backup_key_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | -| [aws_iam_policy_document.lambda_assume_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | -| [aws_iam_policy_document.lambda_copy_job_permissions](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | -| [aws_iam_policy_document.vault_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | -| [aws_iam_roles.roles](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_roles) | data source | -| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source | -| [terraform_remote_state.rds_instance](https://registry.terraform.io/providers/hashicorp/terraform/latest/docs/data-sources/remote_state) | data source | -| [terraform_remote_state.vpc](https://registry.terraform.io/providers/hashicorp/terraform/latest/docs/data-sources/remote_state) | data source | +| Name | Type | +| ---- | ---- | +| [aws_backup_framework.rds](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_framework) | resource | +| [aws_backup_plan.rds](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_plan) | resource | +| [aws_backup_report_plan.backup_jobs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_report_plan) | resource | +| [aws_backup_report_plan.backup_restore_testing_jobs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_report_plan) | resource | +| [aws_backup_report_plan.copy_jobs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_report_plan) | resource | +| [aws_backup_report_plan.resource_compliance](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_report_plan) | resource | +| [aws_backup_restore_testing_plan.backup_restore_testing_plan](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_restore_testing_plan) | resource | +| [aws_backup_restore_testing_selection.backup_restore_testing_selection_rds](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_restore_testing_selection) | resource | +| [aws_backup_selection.rds](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_selection) | resource | +| [aws_backup_vault.intermediary_vault](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_vault) | resource | +| [aws_backup_vault.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_vault) | resource | +| [aws_backup_vault_notifications.backup_notification](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_vault_notifications) | resource | +| [aws_backup_vault_policy.vault_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/backup_vault_policy) | resource | +| [aws_cloudwatch_event_rule.restore_testing_complete](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_rule) | resource | +| [aws_cloudwatch_event_target.restore_validation](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_event_target) | resource | +| [aws_cloudwatch_log_group.restore_validation](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group) | resource | +| [aws_iam_policy.iam_policy_for_lambda_copy_recovery_point](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource | +| [aws_iam_policy.restore_validation_lambda](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource | +| [aws_iam_role.backup](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource | +| [aws_iam_role.iam_for_lambda_copy_job](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource | +| [aws_iam_role.iam_for_lambda_copy_recovery_point](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource | +| [aws_iam_role.restore_validation_lambda](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource | +| [aws_iam_role_policy.cross_account_iam_permissions](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | resource | +| [aws_iam_role_policy_attachment.backup](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | +| [aws_iam_role_policy_attachment.lambda_copy_recovery_point_policy_attach](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | +| [aws_iam_role_policy_attachment.lambda_role_policy_attachment](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | +| [aws_iam_role_policy_attachment.restore](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | +| [aws_iam_role_policy_attachment.restore_validation_lambda_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | +| [aws_iam_role_policy_attachment.restore_validation_lambda_vpc](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | +| [aws_iam_role_policy_attachment.s3_backup](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | +| [aws_iam_role_policy_attachment.s3_restore](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | +| [aws_kms_alias.backup_key](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kms_alias) | resource | +| [aws_kms_key.aws_backup_key](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kms_key) | resource | +| [aws_kms_key_policy.backup_key_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kms_key_policy) | resource | +| [aws_lambda_function.lambda_copy_recovery_point](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function) | resource | +| [aws_lambda_function.restore_validation](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function) | resource | +| [aws_lambda_function.start_cross_account_copy_job_lambda](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function) | resource | +| [aws_lambda_permission.allow_eventbridge](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_permission) | resource | +| [aws_lambda_permission.eventbridge_invoke_validation](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_permission) | resource | +| [aws_security_group.lambda](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group) | resource | +| [aws_sns_topic.backup](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sns_topic) | resource | +| [aws_sns_topic_subscription.aws_backup_notifications_email_target](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sns_topic_subscription) | resource | +| [aws_vpc_security_group_egress_rule.lambda_egress_for_rds](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc_security_group_egress_rule) | resource | +| [aws_vpc_security_group_egress_rule.lambda_egress_https](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc_security_group_egress_rule) | resource | +| [aws_vpc_security_group_ingress_rule.lambda_ingress_for_rds](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc_security_group_ingress_rule) | resource | +| [archive_file.lambda_copy_recovery_point_zip](https://registry.terraform.io/providers/hashicorp/archive/latest/docs/data-sources/file) | data source | +| [archive_file.lambda_restore_validation_zip](https://registry.terraform.io/providers/hashicorp/archive/latest/docs/data-sources/file) | data source | +| [archive_file.start_cross_account_copy_job_lambda_zip](https://registry.terraform.io/providers/hashicorp/archive/latest/docs/data-sources/file) | data source | +| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source | +| [aws_iam_policy_document.allow_backup_to_sns](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | +| [aws_iam_policy_document.assume_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | +| [aws_iam_policy_document.backup_key_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | +| [aws_iam_policy_document.lambda_assume_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | +| [aws_iam_policy_document.lambda_copy_job_permissions](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | +| [aws_iam_policy_document.vault_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | +| [aws_iam_roles.roles](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_roles) | data source | +| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source | +| [terraform_remote_state.rds_instance](https://registry.terraform.io/providers/hashicorp/terraform/latest/docs/data-sources/remote_state) | data source | +| [terraform_remote_state.vpc](https://registry.terraform.io/providers/hashicorp/terraform/latest/docs/data-sources/remote_state) | data source | ## Inputs -| Name | Description | Type | Default | Required | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------: | -| [api_endpoint](#input_api_endpoint) | API endpoint to send post build version notifications to | `string` | `""` | no | -| [api_token](#input_api_token) | API token to authenticate with the API endpoint | `string` | `""` | no | -| [backup_copy_vault_account_id](#input_backup_copy_vault_account_id) | The account id of the destination backup vault for allowing restores back into the source account. | `string` | `""` | no | -| [backup_copy_vault_arn](#input_backup_copy_vault_arn) | The arn of the destination backup vault for cross-account backup copies. | `string` | `""` | no | -| [backup_plan_config_rds](#input_backup_plan_config_rds) | Configuration for backup plans with RDS |
object({
enable = bool
selection_tag = string
selection_tag_value = optional(string)
selection_tags = optional(list(object({
key = optional(string)
value = optional(string)
})))
compliance_resource_types = list(string)
restore_testing_overrides = optional(map(string))
validation_window_hours = optional(number)
rules = optional(list(object({
name = string
schedule = string
completion_window = optional(number)
enable_continuous_backup = optional(bool)
lifecycle = object({
delete_after = number
cold_storage_after = optional(number)
})
copy_action = optional(object({
delete_after = optional(number)
}))
})))
}) | {
"compliance_resource_types": [
"RDS"
],
"enable": true,
"rules": [
{
"completion_window": 24,
"copy_action": {
"delete_after": 365
},
"lifecycle": {
"delete_after": 35
},
"name": "rds_daily_kept_5_weeks",
"schedule": "cron(0 0 * * ? *)"
},
{
"completion_window": 48,
"copy_action": {
"delete_after": 365
},
"lifecycle": {
"delete_after": 90
},
"name": "rds_weekly_kept_3_months",
"schedule": "cron(0 1 ? * SUN *)"
},
{
"completion_window": 72,
"copy_action": {
"delete_after": 365
},
"lifecycle": {
"cold_storage_after": 30,
"delete_after": 2555
},
"name": "rds_monthly_kept_7_years",
"schedule": "cron(0 2 1 * ? *)"
}
],
"selection_tag": "BackupRDS",
"selection_tag_value": "True",
"selection_tags": [],
"validation_window_hours": 1
} | no |
-| [bootstrap_kms_key_arn](#input_bootstrap_kms_key_arn) | The arn of the bootstrap KMS key used for encryption at rest of the SNS topic. | `string` | n/a | yes |
-| [deletion_allowed_principal_arns](#input_deletion_allowed_principal_arns) | List of ARNs of principals allowed to delete backups. | `list(string)` | `null` | no |
-| [destination_vault_retention_period](#input_destination_vault_retention_period) | Retention period for recovery points made with the copy job lambda | `number` | `365` | no |
-| [enable_notifications](#input_enable_notifications) | Flag to enable backup notifications. | `bool` | `false` | no |
-| [environment_name](#input_environment_name) | The name of the environment where AWS Backup is configured. | `string` | n/a | yes |
-| [iam_role_permissions_boundary](#input_iam_role_permissions_boundary) | Optional permissions boundary arn for backup role | `string` | `""` | no |
-| [lambda_copy_recovery_point_assume_role_arn](#input_lambda_copy_recovery_point_assume_role_arn) | arn of role in destination account the lambda assumes to initiate the copy job (if required for cross-account). | `string` | `""` | no |
-| [lambda_copy_recovery_point_destination_vault_arn](#input_lambda_copy_recovery_point_destination_vault_arn) | Destination vault arn containing the recovery point to be copied back (the air-gapped vault). | `string` | `""` | no |
-| [lambda_copy_recovery_point_enable](#input_lambda_copy_recovery_point_enable) | Flag to enable the copy recovery point lambda (copy recovery point from destination vault back to source). | `bool` | `false` | no |
-| [lambda_copy_recovery_point_max_wait_minutes](#input_lambda_copy_recovery_point_max_wait_minutes) | Maximum number of minutes to wait for a copy job to reach a terminal state before returning running status. | `number` | `10` | no |
-| [lambda_copy_recovery_point_poll_interval_seconds](#input_lambda_copy_recovery_point_poll_interval_seconds) | Polling interval in seconds for copy job status checks. | `number` | `30` | no |
-| [lambda_copy_recovery_point_source_vault_arn](#input_lambda_copy_recovery_point_source_vault_arn) | Source vault arn to which the recovery point will be copied back. | `string` | `""` | no |
-| [name_prefix](#input_name_prefix) | Name prefix for vault resources | `string` | `null` | no |
-| [nation](#input_nation) | The nation this environment is for (e.g. en, ni) | `string` | n/a | yes |
-| [notifications_sns_topic_arn](#input_notifications_sns_topic_arn) | The arn of the SNS topic to use for backup notifications. | `string` | `""` | no |
-| [notifications_target_email_address](#input_notifications_target_email_address) | The email address to which backup notifications will be sent via SNS. | `string` | `""` | no |
-| [project_name](#input_project_name) | The name of the project this relates to. | `string` | n/a | yes |
-| [python_version](#input_python_version) | The Python version to use for the Lambda function | `string` | `"3.12"` | no |
-| [reports_bucket](#input_reports_bucket) | Bucket to drop backup reports into | `string` | n/a | yes |
-| [restore_testing_db_name](#input_restore_testing_db_name) | Name of the database to use for restore validation | `string` | n/a | yes |
-| [restore_testing_plan_algorithm](#input_restore_testing_plan_algorithm) | Algorithm of the Recovery Selection Point | `string` | `"LATEST_WITHIN_WINDOW"` | no |
-| [restore_testing_plan_recovery_point_types](#input_restore_testing_plan_recovery_point_types) | Recovery Point Types | `list(string)` | [| no | -| [restore_testing_plan_scheduled_expression](#input_restore_testing_plan_scheduled_expression) | Scheduled Expression of Recovery Selection Point | `string` | `"cron(0 1 ? * SUN *)"` | no | -| [restore_testing_plan_selection_window_days](#input_restore_testing_plan_selection_window_days) | Selection window days | `number` | `7` | no | -| [restore_testing_plan_start_window](#input_restore_testing_plan_start_window) | Start window from the scheduled time during which the test should start | `number` | `1` | no | -| [restore_validation_db_credentials_secret_name](#input_restore_validation_db_credentials_secret_name) | Name of the Secrets Manager secret containing database credentials for connectivity testing | `string` | n/a | yes | -| [restore_validation_enable](#input_restore_validation_enable) | Enable automated validation of restored RDS instances during backup restore testing | `bool` | `false` | no | -| [restore_validation_expected_subnet_pattern](#input_restore_validation_expected_subnet_pattern) | Expected pattern in the DB subnet group name for configuration validation | `string` | n/a | yes | -| [restore_validation_log_retention_days](#input_restore_validation_log_retention_days) | Number of days to retain restore validation Lambda logs | `number` | `30` | no | -| [restore_validation_timeout_seconds](#input_restore_validation_timeout_seconds) | Timeout for the restore validation Lambda function in seconds | `number` | `300` | no | -| [terraform_role_arn](#input_terraform_role_arn) | arn of Terraform role used to deploy to account (deprecated, please swap to terraform_role_arns) | `string` | `""` | no | -| [terraform_role_arns](#input_terraform_role_arns) | arn of Terraform roles used to deploy to account, defaults to caller arn if list is empty | `list(string)` | `[]` | no | +| Name | Description | Type | Default | Required | +| ---- | ----------- | ---- | ------- | :------: | +| [api\_endpoint](#input\_api\_endpoint) | API endpoint to send post build version notifications to | `string` | `""` | no | +| [api\_token](#input\_api\_token) | API token to authenticate with the API endpoint | `string` | `""` | no | +| [backup\_copy\_vault\_account\_id](#input\_backup\_copy\_vault\_account\_id) | The account id of the destination backup vault for allowing restores back into the source account. | `string` | `""` | no | +| [backup\_copy\_vault\_arn](#input\_backup\_copy\_vault\_arn) | The ARN of the destination backup vault for cross-account backup copies. | `string` | `""` | no | +| [backup\_plan\_config\_rds](#input\_backup\_plan\_config\_rds) | Configuration for backup plans with RDS |
"SNAPSHOT"
]
object({
enable = bool
selection_tag = string
selection_tag_value = optional(string)
selection_tags = optional(list(object({
key = optional(string)
value = optional(string)
})))
compliance_resource_types = list(string)
restore_testing_overrides = optional(map(string))
validation_window_hours = optional(number)
rules = optional(list(object({
name = string
schedule = string
completion_window = optional(number)
enable_continuous_backup = optional(bool)
lifecycle = object({
delete_after = number
cold_storage_after = optional(number)
})
copy_action = optional(object({
delete_after = optional(number)
}))
})))
}) | {
"compliance_resource_types": [
"RDS"
],
"enable": true,
"rules": [
{
"completion_window": 24,
"copy_action": {
"delete_after": 365
},
"lifecycle": {
"delete_after": 35
},
"name": "rds_daily_kept_5_weeks",
"schedule": "cron(0 0 * * ? *)"
},
{
"completion_window": 48,
"copy_action": {
"delete_after": 365
},
"lifecycle": {
"delete_after": 90
},
"name": "rds_weekly_kept_3_months",
"schedule": "cron(0 1 ? * SUN *)"
},
{
"completion_window": 72,
"copy_action": {
"delete_after": 365
},
"lifecycle": {
"cold_storage_after": 30,
"delete_after": 2555
},
"name": "rds_monthly_kept_7_years",
"schedule": "cron(0 2 1 * ? *)"
}
],
"selection_tag": "BackupRDS",
"selection_tag_value": "True",
"selection_tags": [],
"validation_window_hours": 1
} | no |
+| [bootstrap\_kms\_key\_arn](#input\_bootstrap\_kms\_key\_arn) | The ARN of the bootstrap KMS key used for encryption at rest of the SNS topic. | `string` | n/a | yes |
+| [deletion\_allowed\_principal\_arns](#input\_deletion\_allowed\_principal\_arns) | List of ARNs of principals allowed to delete backups. | `list(string)` | `null` | no |
+| [destination\_vault\_retention\_period](#input\_destination\_vault\_retention\_period) | Retention period for recovery points made with the copy job lambda | `number` | `365` | no |
+| [enable\_notifications](#input\_enable\_notifications) | Flag to enable backup notifications. | `bool` | `false` | no |
+| [environment\_name](#input\_environment\_name) | The name of the environment where AWS Backup is configured. | `string` | n/a | yes |
+| [iam\_role\_permissions\_boundary](#input\_iam\_role\_permissions\_boundary) | Optional permissions boundary ARN for backup role | `string` | `""` | no |
+| [lambda\_copy\_recovery\_point\_assume\_role\_arn](#input\_lambda\_copy\_recovery\_point\_assume\_role\_arn) | ARN of role in destination account the lambda assumes to initiate the copy job (if required for cross-account). | `string` | `""` | no |
+| [lambda\_copy\_recovery\_point\_destination\_vault\_arn](#input\_lambda\_copy\_recovery\_point\_destination\_vault\_arn) | Destination vault ARN containing the recovery point to be copied back (the air-gapped vault). | `string` | `""` | no |
+| [lambda\_copy\_recovery\_point\_enable](#input\_lambda\_copy\_recovery\_point\_enable) | Flag to enable the copy recovery point lambda (copy recovery point from destination vault back to source). | `bool` | `false` | no |
+| [lambda\_copy\_recovery\_point\_max\_wait\_minutes](#input\_lambda\_copy\_recovery\_point\_max\_wait\_minutes) | Maximum number of minutes to wait for a copy job to reach a terminal state before returning running status. | `number` | `10` | no |
+| [lambda\_copy\_recovery\_point\_poll\_interval\_seconds](#input\_lambda\_copy\_recovery\_point\_poll\_interval\_seconds) | Polling interval in seconds for copy job status checks. | `number` | `30` | no |
+| [lambda\_copy\_recovery\_point\_source\_vault\_arn](#input\_lambda\_copy\_recovery\_point\_source\_vault\_arn) | Source vault ARN to which the recovery point will be copied back. | `string` | `""` | no |
+| [name\_prefix](#input\_name\_prefix) | Name prefix for vault resources | `string` | `null` | no |
+| [nation](#input\_nation) | The nation this environment is for (e.g. en, ni) | `string` | n/a | yes |
+| [notifications\_sns\_topic\_arn](#input\_notifications\_sns\_topic\_arn) | The ARN of the SNS topic to use for backup notifications. | `string` | `""` | no |
+| [notifications\_target\_email\_address](#input\_notifications\_target\_email\_address) | The email address to which backup notifications will be sent via SNS. | `string` | `""` | no |
+| [project\_name](#input\_project\_name) | The name of the project this relates to. | `string` | n/a | yes |
+| [python\_version](#input\_python\_version) | The Python version to use for the Lambda function | `string` | `"3.12"` | no |
+| [reports\_bucket](#input\_reports\_bucket) | Bucket to drop backup reports into | `string` | n/a | yes |
+| [restore\_testing\_db\_name](#input\_restore\_testing\_db\_name) | Name of the database to use for restore validation | `string` | n/a | yes |
+| [restore\_testing\_plan\_algorithm](#input\_restore\_testing\_plan\_algorithm) | Algorithm of the Recovery Selection Point | `string` | `"LATEST_WITHIN_WINDOW"` | no |
+| [restore\_testing\_plan\_recovery\_point\_types](#input\_restore\_testing\_plan\_recovery\_point\_types) | Recovery Point Types | `list(string)` | [| no | +| [restore\_testing\_plan\_scheduled\_expression](#input\_restore\_testing\_plan\_scheduled\_expression) | Scheduled Expression of Recovery Selection Point | `string` | `"cron(0 1 ? * SUN *)"` | no | +| [restore\_testing\_plan\_selection\_window\_days](#input\_restore\_testing\_plan\_selection\_window\_days) | Selection window days | `number` | `7` | no | +| [restore\_testing\_plan\_start\_window](#input\_restore\_testing\_plan\_start\_window) | Start window from the scheduled time during which the test should start | `number` | `1` | no | +| [restore\_validation\_db\_credentials\_secret\_name](#input\_restore\_validation\_db\_credentials\_secret\_name) | Name of the Secrets Manager secret containing database credentials for connectivity testing | `string` | n/a | yes | +| [restore\_validation\_enable](#input\_restore\_validation\_enable) | Enable automated validation of restored RDS instances during backup restore testing | `bool` | `false` | no | +| [restore\_validation\_expected\_subnet\_pattern](#input\_restore\_validation\_expected\_subnet\_pattern) | Expected pattern in the DB subnet group name for configuration validation | `string` | n/a | yes | +| [restore\_validation\_log\_retention\_days](#input\_restore\_validation\_log\_retention\_days) | Number of days to retain restore validation Lambda logs | `number` | `30` | no | +| [restore\_validation\_timeout\_seconds](#input\_restore\_validation\_timeout\_seconds) | Timeout for the restore validation Lambda function in seconds | `number` | `300` | no | +| [terraform\_role\_arn](#input\_terraform\_role\_arn) | ARN of Terraform role used to deploy to account (deprecated, please swap to terraform\_role\_arns) | `string` | `""` | no | +| [terraform\_role\_arns](#input\_terraform\_role\_arns) | ARN of Terraform roles used to deploy to account, defaults to caller arn if list is empty | `list(string)` | `[]` | no | ## Outputs -| Name | Description | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | -| [backup_role_arn](#output_backup_role_arn) | arn of the of the backup role | -| [backup_vault_arn](#output_backup_vault_arn) | arn of the of the vault | -| [backup_vault_name](#output_backup_vault_name) | Name of the of the vault | -| [restore_validation_eventbridge_rule_name](#output_restore_validation_eventbridge_rule_name) | Name of the EventBridge rule that triggers restore validation | -| [restore_validation_lambda_arn](#output_restore_validation_lambda_arn) | arn of the restore validation Lambda function | -| [restore_validation_lambda_name](#output_restore_validation_lambda_name) | Name of the restore validation Lambda function | - +| Name | Description | +| ---- | ----------- | +| [backup\_role\_arn](#output\_backup\_role\_arn) | ARN of the of the backup role | +| [backup\_vault\_arn](#output\_backup\_vault\_arn) | ARN of the of the vault | +| [backup\_vault\_name](#output\_backup\_vault\_name) | Name of the of the vault | +| [restore\_validation\_eventbridge\_rule\_name](#output\_restore\_validation\_eventbridge\_rule\_name) | Name of the EventBridge rule that triggers restore validation | +| [restore\_validation\_lambda\_arn](#output\_restore\_validation\_lambda\_arn) | ARN of the restore validation Lambda function | +| [restore\_validation\_lambda\_name](#output\_restore\_validation\_lambda\_name) | Name of the restore validation Lambda function | diff --git a/infrastructure/modules/aws-scheduler/readme.md b/infrastructure/modules/aws-scheduler/readme.md index 9befb21..0d4ac5b 100644 --- a/infrastructure/modules/aws-scheduler/readme.md +++ b/infrastructure/modules/aws-scheduler/readme.md @@ -9,8 +9,8 @@ No requirements. ## Providers | Name | Version | -|------|---------| -| [aws](#provider_aws) | n/a | +| ---- | ------- | +| [aws](#provider\_aws) | 6.43.0 | ## Modules @@ -19,7 +19,7 @@ No modules. ## Resources | Name | Type | -|------|------| +| ---- | ---- | | [aws_iam_role.scheduler_invoke](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource | | [aws_iam_role_policy.scheduler_lambda_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | resource | | [aws_scheduler_schedule.env_expiry](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/scheduler_schedule) | resource | @@ -28,13 +28,13 @@ No modules. ## Inputs | Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [function_name](#input_function_name) | Lambda function name | `string` | n/a | yes | -| [lambda_inputs](#input_lambda_inputs) | Map of key-value pairs to send to the Lambda as input | `map(string)` | `{}` | no | -| [name_prefix](#input_name_prefix) | Prefix for naming resources | `string` | n/a | yes | -| [resource_suffix](#input_resource_suffix) | Sanitized environment name for resource naming | `string` | n/a | yes | -| [schedule_expression](#input_schedule_expression) | Schedule expression for the AWS Scheduler (e.g. rate(3 days) or cron(...)) | `string` | `null` | no | -| [start_time](#input_start_time) | RFC3339 timestamp to use as the scheduler start time | `string` | n/a | yes | +| ---- | ----------- | ---- | ------- | :------: | +| [function\_name](#input\_function\_name) | Lambda function name | `string` | n/a | yes | +| [lambda\_inputs](#input\_lambda\_inputs) | Map of key-value pairs to send to the Lambda as input | `map(string)` | `{}` | no | +| [name\_prefix](#input\_name\_prefix) | Prefix for naming resources | `string` | n/a | yes | +| [resource\_suffix](#input\_resource\_suffix) | Sanitized environment name for resource naming | `string` | n/a | yes | +| [schedule\_expression](#input\_schedule\_expression) | Schedule expression for the AWS Scheduler (e.g. rate(3 days) or cron(...)) | `string` | `null` | no | +| [start\_time](#input\_start\_time) | RFC3339 timestamp to use as the scheduler start time | `string` | n/a | yes | ## Outputs diff --git a/infrastructure/modules/cognito/main.tf b/infrastructure/modules/cognito/main.tf index 4da3ac1..c9fe18d 100644 --- a/infrastructure/modules/cognito/main.tf +++ b/infrastructure/modules/cognito/main.tf @@ -119,4 +119,3 @@ resource "aws_cognito_user" "cognito_user_creation" { uid = each.value.uuid } } - diff --git a/infrastructure/modules/cognito/readme.md b/infrastructure/modules/cognito/readme.md index 68dc11b..60d6e91 100644 --- a/infrastructure/modules/cognito/readme.md +++ b/infrastructure/modules/cognito/readme.md @@ -48,9 +48,9 @@ No requirements. ## Providers | Name | Version | -|------|---------| -| [aws](#provider_aws) | n/a | -| [random](#provider_random) | n/a | +| ---- | ------- | +| [aws](#provider\_aws) | 6.43.0 | +| [random](#provider\_random) | 3.8.1 | ## Modules @@ -59,7 +59,7 @@ No modules. ## Resources | Name | Type | -|------|------| +| ---- | ---- | | [aws_cognito_user.cognito_user_creation](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cognito_user) | resource | | [aws_cognito_user_pool.cognito_user_pool](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cognito_user_pool) | resource | | [aws_cognito_user_pool_domain.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cognito_user_pool_domain) | resource | @@ -71,26 +71,26 @@ No modules. ## Inputs | Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [acr](#input_acr) | n/a | `string` | `"AAL1_USERPASS"` | no | -| [amr](#input_amr) | n/a | `string` | `"USERPASS"` | no | -| [attribute_names](#input_attribute_names) | n/a | `list(string)` |
"SNAPSHOT"
]
[| no | -| [deletion_protection](#input_deletion_protection) | ################################################################################# COGNITO ################################################################################# | `string` | `"INACTIVE"` | no | -| [environment](#input_environment) | The name of the Environment this is deployed into, for example CICD, NFT, UAT or PROD | `string` | n/a | yes | -| [message_action](#input_message_action) | n/a | `string` | `"SUPPRESS"` | no | -| [mfa_configuration](#input_mfa_configuration) | n/a | `string` | `"OFF"` | no | -| [name_prefix](#input_name_prefix) | The account, environment etc | `string` | n/a | yes | -| [recovery_window](#input_recovery_window) | The number of days that credentials should be retained for | `number` | n/a | yes | -| [secret_replication_regions](#input_secret_replication_regions) | List of additional regions where created secrets should be replicated | `list(string)` | n/a | yes | -| [user_email](#input_user_email) | n/a | `string` | `"nhsdigital.axe@nhs.net"` | no | -| [user_password](#input_user_password) | n/a | `string` | `"changeme"` | no | +| ---- | ----------- | ---- | ------- | :------: | +| [acr](#input\_acr) | n/a | `string` | `"AAL1_USERPASS"` | no | +| [amr](#input\_amr) | n/a | `string` | `"USERPASS"` | no | +| [attribute\_names](#input\_attribute\_names) | n/a | `list(string)` |
"acr",
"amr",
"email",
"idassurancelevel",
"nhsid_nrbac_roles",
"bss_username",
"sid",
"uid"
]
[| no | +| [deletion\_protection](#input\_deletion\_protection) | ################################################################################# COGNITO ################################################################################# | `string` | `"INACTIVE"` | no | +| [environment](#input\_environment) | The name of the Environment this is deployed into, for example CICD, NFT, UAT or PROD | `string` | n/a | yes | +| [message\_action](#input\_message\_action) | n/a | `string` | `"SUPPRESS"` | no | +| [mfa\_configuration](#input\_mfa\_configuration) | n/a | `string` | `"OFF"` | no | +| [name\_prefix](#input\_name\_prefix) | The account, environment etc | `string` | n/a | yes | +| [recovery\_window](#input\_recovery\_window) | The number of days that credentials should be retained for | `number` | n/a | yes | +| [secret\_replication\_regions](#input\_secret\_replication\_regions) | List of additional regions where created secrets should be replicated | `list(string)` | n/a | yes | +| [user\_email](#input\_user\_email) | n/a | `string` | `"nhsdigital.axe@nhs.net"` | no | +| [user\_password](#input\_user\_password) | n/a | `string` | `"changeme"` | no | ## Outputs | Name | Description | -|------|-------------| -| [secrets_manager_random_passsword_arn](#output_secrets_manager_random_passsword_arn) | n/a | -| [user_pool_domain_prefix](#output_user_pool_domain_prefix) | n/a | -| [user_pool_id](#output_user_pool_id) | n/a | +| ---- | ----------- | +| [secrets\_manager\_random\_passsword\_arn](#output\_secrets\_manager\_random\_passsword\_arn) | n/a | +| [user\_pool\_domain\_prefix](#output\_user\_pool\_domain\_prefix) | n/a | +| [user\_pool\_id](#output\_user\_pool\_id) | n/a | diff --git a/infrastructure/modules/cw-firehose-splunk/readme.md b/infrastructure/modules/cw-firehose-splunk/readme.md index 8f7426d..fbe75e0 100644 --- a/infrastructure/modules/cw-firehose-splunk/readme.md +++ b/infrastructure/modules/cw-firehose-splunk/readme.md @@ -2,18 +2,17 @@ - ## Requirements No requirements. ## Providers -| Name | Version | -| ------------------------------------------------------------ | ------- | -| [archive](#provider_archive) | n/a | -| [aws](#provider_aws) | n/a | -| [local](#provider_local) | n/a | +| Name | Version | +| ---- | ------- | +| [archive](#provider\_archive) | 2.7.1 | +| [aws](#provider\_aws) | 6.43.0 | +| [local](#provider\_local) | 2.8.0 | ## Modules @@ -21,48 +20,47 @@ No modules. ## Resources -| Name | Type | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | -| [aws_iam_policy.cloudwatch_to_firehose](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource | -| [aws_iam_policy.cw_firehose_iam_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource | -| [aws_iam_policy.cw_lambda_iam_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource | -| [aws_iam_role.cloudwatch_to_firehose_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource | -| [aws_iam_role.cw_firehose_iam_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource | -| [aws_iam_role.cw_lambda_iam_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource | -| [aws_iam_role_policy_attachment.cloudwatch_to_firehose_attachment](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | -| [aws_iam_role_policy_attachment.cw_firehose_att](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | -| [aws_iam_role_policy_attachment.cw_lambda_att](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | -| [aws_kinesis_firehose_delivery_stream.cw_logs_splunk_stream](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kinesis_firehose_delivery_stream) | resource | -| [aws_lambda_function.preprocess-cw-logs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function) | resource | -| [aws_s3_bucket.undelivered_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource | -| [aws_s3_bucket_public_access_block.block_public_access](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_public_access_block) | resource | -| [aws_s3_bucket_server_side_encryption_configuration.undelivered_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_server_side_encryption_configuration) | resource | -| [local_file.preprocess-cw-logs-py](https://registry.terraform.io/providers/hashicorp/local/latest/docs/resources/file) | resource | -| [archive_file.preprocess-cw-logs-zip](https://registry.terraform.io/providers/hashicorp/archive/latest/docs/data-sources/file) | data source | -| [aws_iam_policy_document.assume_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | -| [aws_iam_policy_document.cw_firehose_assume_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | -| [aws_iam_policy_document.cw_firehose_doc_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | -| [aws_iam_policy_document.cw_lambda_doc_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | +| Name | Type | +| ---- | ---- | +| [aws_iam_policy.cloudwatch_to_firehose](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource | +| [aws_iam_policy.cw_firehose_iam_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource | +| [aws_iam_policy.cw_lambda_iam_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource | +| [aws_iam_role.cloudwatch_to_firehose_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource | +| [aws_iam_role.cw_firehose_iam_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource | +| [aws_iam_role.cw_lambda_iam_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource | +| [aws_iam_role_policy_attachment.cloudwatch_to_firehose_attachment](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | +| [aws_iam_role_policy_attachment.cw_firehose_att](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | +| [aws_iam_role_policy_attachment.cw_lambda_att](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | +| [aws_kinesis_firehose_delivery_stream.cw_logs_splunk_stream](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kinesis_firehose_delivery_stream) | resource | +| [aws_lambda_function.preprocess-cw-logs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/lambda_function) | resource | +| [aws_s3_bucket.undelivered_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource | +| [aws_s3_bucket_public_access_block.block_public_access](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_public_access_block) | resource | +| [aws_s3_bucket_server_side_encryption_configuration.undelivered_bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_server_side_encryption_configuration) | resource | +| [local_file.preprocess-cw-logs-py](https://registry.terraform.io/providers/hashicorp/local/latest/docs/resources/file) | resource | +| [archive_file.preprocess-cw-logs-zip](https://registry.terraform.io/providers/hashicorp/archive/latest/docs/data-sources/file) | data source | +| [aws_iam_policy_document.assume_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | +| [aws_iam_policy_document.cw_firehose_assume_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | +| [aws_iam_policy_document.cw_firehose_doc_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | +| [aws_iam_policy_document.cw_lambda_doc_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | ## Inputs -| Name | Description | Type | Default | Required | -| ------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------ | :------: | -| [aws_account_id](#input_aws_account_id) | The AWS account ID | `string` | n/a | yes | -| [environment](#input_environment) | The name of the Environment this is deployed into, for example CICD, NFT, UAT or PROD | `string` | n/a | yes | -| [exclude_extra_logging](#input_exclude_extra_logging) | Exclude extra logging information in the Lambda function that preprocesses the CW logs before sending to Splunk | `bool` | `false` | no | -| [firehose_splunk_url](#input_firehose_splunk_url) | URL for splunk | `string` | `"https://firehose.inputs.splunk.aws.digital.nhs.uk/services/collector"` | no | -| [name_prefix](#input_name_prefix) | The account, environment etc | `string` | n/a | yes | -| [python_version](#input_python_version) | The Python version to use for the Lambda function | `string` | n/a | yes | -| [splunk_hec_token](#input_splunk_hec_token) | Splunk HEC token which points to a specific log index in Splunk | `any` | n/a | yes | -| [splunk_index](#input_splunk_index) | Name of the Splunk index to post logs to | `string` | n/a | yes | +| Name | Description | Type | Default | Required | +| ---- | ----------- | ---- | ------- | :------: | +| [aws\_account\_id](#input\_aws\_account\_id) | The AWS account ID | `string` | n/a | yes | +| [environment](#input\_environment) | The name of the Environment this is deployed into, for example CICD, NFT, UAT or PROD | `string` | n/a | yes | +| [exclude\_extra\_logging](#input\_exclude\_extra\_logging) | Exclude extra logging information in the Lambda function that preprocesses the CW logs before sending to Splunk | `bool` | `false` | no | +| [firehose\_splunk\_url](#input\_firehose\_splunk\_url) | URL for splunk | `string` | `"https://firehose.inputs.splunk.aws.digital.nhs.uk/services/collector"` | no | +| [name\_prefix](#input\_name\_prefix) | The account, environment etc | `string` | n/a | yes | +| [python\_version](#input\_python\_version) | The Python version to use for the Lambda function | `string` | n/a | yes | +| [splunk\_hec\_token](#input\_splunk\_hec\_token) | Splunk HEC token which points to a specific log index in Splunk | `any` | n/a | yes | +| [splunk\_index](#input\_splunk\_index) | Name of the Splunk index to post logs to | `string` | n/a | yes | ## Outputs -| Name | Description | -| ----------------------------------------------------------------------------------------------------------------------------------- | ----------- | -| [cw_to_splunk_firehose_role_arn](#output_cw_to_splunk_firehose_role_arn) | n/a | -| [cw_to_splunk_firehose_stream_arn](#output_cw_to_splunk_firehose_stream_arn) | n/a | - +| Name | Description | +| ---- | ----------- | +| [cw\_to\_splunk\_firehose\_role\_arn](#output\_cw\_to\_splunk\_firehose\_role\_arn) | n/a | +| [cw\_to\_splunk\_firehose\_stream\_arn](#output\_cw\_to\_splunk\_firehose\_stream\_arn) | n/a | diff --git a/infrastructure/modules/ecr/readme.md b/infrastructure/modules/ecr/readme.md index aba5897..64ead31 100644 --- a/infrastructure/modules/ecr/readme.md +++ b/infrastructure/modules/ecr/readme.md @@ -8,8 +8,8 @@ No requirements. ## Providers | Name | Version | -|------|---------| -| [aws](#provider_aws) | n/a | +| ---- | ------- | +| [aws](#provider\_aws) | 6.43.0 | ## Modules @@ -18,7 +18,7 @@ No modules. ## Resources | Name | Type | -|------|------| +| ---- | ---- | | [aws_ecr_lifecycle_policy.ecr](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecr_lifecycle_policy) | resource | | [aws_ecr_repository.image_repository](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecr_repository) | resource | | [aws_ecr_repository_policy.ecr_repo_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecr_repository_policy) | resource | @@ -31,11 +31,11 @@ No modules. ## Inputs | Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [developer_sso_role](#input_developer_sso_role) | The SSO role for developers | `string` | n/a | yes | -| [lifecycle_rules](#input_lifecycle_rules) | List of lifecycle rules. Each rule must be an object:
"acr",
"amr",
"email",
"idassurancelevel",
"nhsid_nrbac_roles",
"bss_username",
"sid",
"uid"
]
list(object({
priority = number
description = string
selection = object({
tag_status = string
tag_prefix_list = optional(list(string))
tag_pattern_list = optional(list(string))
count_type = string
count_number = number
count_unit = optional(string)
})
})) | `[]` | no |
-| [name_prefix](#input_name_prefix) | The account, environment etc | `string` | n/a | yes |
-| [repo_name](#input_repo_name) | The name of the ECR repository | `string` | n/a | yes |
+| ---- | ----------- | ---- | ------- | :------: |
+| [developer\_sso\_role](#input\_developer\_sso\_role) | The SSO role for developers | `string` | n/a | yes |
+| [lifecycle\_rules](#input\_lifecycle\_rules) | List of lifecycle rules. Each rule must be an object:list(object({
priority = number
description = string
selection = object({
tag_status = string
tag_prefix_list = optional(list(string))
tag_pattern_list = optional(list(string))
count_type = string
count_number = number
count_unit = optional(string)
})
})) | `[]` | no |
+| [name\_prefix](#input\_name\_prefix) | The account, environment etc | `string` | n/a | yes |
+| [repo\_name](#input\_repo\_name) | The name of the ECR repository | `string` | n/a | yes |
## Outputs
diff --git a/infrastructure/modules/ecr/variables.tf b/infrastructure/modules/ecr/variables.tf
index 83e07aa..da03954 100644
--- a/infrastructure/modules/ecr/variables.tf
+++ b/infrastructure/modules/ecr/variables.tf
@@ -47,4 +47,3 @@ EOT
}))
default = []
}
-
diff --git a/infrastructure/modules/ecs-cluster/ecs.tf b/infrastructure/modules/ecs-cluster/ecs.tf
index bde1eb9..184a883 100644
--- a/infrastructure/modules/ecs-cluster/ecs.tf
+++ b/infrastructure/modules/ecs-cluster/ecs.tf
@@ -99,6 +99,3 @@ resource "aws_cloudwatch_metric_alarm" "task_memory_utilization_alarm" {
comparison_operator = "GreaterThanThreshold"
treat_missing_data = "notBreaching"
}
-
-
-
diff --git a/infrastructure/modules/ecs-cluster/readme.md b/infrastructure/modules/ecs-cluster/readme.md
index 17dd1fb..eddd822 100644
--- a/infrastructure/modules/ecs-cluster/readme.md
+++ b/infrastructure/modules/ecs-cluster/readme.md
@@ -9,8 +9,8 @@ No requirements.
## Providers
| Name | Version |
-|------|---------|
-| [aws](#provider_aws) | n/a |
+| ---- | ------- |
+| [aws](#provider\_aws) | 6.43.0 |
## Modules
@@ -19,7 +19,7 @@ No modules.
## Resources
| Name | Type |
-|------|------|
+| ---- | ---- |
| [aws_cloudwatch_metric_alarm.task_cpu_utilization_alarm](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_metric_alarm) | resource |
| [aws_cloudwatch_metric_alarm.task_memory_utilization_alarm](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_metric_alarm) | resource |
| [aws_ecs_cluster.ecs_cluster](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecs_cluster) | resource |
@@ -32,21 +32,21 @@ No modules.
## Inputs
| Name | Description | Type | Default | Required |
-|------|-------------|------|---------|:--------:|
-| [aws_account_id](#input_aws_account_id) | The AWS account ID | `string` | n/a | yes |
-| [container_port](#input_container_port) | n/a | `number` | `4000` | no |
-| [create_ecs_service_role](#input_create_ecs_service_role) | The service role can only be created once per account, only enable it in one stack | `bool` | `true` | no |
-| [environment](#input_environment) | The name of the Environment this is deployed into, for example CICD, NFT, UAT or PROD | `string` | n/a | yes |
-| [name](#input_name) | the unique name of the resource | `string` | `"ecs"` | no |
-| [name_prefix](#input_name_prefix) | The account, environment etc | `string` | n/a | yes |
-| [vpc_id](#input_vpc_id) | id of the vpc | `string` | n/a | yes |
+| ---- | ----------- | ---- | ------- | :------: |
+| [aws\_account\_id](#input\_aws\_account\_id) | The AWS account ID | `string` | n/a | yes |
+| [container\_port](#input\_container\_port) | n/a | `number` | `4000` | no |
+| [create\_ecs\_service\_role](#input\_create\_ecs\_service\_role) | The service role can only be created once per account, only enable it in one stack | `bool` | `true` | no |
+| [environment](#input\_environment) | The name of the Environment this is deployed into, for example CICD, NFT, UAT or PROD | `string` | n/a | yes |
+| [name](#input\_name) | the unique name of the resource | `string` | `"ecs"` | no |
+| [name\_prefix](#input\_name\_prefix) | The account, environment etc | `string` | n/a | yes |
+| [vpc\_id](#input\_vpc\_id) | id of the vpc | `string` | n/a | yes |
## Outputs
| Name | Description |
-|------|-------------|
-| [ecs_cluster_arn](#output_ecs_cluster_arn) | n/a |
-| [ecs_cluster_name](#output_ecs_cluster_name) | n/a |
-| [ecs_sg_id](#output_ecs_sg_id) | n/a |
+| ---- | ----------- |
+| [ecs\_cluster\_arn](#output\_ecs\_cluster\_arn) | n/a |
+| [ecs\_cluster\_name](#output\_ecs\_cluster\_name) | n/a |
+| [ecs\_sg\_id](#output\_ecs\_sg\_id) | n/a |
diff --git a/infrastructure/modules/elasticache/main.tf b/infrastructure/modules/elasticache/main.tf
index 3adc117..fc2c899 100644
--- a/infrastructure/modules/elasticache/main.tf
+++ b/infrastructure/modules/elasticache/main.tf
@@ -105,4 +105,3 @@ resource "aws_cloudwatch_log_group" "redis_slow_log" {
#kms_key_id = data.aws_kms_key.kms_key.arn
retention_in_days = 365
}
-
diff --git a/infrastructure/modules/elasticache/readme.md b/infrastructure/modules/elasticache/readme.md
index ece474c..494b3f5 100644
--- a/infrastructure/modules/elasticache/readme.md
+++ b/infrastructure/modules/elasticache/readme.md
@@ -9,8 +9,8 @@ No requirements.
## Providers
| Name | Version |
-|------|---------|
-| [aws](#provider_aws) | n/a |
+| ---- | ------- |
+| [aws](#provider\_aws) | 6.43.0 |
## Modules
@@ -19,7 +19,7 @@ No modules.
## Resources
| Name | Type |
-|------|------|
+| ---- | ---- |
| [aws_cloudwatch_log_group.redis_engine_log](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group) | resource |
| [aws_cloudwatch_log_group.redis_slow_log](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group) | resource |
| [aws_elasticache_parameter_group.bss_param_group_redis7](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elasticache_parameter_group) | resource |
@@ -33,33 +33,33 @@ No modules.
## Inputs
| Name | Description | Type | Default | Required |
-|------|-------------|------|---------|:--------:|
-| [apply_immediately](#input_apply_immediately) | whether to apply changes immediately - false will apply in maintenance window | `bool` | `false` | no |
-| [auto_failover_enabled](#input_auto_failover_enabled) | n/a | `any` | n/a | yes |
-| [aws_account_id](#input_aws_account_id) | The AWS account ID | `string` | n/a | yes |
-| [create_elasticache_service_role](#input_create_elasticache_service_role) | The service role can only be created once per account, only enable it in one stack | `bool` | `true` | no |
-| [ecs_sg_id](#input_ecs_sg_id) | The id of the ECS security group to enable access for | `string` | n/a | yes |
-| [elasticache_port](#input_elasticache_port) | Port on which Elasticache runs | `number` | `6379` | no |
-| [engine_version](#input_engine_version) | The Elasticache engine version | `any` | n/a | yes |
-| [environment](#input_environment) | The name of the Environment this is deployed into, for example CICD, NFT, UAT or PROD | `string` | n/a | yes |
-| [multi_az](#input_multi_az) | n/a | `any` | n/a | yes |
-| [name](#input_name) | The name of the resource | `string` | `"elasticache"` | no |
-| [name_prefix](#input_name_prefix) | the prefix for the name which containts the environment and business unit | `string` | n/a | yes |
-| [node_type](#input_node_type) | n/a | `any` | n/a | yes |
-| [notification_topic_arn](#input_notification_topic_arn) | Name of the SNS topic used for Elasticache alerts | `any` | n/a | yes |
-| [number_of_shards](#input_number_of_shards) | n/a | `number` | `1` | no |
-| [redis_auth_token](#input_redis_auth_token) | Auth token for Redis cache | `any` | n/a | yes |
-| [replicas_per_node_group](#input_replicas_per_node_group) | n/a | `number` | `2` | no |
-| [replication_group_description](#input_replication_group_description) | Description for replication group | `string` | `"Redis cache for BS-Select application"` | no |
-| [subnet_ids](#input_subnet_ids) | The subnets that will be used for elasticache, usually private | `list(string)` | n/a | yes |
-| [vpc_id](#input_vpc_id) | The ID for the VPC | `string` | n/a | yes |
+| ---- | ----------- | ---- | ------- | :------: |
+| [apply\_immediately](#input\_apply\_immediately) | whether to apply changes immediately - false will apply in maintenance window | `bool` | `false` | no |
+| [auto\_failover\_enabled](#input\_auto\_failover\_enabled) | n/a | `any` | n/a | yes |
+| [aws\_account\_id](#input\_aws\_account\_id) | The AWS account ID | `string` | n/a | yes |
+| [create\_elasticache\_service\_role](#input\_create\_elasticache\_service\_role) | The service role can only be created once per account, only enable it in one stack | `bool` | `true` | no |
+| [ecs\_sg\_id](#input\_ecs\_sg\_id) | The id of the ECS security group to enable access for | `string` | n/a | yes |
+| [elasticache\_port](#input\_elasticache\_port) | Port on which Elasticache runs | `number` | `6379` | no |
+| [engine\_version](#input\_engine\_version) | The Elasticache engine version | `any` | n/a | yes |
+| [environment](#input\_environment) | The name of the Environment this is deployed into, for example CICD, NFT, UAT or PROD | `string` | n/a | yes |
+| [multi\_az](#input\_multi\_az) | n/a | `any` | n/a | yes |
+| [name](#input\_name) | The name of the resource | `string` | `"elasticache"` | no |
+| [name\_prefix](#input\_name\_prefix) | the prefix for the name which containts the environment and business unit | `string` | n/a | yes |
+| [node\_type](#input\_node\_type) | n/a | `any` | n/a | yes |
+| [notification\_topic\_arn](#input\_notification\_topic\_arn) | Name of the SNS topic used for Elasticache alerts | `any` | n/a | yes |
+| [number\_of\_shards](#input\_number\_of\_shards) | n/a | `number` | `1` | no |
+| [redis\_auth\_token](#input\_redis\_auth\_token) | Auth token for Redis cache | `any` | n/a | yes |
+| [replicas\_per\_node\_group](#input\_replicas\_per\_node\_group) | n/a | `number` | `2` | no |
+| [replication\_group\_description](#input\_replication\_group\_description) | Description for replication group | `string` | `"Redis cache for BS-Select application"` | no |
+| [subnet\_ids](#input\_subnet\_ids) | The subnets that will be used for elasticache, usually private | `list(string)` | n/a | yes |
+| [vpc\_id](#input\_vpc\_id) | The ID for the VPC | `string` | n/a | yes |
## Outputs
| Name | Description |
-|------|-------------|
-| [redis_configuration_endpoint_address](#output_redis_configuration_endpoint_address) | n/a |
-| [redis_configuration_endpoint_port](#output_redis_configuration_endpoint_port) | n/a |
-| [redis_security_group_id](#output_redis_security_group_id) | n/a |
+| ---- | ----------- |
+| [redis\_configuration\_endpoint\_address](#output\_redis\_configuration\_endpoint\_address) | n/a |
+| [redis\_configuration\_endpoint\_port](#output\_redis\_configuration\_endpoint\_port) | n/a |
+| [redis\_security\_group\_id](#output\_redis\_security\_group\_id) | n/a |
diff --git a/infrastructure/modules/github-config/readme.md b/infrastructure/modules/github-config/readme.md
index 78cf516..aadac28 100644
--- a/infrastructure/modules/github-config/readme.md
+++ b/infrastructure/modules/github-config/readme.md
@@ -2,18 +2,17 @@
-
## Requirements
-| Name | Version |
-| --------------------------------------------------------------- | ------- |
-| [github](#requirement_github) | ~> 6.0 |
+| Name | Version |
+| ---- | ------- |
+| [github](#requirement\_github) | ~> 6.0 |
## Providers
-| Name | Version |
-| --------------------------------------------------------- | ------- |
-| [github](#provider_github) | ~> 6.0 |
+| Name | Version |
+| ---- | ------- |
+| [github](#provider\_github) | 6.12.1 |
## Modules
@@ -21,24 +20,23 @@ No modules.
## Resources
-| Name | Type |
-| ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
-| [github_actions_environment_secret.aws_account](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/actions_environment_secret) | resource |
-| [github_repository_environment.repo_environment](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/repository_environment) | resource |
-| [github_repository.repo](https://registry.terraform.io/providers/integrations/github/latest/docs/data-sources/repository) | data source |
+| Name | Type |
+| ---- | ---- |
+| [github_actions_environment_secret.aws_account](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/actions_environment_secret) | resource |
+| [github_repository_environment.repo_environment](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/repository_environment) | resource |
+| [github_repository.repo](https://registry.terraform.io/providers/integrations/github/latest/docs/data-sources/repository) | data source |
## Inputs
-| Name | Description | Type | Default | Required |
-| --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -------- | ------- | :------: |
-| [aws_account_id](#input_aws_account_id) | The AWS account ID | `string` | n/a | yes |
-| [environment](#input_environment) | The name of the Environment this is deployed into, for example CICD, NFT, UAT or PROD | `string` | n/a | yes |
-| [github_app_token](#input_github_app_token) | The GitHub App token used to authenticate with the GitHub provider | `string` | n/a | yes |
-| [github_repo_name](#input_github_repo_name) | the name for the github repo | `string` | n/a | yes |
+| Name | Description | Type | Default | Required |
+| ---- | ----------- | ---- | ------- | :------: |
+| [aws\_account\_id](#input\_aws\_account\_id) | The AWS account ID | `string` | n/a | yes |
+| [environment](#input\_environment) | The name of the Environment this is deployed into, for example CICD, NFT, UAT or PROD | `string` | n/a | yes |
+| [github\_app\_token](#input\_github\_app\_token) | The GitHub App token used to authenticate with the GitHub provider | `string` | n/a | yes |
+| [github\_repo\_name](#input\_github\_repo\_name) | the name for the github repo | `string` | n/a | yes |
## Outputs
No outputs.
-
diff --git a/infrastructure/modules/kms/README.md b/infrastructure/modules/kms/README.md
new file mode 100644
index 0000000..c9b4aa8
--- /dev/null
+++ b/infrastructure/modules/kms/README.md
@@ -0,0 +1,121 @@
+
+# AWS KMS Terraform module
+Terraform module to provision a [KMS](https://aws.amazon.com/kms/) key with alias.
+
+
+
+
+## Usage
+
+```hcl
+ module "kms_key" {
+ source = "git::https://github.com/NHSDigital/screening-terraform-modules-aws.git//infrastructure/modules/kms"
+
+ service = "bcss"
+ project = "bcss"
+ environment = "test"
+ stack = "bootstrap"
+ workspace = terraform.workspace
+ name = "terraform-state"
+
+ label_order = ["service", "environment", "stack", "workspace", "name", "attributes"]
+
+ description = "KMS key for Terraform state bucket encryption"
+ deletion_window_in_days = 10
+ enable_key_rotation = true
+ }
+```
+
+
+
+
+
+
+
+
+
+
+
+## Requirements
+
+| Name | Version |
+| ---- | ------- |
+| [terraform](#requirement\_terraform) | >= 1.5.7 |
+| [aws](#requirement\_aws) | >= 6.28 |
+
+## Providers
+
+No providers.
+
+## Modules
+
+| Name | Source | Version |
+| ---- | ------ | ------- |
+| [kms\_key](#module\_kms\_key) | terraform-aws-modules/kms/aws | 4.2.0 |
+| [this](#module\_this) | git::https://github.com/NHSDigital/screening-terraform-modules-aws.git//infrastructure/modules/tags | feature/BCSS-23189-add-new-modules-to-suppport-bcss |
+
+## Resources
+
+No resources.
+
+## Inputs
+
+| Name | Description | Type | Default | Required |
+| ---- | ----------- | ---- | ------- | :------: |
+| [additional\_tag\_map](#input\_additional\_tag\_map) | Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not added to `tags` or `id`.{
"additional_tag_map": {},
"attributes": [],
"delimiter": null,
"descriptor_formats": {},
"enabled": true,
"environment": null,
"id_length_limit": null,
"label_key_case": null,
"label_order": [],
"label_value_case": null,
"labels_as_tags": [
"unset"
],
"project": null,
"regex_replace_chars": null,
"region": null,
"service": null,
"stack": null,
"tags": {},
"workspace": null
} | no |
+| [customer\_master\_key\_spec](#input\_customer\_master\_key\_spec) | Specifies whether the key contains a symmetric key or an asymmetric key pair and the encryption algorithms or signing algorithms that the key supports. Valid values: `SYMMETRIC_DEFAULT`, `RSA_2048`, `RSA_3072`, `RSA_4096`, `ECC_NIST_P256`, `ECC_NIST_P384`, `ECC_NIST_P521`, or `ECC_SECG_P256K1`. | `string` | `"SYMMETRIC_DEFAULT"` | no |
+| [data\_classification](#input\_data\_classification) | Used to identify the data classification of the resource, e.g 1-5 | `string` | `"n/a"` | no |
+| [data\_type](#input\_data\_type) | The tag data\_type | `string` | `"None"` | no |
+| [deletion\_window\_in\_days](#input\_deletion\_window\_in\_days) | Duration in days after which the key is deleted after destruction of the resource | `number` | `14` | no |
+| [delimiter](#input\_delimiter) | Delimiter to be used between ID elements.list(object({
sid = optional(string)
actions = optional(list(string))
not_actions = optional(list(string))
effect = optional(string)
resources = optional(list(string))
not_resources = optional(list(string))
principals = optional(list(object({
type = string
identifiers = list(string)
})))
not_principals = optional(list(object({
type = string
identifiers = list(string)
})))
condition = optional(list(object({
test = string
values = list(string)
variable = string
})))
})) | `null` | no |
+| [key\_usage](#input\_key\_usage) | Specifies the intended use of the key. Valid values: `ENCRYPT_DECRYPT` or `SIGN_VERIFY`. | `string` | `"ENCRYPT_DECRYPT"` | no |
+| [key\_users](#input\_key\_users) | A list of IAM ARNs for [key users](https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-default.html#key-policy-default-allow-users) | `list(string)` | `[]` | no |
+| [label\_key\_case](#input\_label\_key\_case) | Controls the letter case of the `tags` keys (label names) for tags generated by this module.[| no | +| [name](#input\_name) | ID element. Usually the component or solution name, e.g. 'app' or 'jenkins'.
"default"
]
[| no | -| [description](#input_description) | The description for the Lambda layer | `string` | n/a | yes | -| [layer_name](#input_layer_name) | The name of the Lambda layer | `string` | n/a | yes | -| [name_prefix](#input_name_prefix) | the prefix standard | `string` | n/a | yes | -| [source_path](#input_source_path) | The path of the stored layer zip file | `string` | `"../../layers"` | no | +| ---- | ----------- | ---- | ------- | :------: | +| [compatible\_runtimes](#input\_compatible\_runtimes) | Compatible Python runtimes for the Lambda layer | `list(string)` |
"python3.12"
]
[| no | +| [description](#input\_description) | The description for the Lambda layer | `string` | n/a | yes | +| [layer\_name](#input\_layer\_name) | The name of the Lambda layer | `string` | n/a | yes | +| [name\_prefix](#input\_name\_prefix) | the prefix standard | `string` | n/a | yes | +| [source\_path](#input\_source\_path) | The path of the stored layer zip file | `string` | `"../../layers"` | no | ## Outputs | Name | Description | -|------|-------------| -| [layer_arn](#output_layer_arn) | n/a | +| ---- | ----------- | +| [layer\_arn](#output\_layer\_arn) | n/a | diff --git a/infrastructure/modules/lambda/readme.md b/infrastructure/modules/lambda/readme.md index 132300d..273590c 100644 --- a/infrastructure/modules/lambda/readme.md +++ b/infrastructure/modules/lambda/readme.md @@ -8,19 +8,19 @@ No requirements. ## Providers | Name | Version | -|------|---------| -| [aws](#provider_aws) | n/a | +| ---- | ------- | +| [aws](#provider\_aws) | 6.43.0 | ## Modules | Name | Source | Version | -|------|--------|---------| -| [lambda_function](#module_lambda_function) | terraform-aws-modules/lambda/aws | 8.7.0 | +| ---- | ------ | ------- | +| [lambda\_function](#module\_lambda\_function) | terraform-aws-modules/lambda/aws | 8.7.0 | ## Resources | Name | Type | -|------|------| +| ---- | ---- | | [aws_iam_role_policy_attachment.lambda_to_cw_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | | [aws_iam_role_policy_attachment.push_to_cloudwatch](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | | [aws_iam_role_policy_attachment.sqs](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource | @@ -29,25 +29,25 @@ No requirements. ## Inputs | Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [environment](#input_environment) | Values to set in the Lambda function environment | `map(string)` | `{}` | no | -| [function_description](#input_function_description) | The description for the Lambda function | `string` | n/a | yes | -| [function_name](#input_function_name) | The name of the Lambda function | `string` | `"uk-forwarder"` | no | -| [handler_prefix](#input_handler_prefix) | The prefix for the Lambda handler function | `string` | n/a | yes | -| [layers](#input_layers) | List of Lambda Layer ARNs to attach to the function | `list(string)` | `[]` | no | -| [name_prefix](#input_name_prefix) | the prefix standard | `string` | n/a | yes | -| [python_version](#input_python_version) | The Python version to use for the Lambda function | `string` | n/a | yes | -| [timeout](#input_timeout) | Timeout for the Lambda function in seconds | `number` | `120` | no | -| [vpc_security_group_ids](#input_vpc_security_group_ids) | List of VPC security group IDs for the Lambda function | `list(string)` | `[]` | no | -| [vpc_subnet_ids](#input_vpc_subnet_ids) | List of VPC subnet IDs for the Lambda function | `list(string)` | `[]` | no | +| ---- | ----------- | ---- | ------- | :------: | +| [environment](#input\_environment) | Values to set in the Lambda function environment | `map(string)` | `{}` | no | +| [function\_description](#input\_function\_description) | The description for the Lambda function | `string` | n/a | yes | +| [function\_name](#input\_function\_name) | The name of the Lambda function | `string` | `"uk-forwarder"` | no | +| [handler\_prefix](#input\_handler\_prefix) | The prefix for the Lambda handler function | `string` | n/a | yes | +| [layers](#input\_layers) | List of Lambda Layer ARNs to attach to the function | `list(string)` | `[]` | no | +| [name\_prefix](#input\_name\_prefix) | the prefix standard | `string` | n/a | yes | +| [python\_version](#input\_python\_version) | The Python version to use for the Lambda function | `string` | n/a | yes | +| [timeout](#input\_timeout) | Timeout for the Lambda function in seconds | `number` | `120` | no | +| [vpc\_security\_group\_ids](#input\_vpc\_security\_group\_ids) | List of VPC security group IDs for the Lambda function | `list(string)` | `[]` | no | +| [vpc\_subnet\_ids](#input\_vpc\_subnet\_ids) | List of VPC subnet IDs for the Lambda function | `list(string)` | `[]` | no | ## Outputs | Name | Description | -|------|-------------| -| [arn](#output_arn) | n/a | -| [function_name](#output_function_name) | n/a | -| [lambda_arn](#output_lambda_arn) | n/a | -| [lambda_log_group_name](#output_lambda_log_group_name) | n/a | -| [role_name](#output_role_name) | n/a | +| ---- | ----------- | +| [arn](#output\_arn) | n/a | +| [function\_name](#output\_function\_name) | n/a | +| [lambda\_arn](#output\_lambda\_arn) | n/a | +| [lambda\_log\_group\_name](#output\_lambda\_log\_group\_name) | n/a | +| [role\_name](#output\_role\_name) | n/a | diff --git a/infrastructure/modules/parameter_store/readme.md b/infrastructure/modules/parameter_store/readme.md index 0b40a0f..2634801 100644 --- a/infrastructure/modules/parameter_store/readme.md +++ b/infrastructure/modules/parameter_store/readme.md @@ -9,8 +9,8 @@ No requirements. ## Providers | Name | Version | -|------|---------| -| [aws](#provider_aws) | n/a | +| ---- | ------- | +| [aws](#provider\_aws) | 6.43.0 | ## Modules @@ -19,18 +19,18 @@ No modules. ## Resources | Name | Type | -|------|------| +| ---- | ---- | | [aws_ssm_parameter.cognito_users](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ssm_parameter) | resource | | [aws_ssm_parameter.ecs_cw_agent_config_parameter](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ssm_parameter) | resource | ## Inputs | Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [cloudwatch_agent_config_json](#input_cloudwatch_agent_config_json) | The CloudWatch Agent configuration JSON for ECS tasks | `string` | `""` | no | -| [enable_cloudwatch_agent](#input_enable_cloudwatch_agent) | Whether to create the CloudWatch Agent configuration parameter for ECS tasks | `bool` | `false` | no | -| [environment](#input_environment) | The name of the Environment this is deployed into, for example CICD, NFT, UAT or PROD | `string` | n/a | yes | -| [name_prefix](#input_name_prefix) | The account, environment etc | `string` | n/a | yes | +| ---- | ----------- | ---- | ------- | :------: | +| [cloudwatch\_agent\_config\_json](#input\_cloudwatch\_agent\_config\_json) | The CloudWatch Agent configuration JSON for ECS tasks | `string` | `""` | no | +| [enable\_cloudwatch\_agent](#input\_enable\_cloudwatch\_agent) | Whether to create the CloudWatch Agent configuration parameter for ECS tasks | `bool` | `false` | no | +| [environment](#input\_environment) | The name of the Environment this is deployed into, for example CICD, NFT, UAT or PROD | `string` | n/a | yes | +| [name\_prefix](#input\_name\_prefix) | The account, environment etc | `string` | n/a | yes | ## Outputs diff --git a/infrastructure/modules/r53-healthcheck/outputs.tf b/infrastructure/modules/r53-healthcheck/outputs.tf index 8b13789..e69de29 100644 --- a/infrastructure/modules/r53-healthcheck/outputs.tf +++ b/infrastructure/modules/r53-healthcheck/outputs.tf @@ -1 +0,0 @@ - diff --git a/infrastructure/modules/r53-healthcheck/r53-healthcheck.tf b/infrastructure/modules/r53-healthcheck/r53-healthcheck.tf index c634499..7a90a95 100644 --- a/infrastructure/modules/r53-healthcheck/r53-healthcheck.tf +++ b/infrastructure/modules/r53-healthcheck/r53-healthcheck.tf @@ -131,5 +131,3 @@ resource "aws_cloudwatch_metric_alarm" "bs_select_health_check_web_app_healthy" insufficient_data_actions = [] treat_missing_data = "notBreaching" } - - diff --git a/infrastructure/modules/r53-healthcheck/readme.md b/infrastructure/modules/r53-healthcheck/readme.md index 360de83..9b561db 100644 --- a/infrastructure/modules/r53-healthcheck/readme.md +++ b/infrastructure/modules/r53-healthcheck/readme.md @@ -8,10 +8,10 @@ No requirements. ## Providers | Name | Version | -|------|---------| -| [archive](#provider_archive) | n/a | -| [aws](#provider_aws) | n/a | -| [aws.us_east_1](#provider_aws.us_east_1) | n/a | +| ---- | ------- | +| [archive](#provider\_archive) | 2.7.1 | +| [aws](#provider\_aws) | 6.43.0 | +| [aws.us\_east\_1](#provider\_aws.us\_east\_1) | 6.43.0 | ## Modules @@ -20,7 +20,7 @@ No modules. ## Resources | Name | Type | -|------|------| +| ---- | ---- | | [aws_cloudwatch_metric_alarm.bs_select_health_check_web_app_healthy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_metric_alarm) | resource | | [aws_iam_role.lambda_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource | | [aws_iam_role_policy.sns_publish_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | resource | @@ -35,10 +35,10 @@ No modules. ## Inputs | Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [environment](#input_environment) | the environment the healthcheck is deployed into | `any` | n/a | yes | -| [name_prefix](#input_name_prefix) | the name prefix for the healthcheck | `any` | n/a | yes | -| [sns_topic](#input_sns_topic) | Existing SNS topic in eu-west-2 for notifications | `string` | n/a | yes | +| ---- | ----------- | ---- | ------- | :------: | +| [environment](#input\_environment) | the environment the healthcheck is deployed into | `any` | n/a | yes | +| [name\_prefix](#input\_name\_prefix) | the name prefix for the healthcheck | `any` | n/a | yes | +| [sns\_topic](#input\_sns\_topic) | Existing SNS topic in eu-west-2 for notifications | `string` | n/a | yes | ## Outputs diff --git a/infrastructure/modules/rds-database/readme.md b/infrastructure/modules/rds-database/readme.md index 22eb3cf..f282e75 100644 --- a/infrastructure/modules/rds-database/readme.md +++ b/infrastructure/modules/rds-database/readme.md @@ -5,15 +5,15 @@ ## Requirements | Name | Version | -|------|---------| -| [postgresql](#requirement_postgresql) | >= 1.25.0 | +| ---- | ------- | +| [postgresql](#requirement\_postgresql) | >= 1.25.0 | ## Providers | Name | Version | -|------|---------| -| [aws](#provider_aws) | n/a | -| [postgresql](#provider_postgresql) | >= 1.25.0 | +| ---- | ------- | +| [aws](#provider\_aws) | 6.43.0 | +| [postgresql](#provider\_postgresql) | 1.26.0 | ## Modules @@ -22,7 +22,7 @@ No modules. ## Resources | Name | Type | -|------|------| +| ---- | ---- | | [postgresql_database.my_db](https://registry.terraform.io/providers/cyrilgdn/postgresql/latest/docs/resources/database) | resource | | [aws_db_instance.rds](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/db_instance) | data source | | [aws_secretsmanager_secret.release_manager_password](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/secretsmanager_secret) | data source | @@ -31,11 +31,11 @@ No modules. ## Inputs | Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [db_name](#input_db_name) | the name for the users database | `string` | n/a | yes | -| [environment](#input_environment) | the environment the resource is deployed into | `string` | n/a | yes | -| [name_prefix](#input_name_prefix) | The name prefix which includes environment and region details | `string` | n/a | yes | -| [rds_name](#input_rds_name) | the name of the service | `string` | `"postgres"` | no | +| ---- | ----------- | ---- | ------- | :------: | +| [db\_name](#input\_db\_name) | the name for the users database | `string` | n/a | yes | +| [environment](#input\_environment) | the environment the resource is deployed into | `string` | n/a | yes | +| [name\_prefix](#input\_name\_prefix) | The name prefix which includes environment and region details | `string` | n/a | yes | +| [rds\_name](#input\_rds\_name) | the name of the service | `string` | `"postgres"` | no | ## Outputs diff --git a/infrastructure/modules/rds-gateway-ecs-task/outputs.tf b/infrastructure/modules/rds-gateway-ecs-task/outputs.tf index 8b13789..e69de29 100644 --- a/infrastructure/modules/rds-gateway-ecs-task/outputs.tf +++ b/infrastructure/modules/rds-gateway-ecs-task/outputs.tf @@ -1 +0,0 @@ - diff --git a/infrastructure/modules/rds-gateway-ecs-task/readme.md b/infrastructure/modules/rds-gateway-ecs-task/readme.md index 54f2f8d..a6444d2 100644 --- a/infrastructure/modules/rds-gateway-ecs-task/readme.md +++ b/infrastructure/modules/rds-gateway-ecs-task/readme.md @@ -8,8 +8,8 @@ No requirements. ## Providers | Name | Version | -|------|---------| -| [aws](#provider_aws) | n/a | +| ---- | ------- | +| [aws](#provider\_aws) | 6.43.0 | ## Modules @@ -18,7 +18,7 @@ No modules. ## Resources | Name | Type | -|------|------| +| ---- | ---- | | [aws_cloudwatch_log_group.log_group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group) | resource | | [aws_ecs_service.ecs_service](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecs_service) | resource | | [aws_ecs_task_definition.task_definition](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecs_task_definition) | resource | @@ -35,15 +35,15 @@ No modules. ## Inputs | Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [aws_account_id](#input_aws_account_id) | The aws account id | `string` | n/a | yes | -| [ecs_cluster_name](#input_ecs_cluster_name) | The ECS cluster name | `string` | n/a | yes | -| [image_name](#input_image_name) | The image name for the ECS task | `string` | `"public.ecr.aws/docker/library/busybox:stable"` | no | -| [name_prefix](#input_name_prefix) | The account, environment etc | `string` | n/a | yes | -| [private_subnet_ids](#input_private_subnet_ids) | List of private subnet IDs | `list(string)` | n/a | yes | -| [rds_sg_id](#input_rds_sg_id) | The security group ID of the RDS instance | `string` | n/a | yes | -| [replica_task_count](#input_replica_task_count) | The number of task replicas to run | `number` | `1` | no | -| [vpc_id](#input_vpc_id) | id of the vpc | `string` | n/a | yes | +| ---- | ----------- | ---- | ------- | :------: | +| [aws\_account\_id](#input\_aws\_account\_id) | The aws account id | `string` | n/a | yes | +| [ecs\_cluster\_name](#input\_ecs\_cluster\_name) | The ECS cluster name | `string` | n/a | yes | +| [image\_name](#input\_image\_name) | The image name for the ECS task | `string` | `"public.ecr.aws/docker/library/busybox:stable"` | no | +| [name\_prefix](#input\_name\_prefix) | The account, environment etc | `string` | n/a | yes | +| [private\_subnet\_ids](#input\_private\_subnet\_ids) | List of private subnet IDs | `list(string)` | n/a | yes | +| [rds\_sg\_id](#input\_rds\_sg\_id) | The security group ID of the RDS instance | `string` | n/a | yes | +| [replica\_task\_count](#input\_replica\_task\_count) | The number of task replicas to run | `number` | `1` | no | +| [vpc\_id](#input\_vpc\_id) | id of the vpc | `string` | n/a | yes | ## Outputs diff --git a/infrastructure/modules/rds-instance/readme.md b/infrastructure/modules/rds-instance/readme.md index 068e8aa..e9b1a57 100644 --- a/infrastructure/modules/rds-instance/readme.md +++ b/infrastructure/modules/rds-instance/readme.md @@ -5,15 +5,15 @@ ## Requirements | Name | Version | -|------|---------| -| [postgresql](#requirement_postgresql) | >= 1.25.0 | +| ---- | ------- | +| [postgresql](#requirement\_postgresql) | >= 1.25.0 | ## Providers | Name | Version | -|------|---------| -| [aws](#provider_aws) | n/a | -| [random](#provider_random) | n/a | +| ---- | ------- | +| [aws](#provider\_aws) | 6.43.0 | +| [random](#provider\_random) | 3.8.1 | ## Modules @@ -22,7 +22,7 @@ No modules. ## Resources | Name | Type | -|------|------| +| ---- | ---- | | [aws_db_instance.rds](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance) | resource | | [aws_db_parameter_group.parameter_group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_parameter_group) | resource | | [aws_db_subnet_group.private_bss](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_subnet_group) | resource | @@ -40,61 +40,61 @@ No modules. ## Inputs | Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [allocated_storage](#input_allocated_storage) | The amount of storage to allocate to the database in GB | `number` | `50` | no | -| [allow_major_version_upgrade](#input_allow_major_version_upgrade) | Whether to allow major version upgrades to the database | `bool` | `false` | no | -| [apply_immediately](#input_apply_immediately) | Whether to apply changes to the database immediately | `bool` | `true` | no | -| [auto_minor_version_upgrade](#input_auto_minor_version_upgrade) | Whether to automatically upgrade the database to the latest minor version | `bool` | `true` | no | -| [aws_account_id](#input_aws_account_id) | The AWS account ID | `string` | n/a | yes | -| [aws_secret_id](#input_aws_secret_id) | The name of the secret that holds the postgresql login details | `string` | n/a | yes | -| [backup_retention_period](#input_backup_retention_period) | The number of days to retain automated backups for | `number` | `4` | no | -| [backup_window](#input_backup_window) | The time window to perform automated backups in UTC (HH:MM-HH:MM) | `string` | `"01:00-02:00"` | no | -| [cloudwatch_log_retention_days](#input_cloudwatch_log_retention_days) | Number of days to retain CloudWatch logs | `number` | `7` | no | -| [copy_tags_to_snapshot](#input_copy_tags_to_snapshot) | Whether to copy tags to database snapshots | `bool` | `true` | no | -| [database_insights_mode](#input_database_insights_mode) | Whether to set database insights mode to standard or advanced | `string` | n/a | yes | -| [db_max_connections](#input_db_max_connections) | how many connections are allowed | `number` | `5000` | no | -| [db_storage_encryption](#input_db_storage_encryption) | Whether the database storage should be encrypted | `bool` | `true` | no | -| [deletion_protection](#input_deletion_protection) | Whether to enable deletion protection for the database | `bool` | `false` | no | -| [ecs_sg_id](#input_ecs_sg_id) | The security group ID for the ECS service | `string` | n/a | yes | -| [enable_backup](#input_enable_backup) | Whether to enable automated backups for the database | `bool` | `false` | no | -| [enabled_cloudwatch_logs_exports](#input_enabled_cloudwatch_logs_exports) | Which logs should be exported | `list(string)` |
"python3.12"
]
[| no | -| [encryption](#input_encryption) | If encryption should be enabled | `bool` | `true` | no | -| [environment](#input_environment) | The name of the Environment this is deployed into, for example CICD, NFT, UAT or PROD | `string` | n/a | yes | -| [iops](#input_iops) | specify the provisioned IOPS, cannot be used if gp3 storage allocation is below 400 | `number` | `3000` | no | -| [is_temporary_shutdown](#input_is_temporary_shutdown) | Whether the database is in a temporary shutdown state (not a standard AWS attribute) | `bool` | `false` | no | -| [maintenance_window](#input_maintenance_window) | The time window to perform maintenance on the database in UTC (Day:HH:MM-Day:HH:MM) | `string` | `"Tue:02:30-Tue:03:30"` | no | -| [monitoring_interval](#input_monitoring_interval) | The interval in seconds to monitor the database | `number` | `10` | no | -| [multi_az](#input_multi_az) | Whether to deploy the database in multiple Availability Zones | `bool` | `true` | no | -| [name](#input_name) | The name of the resource | `any` | n/a | yes | -| [name_prefix](#input_name_prefix) | The account, environment etc | `string` | n/a | yes | -| [performance_insights_enabled](#input_performance_insights_enabled) | Whether to enable Performance Insights for the database | `bool` | `false` | no | -| [performance_insights_retention_period](#input_performance_insights_retention_period) | The number of days to retain Performance Insights data for | `number` | `7` | no | -| [port](#input_port) | The port the database will listen on | `number` | `5432` | no | -| [private_subnet_ids](#input_private_subnet_ids) | A list of private subnets to use | `list(string)` | n/a | yes | -| [publicly_accessible](#input_publicly_accessible) | Whether the database is publicly accessible | `bool` | `false` | no | -| [rds_engine](#input_rds_engine) | The engine for the RDS instance | `string` | `"postgres"` | no | -| [rds_engine_version](#input_rds_engine_version) | The engine version for the RDS instance | `string` | `"16"` | no | -| [rds_instance_class](#input_rds_instance_class) | The instance class for the RDS instance | `string` | n/a | yes | -| [recovery_window](#input_recovery_window) | The number of days that credentials should be retained for | `number` | n/a | yes | -| [secret_replication_regions](#input_secret_replication_regions) | List of additional regions where created secrets should be replicated | `list(string)` | n/a | yes | -| [skip_final_snapshot](#input_skip_final_snapshot) | Should there be a snapshot taken when instance destroyed | `bool` | `false` | no | -| [snapshot_identifier](#input_snapshot_identifier) | Optional snapshot identifier to restore from (e.g. if on performance environent) | `string` | `""` | no | -| [storage](#input_storage) | The storage size for the instance | `string` | `100` | no | -| [storage_type](#input_storage_type) | The type of storage used, options are 'standard', 'gp2', 'gp3', 'io1' or 'io2' | `string` | `"gp3"` | no | -| [tags](#input_tags) | A map of tags to assign to the RDS instance in addition to the default tags | `map(string)` | `{}` | no | -| [user](#input_user) | username for postgres instance to use | `string` | `"postgres"` | no | -| [vpc_id](#input_vpc_id) | The id for the vpc | `string` | n/a | yes | -| [vpc_name](#input_vpc_name) | vpc name | `string` | `""` | no | +| ---- | ----------- | ---- | ------- | :------: | +| [allocated\_storage](#input\_allocated\_storage) | The amount of storage to allocate to the database in GB | `number` | `50` | no | +| [allow\_major\_version\_upgrade](#input\_allow\_major\_version\_upgrade) | Whether to allow major version upgrades to the database | `bool` | `false` | no | +| [apply\_immediately](#input\_apply\_immediately) | Whether to apply changes to the database immediately | `bool` | `true` | no | +| [auto\_minor\_version\_upgrade](#input\_auto\_minor\_version\_upgrade) | Whether to automatically upgrade the database to the latest minor version | `bool` | `true` | no | +| [aws\_account\_id](#input\_aws\_account\_id) | The AWS account ID | `string` | n/a | yes | +| [aws\_secret\_id](#input\_aws\_secret\_id) | The name of the secret that holds the postgresql login details | `string` | n/a | yes | +| [backup\_retention\_period](#input\_backup\_retention\_period) | The number of days to retain automated backups for | `number` | `4` | no | +| [backup\_window](#input\_backup\_window) | The time window to perform automated backups in UTC (HH:MM-HH:MM) | `string` | `"01:00-02:00"` | no | +| [cloudwatch\_log\_retention\_days](#input\_cloudwatch\_log\_retention\_days) | Number of days to retain CloudWatch logs | `number` | `7` | no | +| [copy\_tags\_to\_snapshot](#input\_copy\_tags\_to\_snapshot) | Whether to copy tags to database snapshots | `bool` | `true` | no | +| [database\_insights\_mode](#input\_database\_insights\_mode) | Whether to set database insights mode to standard or advanced | `string` | n/a | yes | +| [db\_max\_connections](#input\_db\_max\_connections) | how many connections are allowed | `number` | `5000` | no | +| [db\_storage\_encryption](#input\_db\_storage\_encryption) | Whether the database storage should be encrypted | `bool` | `true` | no | +| [deletion\_protection](#input\_deletion\_protection) | Whether to enable deletion protection for the database | `bool` | `false` | no | +| [ecs\_sg\_id](#input\_ecs\_sg\_id) | The security group ID for the ECS service | `string` | n/a | yes | +| [enable\_backup](#input\_enable\_backup) | Whether to enable automated backups for the database | `bool` | `false` | no | +| [enabled\_cloudwatch\_logs\_exports](#input\_enabled\_cloudwatch\_logs\_exports) | Which logs should be exported | `list(string)` |
"postgresql"
]
[| no | +| [encryption](#input\_encryption) | If encryption should be enabled | `bool` | `true` | no | +| [environment](#input\_environment) | The name of the Environment this is deployed into, for example CICD, NFT, UAT or PROD | `string` | n/a | yes | +| [iops](#input\_iops) | specify the provisioned IOPS, cannot be used if gp3 storage allocation is below 400 | `number` | `3000` | no | +| [is\_temporary\_shutdown](#input\_is\_temporary\_shutdown) | Whether the database is in a temporary shutdown state (not a standard AWS attribute) | `bool` | `false` | no | +| [maintenance\_window](#input\_maintenance\_window) | The time window to perform maintenance on the database in UTC (Day:HH:MM-Day:HH:MM) | `string` | `"Tue:02:30-Tue:03:30"` | no | +| [monitoring\_interval](#input\_monitoring\_interval) | The interval in seconds to monitor the database | `number` | `10` | no | +| [multi\_az](#input\_multi\_az) | Whether to deploy the database in multiple Availability Zones | `bool` | `true` | no | +| [name](#input\_name) | The name of the resource | `any` | n/a | yes | +| [name\_prefix](#input\_name\_prefix) | The account, environment etc | `string` | n/a | yes | +| [performance\_insights\_enabled](#input\_performance\_insights\_enabled) | Whether to enable Performance Insights for the database | `bool` | `false` | no | +| [performance\_insights\_retention\_period](#input\_performance\_insights\_retention\_period) | The number of days to retain Performance Insights data for | `number` | `7` | no | +| [port](#input\_port) | The port the database will listen on | `number` | `5432` | no | +| [private\_subnet\_ids](#input\_private\_subnet\_ids) | A list of private subnets to use | `list(string)` | n/a | yes | +| [publicly\_accessible](#input\_publicly\_accessible) | Whether the database is publicly accessible | `bool` | `false` | no | +| [rds\_engine](#input\_rds\_engine) | The engine for the RDS instance | `string` | `"postgres"` | no | +| [rds\_engine\_version](#input\_rds\_engine\_version) | The engine version for the RDS instance | `string` | `"16"` | no | +| [rds\_instance\_class](#input\_rds\_instance\_class) | The instance class for the RDS instance | `string` | n/a | yes | +| [recovery\_window](#input\_recovery\_window) | The number of days that credentials should be retained for | `number` | n/a | yes | +| [secret\_replication\_regions](#input\_secret\_replication\_regions) | List of additional regions where created secrets should be replicated | `list(string)` | n/a | yes | +| [skip\_final\_snapshot](#input\_skip\_final\_snapshot) | Should there be a snapshot taken when instance destroyed | `bool` | `false` | no | +| [snapshot\_identifier](#input\_snapshot\_identifier) | Optional snapshot identifier to restore from (e.g. if on performance environent) | `string` | `""` | no | +| [storage](#input\_storage) | The storage size for the instance | `string` | `100` | no | +| [storage\_type](#input\_storage\_type) | The type of storage used, options are 'standard', 'gp2', 'gp3', 'io1' or 'io2' | `string` | `"gp3"` | no | +| [tags](#input\_tags) | A map of tags to assign to the RDS instance in addition to the default tags | `map(string)` | `{}` | no | +| [user](#input\_user) | username for postgres instance to use | `string` | `"postgres"` | no | +| [vpc\_id](#input\_vpc\_id) | The id for the vpc | `string` | n/a | yes | +| [vpc\_name](#input\_vpc\_name) | vpc name | `string` | `""` | no | ## Outputs | Name | Description | -|------|-------------| -| [rds_instance_address](#output_rds_instance_address) | Endpoint of the instance excluding port | -| [rds_instance_arn](#output_rds_instance_arn) | The ARN of the RDS instance | -| [rds_instance_endpoint](#output_rds_instance_endpoint) | The endpoint of the RDS instance including port | -| [rds_instance_id](#output_rds_instance_id) | The ID of the RDS instance | -| [rds_name](#output_rds_name) | n/a | -| [rds_sg_id](#output_rds_sg_id) | The security group ID for the RDS instance | +| ---- | ----------- | +| [rds\_instance\_address](#output\_rds\_instance\_address) | Endpoint of the instance excluding port | +| [rds\_instance\_arn](#output\_rds\_instance\_arn) | The ARN of the RDS instance | +| [rds\_instance\_endpoint](#output\_rds\_instance\_endpoint) | The endpoint of the RDS instance including port | +| [rds\_instance\_id](#output\_rds\_instance\_id) | The ID of the RDS instance | +| [rds\_name](#output\_rds\_name) | n/a | +| [rds\_sg\_id](#output\_rds\_sg\_id) | The security group ID for the RDS instance | diff --git a/infrastructure/modules/rds-users/main.tf b/infrastructure/modules/rds-users/main.tf index ad69f61..0034b2d 100644 --- a/infrastructure/modules/rds-users/main.tf +++ b/infrastructure/modules/rds-users/main.tf @@ -103,4 +103,3 @@ resource "postgresql_role" "pi_4_user_role" { provider = postgresql search_path = ["pi_4"] } - diff --git a/infrastructure/modules/rds-users/readme.md b/infrastructure/modules/rds-users/readme.md index 92f43ba..b8193ed 100644 --- a/infrastructure/modules/rds-users/readme.md +++ b/infrastructure/modules/rds-users/readme.md @@ -5,16 +5,16 @@ ## Requirements | Name | Version | -|------|---------| -| [postgresql](#requirement_postgresql) | >= 1.25.0 | +| ---- | ------- | +| [postgresql](#requirement\_postgresql) | >= 1.25.0 | ## Providers | Name | Version | -|------|---------| -| [aws](#provider_aws) | n/a | -| [postgresql](#provider_postgresql) | >= 1.25.0 | -| [random](#provider_random) | n/a | +| ---- | ------- | +| [aws](#provider\_aws) | 6.43.0 | +| [postgresql](#provider\_postgresql) | 1.26.0 | +| [random](#provider\_random) | 3.8.1 | ## Modules @@ -23,7 +23,7 @@ No modules. ## Resources | Name | Type | -|------|------| +| ---- | ---- | | [aws_secretsmanager_secret.password](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/secretsmanager_secret) | resource | | [aws_secretsmanager_secret_version.password](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/secretsmanager_secret_version) | resource | | [postgresql_role.audit_user_role](https://registry.terraform.io/providers/cyrilgdn/postgresql/latest/docs/resources/role) | resource | @@ -37,19 +37,19 @@ No modules. ## Inputs | Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [name_prefix](#input_name_prefix) | The account, environment etc | `string` | n/a | yes | -| [rds_endpoint](#input_rds_endpoint) | The endpoint to connect to the rds instance | `string` | n/a | yes | -| [rds_engine_version](#input_rds_engine_version) | The engine version for the RDS instance | `string` | `"12.5"` | no | -| [rds_password](#input_rds_password) | the password to login to rds with | `string` | n/a | yes | -| [recovery_window](#input_recovery_window) | The number of days that credentials should be retained for | `number` | n/a | yes | -| [secret_replication_regions](#input_secret_replication_regions) | List of additional regions where created secrets should be replicated | `list(string)` | `[]` | no | -| [users](#input_users) | List of usernames to generate passwords and secrets for | `list(string)` |
"postgresql"
]
[| no | +| ---- | ----------- | ---- | ------- | :------: | +| [name\_prefix](#input\_name\_prefix) | The account, environment etc | `string` | n/a | yes | +| [rds\_endpoint](#input\_rds\_endpoint) | The endpoint to connect to the rds instance | `string` | n/a | yes | +| [rds\_engine\_version](#input\_rds\_engine\_version) | The engine version for the RDS instance | `string` | `"12.5"` | no | +| [rds\_password](#input\_rds\_password) | the password to login to rds with | `string` | n/a | yes | +| [recovery\_window](#input\_recovery\_window) | The number of days that credentials should be retained for | `number` | n/a | yes | +| [secret\_replication\_regions](#input\_secret\_replication\_regions) | List of additional regions where created secrets should be replicated | `list(string)` | `[]` | no | +| [users](#input\_users) | List of usernames to generate passwords and secrets for | `list(string)` |
"pi_4_user",
"bss_user",
"bss_readwrite",
"bss_readonly",
"audit_user",
"release_manager"
]
[| no | ## Outputs | Name | Description | -|------|-------------| -| [bss_user_secret_arn](#output_bss_user_secret_arn) | n/a | +| ---- | ----------- | +| [bss\_user\_secret\_arn](#output\_bss\_user\_secret\_arn) | n/a | diff --git a/infrastructure/modules/s3/main.tf b/infrastructure/modules/s3/main.tf index 6b2f5ce..4632d9b 100644 --- a/infrastructure/modules/s3/main.tf +++ b/infrastructure/modules/s3/main.tf @@ -43,4 +43,3 @@ resource "aws_s3_bucket_policy" "access_policy" { bucket = aws_s3_bucket.bucket.id policy = var.bucket_policy } - diff --git a/infrastructure/modules/s3/readme.md b/infrastructure/modules/s3/readme.md index 92d2c07..0f8c51a 100644 --- a/infrastructure/modules/s3/readme.md +++ b/infrastructure/modules/s3/readme.md @@ -9,8 +9,8 @@ No requirements. ## Providers | Name | Version | -|------|---------| -| [aws](#provider_aws) | n/a | +| ---- | ------- | +| [aws](#provider\_aws) | 6.43.0 | ## Modules @@ -19,7 +19,7 @@ No modules. ## Resources | Name | Type | -|------|------| +| ---- | ---- | | [aws_s3_bucket.bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource | | [aws_s3_bucket_logging.bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_logging) | resource | | [aws_s3_bucket_ownership_controls.ownership](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket_ownership_controls) | resource | @@ -31,13 +31,13 @@ No modules. ## Inputs | Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [additional_kms_key_policy_statements](#input_additional_kms_key_policy_statements) | Additional statements to add to the kms key policy | `list(any)` | `[]` | no | -| [bucket_name](#input_bucket_name) | The name of the bucket | `string` | n/a | yes | -| [bucket_policy](#input_bucket_policy) | The access policy for the bucket | `string` | n/a | yes | -| [environment](#input_environment) | The name of the Environment this is deployed into, for example CICD, NFT, UAT or PROD | `string` | n/a | yes | -| [logging_bucket](#input_logging_bucket) | The bucket where logs are stored for s3 events | `string` | `"logging"` | no | -| [name_prefix](#input_name_prefix) | provides the prefix to keep consistancy | `string` | n/a | yes | +| ---- | ----------- | ---- | ------- | :------: | +| [additional\_kms\_key\_policy\_statements](#input\_additional\_kms\_key\_policy\_statements) | Additional statements to add to the kms key policy | `list(any)` | `[]` | no | +| [bucket\_name](#input\_bucket\_name) | The name of the bucket | `string` | n/a | yes | +| [bucket\_policy](#input\_bucket\_policy) | The access policy for the bucket | `string` | n/a | yes | +| [environment](#input\_environment) | The name of the Environment this is deployed into, for example CICD, NFT, UAT or PROD | `string` | n/a | yes | +| [logging\_bucket](#input\_logging\_bucket) | The bucket where logs are stored for s3 events | `string` | `"logging"` | no | +| [name\_prefix](#input\_name\_prefix) | provides the prefix to keep consistancy | `string` | n/a | yes | ## Outputs diff --git a/infrastructure/modules/sns/readme.md b/infrastructure/modules/sns/readme.md index e05a855..73f6a64 100644 --- a/infrastructure/modules/sns/readme.md +++ b/infrastructure/modules/sns/readme.md @@ -9,8 +9,8 @@ No requirements. ## Providers | Name | Version | -|------|---------| -| [aws](#provider_aws) | n/a | +| ---- | ------- | +| [aws](#provider\_aws) | 6.43.0 | ## Modules @@ -19,7 +19,7 @@ No modules. ## Resources | Name | Type | -|------|------| +| ---- | ---- | | [aws_sns_topic.sns_topic](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sns_topic) | resource | | [aws_sns_topic_policy.sns_topic_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sns_topic_policy) | resource | | [aws_iam_policy_document.sns_topic_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source | @@ -27,16 +27,16 @@ No modules. ## Inputs | Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [aws_account_id](#input_aws_account_id) | The AWS account ID | `string` | n/a | yes | -| [environment](#input_environment) | The name of the Environment this is deployed into, for example CICD, NFT, UAT or PROD | `string` | n/a | yes | -| [name_prefix](#input_name_prefix) | The account, environment etc | `string` | n/a | yes | +| ---- | ----------- | ---- | ------- | :------: | +| [aws\_account\_id](#input\_aws\_account\_id) | The AWS account ID | `string` | n/a | yes | +| [environment](#input\_environment) | The name of the Environment this is deployed into, for example CICD, NFT, UAT or PROD | `string` | n/a | yes | +| [name\_prefix](#input\_name\_prefix) | The account, environment etc | `string` | n/a | yes | ## Outputs | Name | Description | -|------|-------------| -| [sns_topic_arn](#output_sns_topic_arn) | n/a | -| [sns_topic_name](#output_sns_topic_name) | n/a | +| ---- | ----------- | +| [sns\_topic\_arn](#output\_sns\_topic\_arn) | n/a | +| [sns\_topic\_name](#output\_sns\_topic\_name) | n/a | diff --git a/infrastructure/modules/sns/variables.tf b/infrastructure/modules/sns/variables.tf index 4f8ba41..cca1020 100644 --- a/infrastructure/modules/sns/variables.tf +++ b/infrastructure/modules/sns/variables.tf @@ -13,4 +13,3 @@ variable "environment" { description = "The name of the Environment this is deployed into, for example CICD, NFT, UAT or PROD" type = string } - diff --git a/infrastructure/modules/sqs/readme.md b/infrastructure/modules/sqs/readme.md index cc08c01..e07ad48 100644 --- a/infrastructure/modules/sqs/readme.md +++ b/infrastructure/modules/sqs/readme.md @@ -9,8 +9,8 @@ No requirements. ## Providers | Name | Version | -|------|---------| -| [aws](#provider_aws) | n/a | +| ---- | ------- | +| [aws](#provider\_aws) | 6.43.0 | ## Modules @@ -19,7 +19,7 @@ No modules. ## Resources | Name | Type | -|------|------| +| ---- | ---- | | [aws_sqs_queue.queue](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sqs_queue) | resource | | [aws_sqs_queue.sqs_queue](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sqs_queue) | resource | | [aws_sqs_queue_policy.allow_sns_publish](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/sqs_queue_policy) | resource | @@ -27,15 +27,15 @@ No modules. ## Inputs | Name | Description | Type | Default | Required | -|------|-------------|------|---------|:--------:| -| [name_prefix](#input_name_prefix) | The account, environment etc | `string` | n/a | yes | -| [stack_name](#input_stack_name) | Name of stack calling the module to use in resource naming | `string` | n/a | yes | -| [topic_arn](#input_topic_arn) | Source SNS topic arn | `any` | n/a | yes | +| ---- | ----------- | ---- | ------- | :------: | +| [name\_prefix](#input\_name\_prefix) | The account, environment etc | `string` | n/a | yes | +| [stack\_name](#input\_stack\_name) | Name of stack calling the module to use in resource naming | `string` | n/a | yes | +| [topic\_arn](#input\_topic\_arn) | Source SNS topic arn | `any` | n/a | yes | ## Outputs | Name | Description | -|------|-------------| -| [arn](#output_arn) | n/a | +| ---- | ----------- | +| [arn](#output\_arn) | n/a | diff --git a/infrastructure/modules/tags/README.md b/infrastructure/modules/tags/README.md new file mode 100644 index 0000000..0a617cf --- /dev/null +++ b/infrastructure/modules/tags/README.md @@ -0,0 +1,149 @@ +# AWS Tag Terraform module + +Terraform module designed to generate consistent names and tags for resources. Use `tags` to implement a strict naming and tagging convention. + +There are 8 inputs considered "labels" or "ID elements" (because the labels are used to construct the ID): +1. service +1. project +1. region +1. environment +1. workspace +1. stack +1. name +1. attributes + +This module generates IDs using the following convention by default: `{service}-{project}-{environment}-{stack}-{name}-{attributes}`. +However, it is highly configurable. The delimiter (e.g. `-`) is configurable. Each label item is optional (although you must provide at least one). +So if you prefer the term `workspace` to `environment` and do not need `stack`, you can exclude them +and the label `id` will look like `{service}-{project}-{workspace}-{name}-{attributes}`. +- The `attributes` input is actually a list of strings and `{attributes}` expands to the list elements joined by the delimiter. +- If `attributes` is excluded but `service`, `project`, and `workspace` are included, `id` will look like `{service}-{project}-{workspace}-{name}`. + Excluding `attributes` is discouraged, though, because attributes are the main way modules modify the ID to ensure uniqueness when provisioning the same resource types. +- If you want the label items in a different order, you can specify that, too, with the `label_order` list. +- You can set a maximum length for the `id`, and the module will create a (probably) unique name that fits within that length. + (The module uses a portion of the MD5 hash of the full `id` to represent the missing part, so there remains a slight chance of name collision.) +- You can control the letter case of the generated labels which make up the `id` using `var.label_value_case`. +- By default, all of the non-empty labels are also exported as tags, whether they appear in the `id` or not. +You can control which labels are exported as tags by setting `labels_as_tags` to the list of labels you want exported, +or the empty list `[]` if you want no labels exported as tags at all. Tags passed in via the `tags` variable are +always exported, and regardless of settings, empty labels are never exported as tags. +You can control the case of the tag names (keys) for the labels using `var.label_key_case`. +Unlike the tags generated from the label inputs, tags passed in via the `tags` input are not modified. + +There is an unfortunate collision over the use of the key `name`. We use `name` in this module +to represent the component, such as `eks` or `rds`. AWS uses a tag with the key `Name` to store the full human-friendly +identifier of the thing tagged, which this module outputs as `id`, not `name`. So when converting input labels +to tags, the value of the `Name` key is set to the module `id` output, and there is no tag corresponding to the +module `name` output. An empty `name` label will not prevent the `Name` tag from being exported. + +It's recommended to use one `tags` module for every unique resource of a given resource type. +For example, if you have 10 instances, there should be 10 different labels. +However, if you have multiple different kinds of resources (e.g. instances, security groups, file systems, and elastic ips), then they can all share the same label assuming they are logically related. + +For most purposes, the `id` output is sufficient to create an ID or label for a resource, and if you want a different +ID or a different format, you would instantiate another instance of `tags` and configure it accordingly. However, +to accommodate situations where you want all the same inputs to generate multiple descriptors, this module provides +the `descriptors` output, which is a map of strings generated according to the format specified by the +`descriptor_formats` input. This feature is intentionally simple and minimally configurable and will not be +enhanced to add more features that are already in `tags`. See [examples/complete/descriptors.tf](examples/complete/descriptors.tf) for examples. + + +The recommended convention is to use labels as follows: +- `service`: A short (3-4 letters) abbreviation of the service directorate to ensure globally unique IDs for things like S3 buckets i.e. bcss +- `project`: The name or role of the project the resource is for, such as `web` or `api` +- `region`: By default this will auto-populate the provider region, but can be overridden or set to `gbl` for resources like IAM roles that have no region +- `environment`: The name or role of the account the resource is for, such as `prod` or `dev` +- `workspace`: _(Rarely needed)_ Typically, the singular environment label suffices as there would only be a singular resource created per environment. On occasion, there may be multiple sub-environment, still of a singular environment/with shared environment resources i.e. sit1, sit2, nft1, nft2). `workspace` can be used to identify the specific sub-environment the resources relate to and by default is auto-populated to the `terraform.workspace` value. +- `name`: The name of the component that owns the resources, such as `eks` or `rds` + +## Usage + +## Examples + + +## Requirements + +| Name | Version | +| ---- | ------- | +| [terraform](#requirement\_terraform) | >= 1.13.0 | +| [aws](#requirement\_aws) | >= 6.14.0 | + +## Providers + +| Name | Version | +| ---- | ------- | +| [aws](#provider\_aws) | 6.43.0 | + +## Modules + +No modules. + +## Resources + +| Name | Type | +| ---- | ---- | +| [aws_caller_identity.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity) | data source | +| [aws_iam_session_context.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_session_context) | data source | +| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source | + +## Inputs + +| Name | Description | Type | Default | Required | +| ---- | ----------- | ---- | ------- | :------: | +| [additional\_tag\_map](#input\_additional\_tag\_map) | Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not added to `tags` or `id`.
"pi_4_user",
"bss_user",
"bss_readwrite",
"bss_readonly",
"audit_user",
"release_manager"
]
{
"additional_tag_map": {},
"attributes": [],
"delimiter": null,
"descriptor_formats": {},
"enabled": true,
"environment": null,
"id_length_limit": null,
"label_key_case": null,
"label_order": [],
"label_value_case": null,
"labels_as_tags": [
"unset"
],
"project": null,
"regex_replace_chars": null,
"region": null,
"service": null,
"stack": null,
"tags": {},
"workspace": null
} | no |
+| [data\_classification](#input\_data\_classification) | Used to identify the data classification of the resource, e.g 1-5 | `string` | `"n/a"` | no |
+| [data\_type](#input\_data\_type) | The tag data\_type | `string` | `"None"` | no |
+| [delimiter](#input\_delimiter) | Delimiter to be used between ID elements.[| no | +| [name](#input\_name) | ID element. Usually the component or solution name, e.g. 'app' or 'jenkins'.
"default"
]
{
"additional_tag_map": {},
"attributes": [],
"delimiter": null,
"descriptor_formats": {},
"enabled": true,
"environment": null,
"id_length_limit": null,
"label_key_case": null,
"label_order": [],
"label_value_case": null,
"labels_as_tags": [
"unset"
],
"project": null,
"regex_replace_chars": null,
"region": null,
"service": null,
"stack": null,
"tags": {},
"workspace": null
} | no |
+| [data\_classification](#input\_data\_classification) | Used to identify the data classification of the resource, e.g 1-5 | `string` | `"n/a"` | no |
+| [data\_type](#input\_data\_type) | The tag data\_type | `string` | `"None"` | no |
+| [delimiter](#input\_delimiter) | Delimiter to be used between ID elements.[| no | +| [name](#input\_name) | ID element. Usually the component or solution name, e.g. 'app' or 'jenkins'.
"default"
]