diff --git a/README.md b/README.md index 225a0c5..f9fa9e2 100644 --- a/README.md +++ b/README.md @@ -220,6 +220,7 @@ Available targets: | port | Redis port | `number` | `6379` | no | | regex\_replace\_chars | Regex to replace chars with empty string in `namespace`, `environment`, `stage` and `name`.
If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no | | replication\_group\_id | Replication group ID with the following constraints:
A name must contain from 1 to 20 alphanumeric characters or hyphens.
The first character must be a letter.
A name cannot end with a hyphen or contain two consecutive hyphens. | `string` | `""` | no | +| snapshot\_arns | A single-element string list containing an Amazon Resource Name (ARN) of a Redis RDB snapshot file stored in Amazon S3. Example: arn:aws:s3:::my\_bucket/snapshot1.rdb | `list(string)` | `[]` | no | | snapshot\_name | The name of a snapshot from which to restore data into the new node group. Changing the snapshot\_name forces a new resource. | `string` | `null` | no | | snapshot\_retention\_limit | The number of days for which ElastiCache will retain automatic cache cluster snapshots before deleting them. | `number` | `0` | no | | snapshot\_window | The daily time range (in UTC) during which ElastiCache will begin taking a daily snapshot of your cache cluster. | `string` | `"06:30-07:30"` | no | diff --git a/docs/terraform.md b/docs/terraform.md index 3c9577e..92032bf 100644 --- a/docs/terraform.md +++ b/docs/terraform.md @@ -57,6 +57,7 @@ | port | Redis port | `number` | `6379` | no | | regex\_replace\_chars | Regex to replace chars with empty string in `namespace`, `environment`, `stage` and `name`.
If not set, `"/[^a-zA-Z0-9-]/"` is used to remove all characters other than hyphens, letters and digits. | `string` | `null` | no | | replication\_group\_id | Replication group ID with the following constraints:
A name must contain from 1 to 20 alphanumeric characters or hyphens.
The first character must be a letter.
A name cannot end with a hyphen or contain two consecutive hyphens. | `string` | `""` | no | +| snapshot\_arns | A single-element string list containing an Amazon Resource Name (ARN) of a Redis RDB snapshot file stored in Amazon S3. Example: arn:aws:s3:::my\_bucket/snapshot1.rdb | `list(string)` | `[]` | no | | snapshot\_name | The name of a snapshot from which to restore data into the new node group. Changing the snapshot\_name forces a new resource. | `string` | `null` | no | | snapshot\_retention\_limit | The number of days for which ElastiCache will retain automatic cache cluster snapshots before deleting them. | `number` | `0` | no | | snapshot\_window | The daily time range (in UTC) during which ElastiCache will begin taking a daily snapshot of your cache cluster. | `string` | `"06:30-07:30"` | no | diff --git a/main.tf b/main.tf index 2fa72a8..7cddd17 100644 --- a/main.tf +++ b/main.tf @@ -97,6 +97,7 @@ resource "aws_elasticache_replication_group" "default" { transit_encryption_enabled = var.transit_encryption_enabled kms_key_id = var.at_rest_encryption_enabled ? var.kms_key_id : null snapshot_name = var.snapshot_name + snapshot_arns = var.snapshot_arns snapshot_window = var.snapshot_window snapshot_retention_limit = var.snapshot_retention_limit apply_immediately = var.apply_immediately diff --git a/variables.tf b/variables.tf index b585e9c..52dbb8a 100644 --- a/variables.tf +++ b/variables.tf @@ -175,6 +175,12 @@ variable "replication_group_id" { default = "" } +variable "snapshot_arns" { + type = list(string) + description = "A single-element string list containing an Amazon Resource Name (ARN) of a Redis RDB snapshot file stored in Amazon S3. Example: arn:aws:s3:::my_bucket/snapshot1.rdb" + default = [] +} + variable "snapshot_name" { type = string