Skip to content

Commit c653545

Browse files
authored
feat!: Upgrade AWS provider and min required Terraform version to 6.0 and 1.5.7 respectively (#16)
1 parent ac296c8 commit c653545

File tree

10 files changed

+44
-25
lines changed

10 files changed

+44
-25
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,14 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module
118118

119119
| Name | Version |
120120
|------|---------|
121-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
122-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.82 |
121+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.7 |
122+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.0 |
123123

124124
## Providers
125125

126126
| Name | Version |
127127
|------|---------|
128-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.82 |
128+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.0 |
129129

130130
## Modules
131131

@@ -174,6 +174,7 @@ No modules.
174174
| <a name="input_parameter_group_tags"></a> [parameter\_group\_tags](#input\_parameter\_group\_tags) | Additional tags for the parameter group created | `map(string)` | `{}` | no |
175175
| <a name="input_parameter_group_use_name_prefix"></a> [parameter\_group\_use\_name\_prefix](#input\_parameter\_group\_use\_name\_prefix) | Determines whether `parameter_group_name` is used as a prefix | `bool` | `false` | no |
176176
| <a name="input_port"></a> [port](#input\_port) | The port number on which each of the nodes accepts connections. Defaults to `6379` | `number` | `null` | no |
177+
| <a name="input_region"></a> [region](#input\_region) | Region where this resource will be managed. Defaults to the Region set in the provider configuration | `string` | `null` | no |
177178
| <a name="input_security_group_ids"></a> [security\_group\_ids](#input\_security\_group\_ids) | Set of VPC Security Group ID-s to associate with this cluster | `list(string)` | `null` | no |
178179
| <a name="input_snapshot_arns"></a> [snapshot\_arns](#input\_snapshot\_arns) | List of ARN-s that uniquely identify RDB snapshot files stored in S3. The snapshot files will be used to populate the new cluster | `list(string)` | `null` | no |
179180
| <a name="input_snapshot_name"></a> [snapshot\_name](#input\_snapshot\_name) | The name of a snapshot from which to restore data into the new cluster | `string` | `null` | no |
@@ -188,7 +189,7 @@ No modules.
188189
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to use on all resources | `map(string)` | `{}` | no |
189190
| <a name="input_tls_enabled"></a> [tls\_enabled](#input\_tls\_enabled) | A flag to enable in-transit encryption on the cluster. When set to `false`, the `acl_name` must be `open-access`. Defaults to `true` | `bool` | `null` | no |
190191
| <a name="input_use_name_prefix"></a> [use\_name\_prefix](#input\_use\_name\_prefix) | Determines whether `name` is used as a prefix for the cluster | `bool` | `false` | no |
191-
| <a name="input_users"></a> [users](#input\_users) | A map of user definitions (maps) to be created | `any` | `{}` | no |
192+
| <a name="input_users"></a> [users](#input\_users) | A map of user definitions (maps) to be created | <pre>map(object({<br/> user_name = string<br/> access_string = string<br/> type = optional(string, "password")<br/> passwords = optional(list(string))<br/> tags = optional(map(string), {})<br/> }))</pre> | `{}` | no |
192193

193194
## Outputs
194195

examples/complete/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ Note that this example may create resources which will incur monetary charges on
2525

2626
| Name | Version |
2727
|------|---------|
28-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
29-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.82 |
28+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.7 |
29+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.0 |
3030
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 3.0 |
3131

3232
## Providers
3333

3434
| Name | Version |
3535
|------|---------|
36-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.82 |
36+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.0 |
3737
| <a name="provider_random"></a> [random](#provider\_random) | >= 3.0 |
3838

3939
## Modules
@@ -43,7 +43,7 @@ Note that this example may create resources which will incur monetary charges on
4343
| <a name="module_memory_db"></a> [memory\_db](#module\_memory\_db) | ../.. | n/a |
4444
| <a name="module_memory_db_disabled"></a> [memory\_db\_disabled](#module\_memory\_db\_disabled) | ../.. | n/a |
4545
| <a name="module_security_group"></a> [security\_group](#module\_security\_group) | terraform-aws-modules/security-group/aws | ~> 4.0 |
46-
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 5.0 |
46+
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 6.0 |
4747

4848
## Resources
4949

examples/complete/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ module "memory_db" {
9595

9696
module "vpc" {
9797
source = "terraform-aws-modules/vpc/aws"
98-
version = "~> 5.0"
98+
version = "~> 6.0"
9999

100100
name = local.name
101101
cidr = "10.99.0.0/18"

examples/complete/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
terraform {
2-
required_version = ">= 1.0"
2+
required_version = ">= 1.5.7"
33

44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.82"
7+
version = ">= 6.0"
88
}
99
random = {
1010
source = "hashicorp/random"

examples/valkey/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ Note that this example may create resources which will incur monetary charges on
2525

2626
| Name | Version |
2727
|------|---------|
28-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
29-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.82 |
28+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.7 |
29+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.0 |
3030
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 3.0 |
3131

3232
## Providers
3333

3434
| Name | Version |
3535
|------|---------|
36-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.82 |
36+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.0 |
3737
| <a name="provider_random"></a> [random](#provider\_random) | >= 3.0 |
3838

3939
## Modules
@@ -43,7 +43,7 @@ Note that this example may create resources which will incur monetary charges on
4343
| <a name="module_memory_db"></a> [memory\_db](#module\_memory\_db) | ../.. | n/a |
4444
| <a name="module_memory_db_disabled"></a> [memory\_db\_disabled](#module\_memory\_db\_disabled) | ../.. | n/a |
4545
| <a name="module_security_group"></a> [security\_group](#module\_security\_group) | terraform-aws-modules/security-group/aws | ~> 4.0 |
46-
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 5.0 |
46+
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 6.0 |
4747

4848
## Resources
4949

examples/valkey/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ module "memory_db" {
9696

9797
module "vpc" {
9898
source = "terraform-aws-modules/vpc/aws"
99-
version = "~> 5.0"
99+
version = "~> 6.0"
100100

101101
name = local.name
102102
cidr = "10.98.0.0/18"

examples/valkey/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
terraform {
2-
required_version = ">= 1.0"
2+
required_version = ">= 1.5.7"
33

44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.82"
7+
version = ">= 6.0"
88
}
99
random = {
1010
source = "hashicorp/random"

main.tf

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ resource "aws_memorydb_cluster" "this" {
4545
snapshot_retention_limit = var.snapshot_retention_limit
4646
snapshot_window = var.snapshot_window
4747
final_snapshot_name = var.final_snapshot_name
48+
region = var.region
4849

4950
tags = var.tags
5051
}
@@ -58,13 +59,14 @@ resource "aws_memorydb_user" "this" {
5859

5960
user_name = each.value.user_name
6061
access_string = each.value.access_string
62+
region = var.region
6163

6264
authentication_mode {
63-
type = try(each.value.type, "password")
64-
passwords = try(each.value.passwords, null)
65+
type = each.value.type
66+
passwords = each.value.passwords
6567
}
6668

67-
tags = merge(var.tags, lookup(each.value, "tags", {}))
69+
tags = merge(var.tags, each.value.tags)
6870
}
6971

7072
################################################################################
@@ -78,6 +80,7 @@ resource "aws_memorydb_acl" "this" {
7880
name_prefix = var.acl_use_name_prefix ? "${local.create_acl_name}-" : null
7981

8082
user_names = distinct(concat([for u in aws_memorydb_user.this : u.id], var.acl_user_names))
83+
region = var.region
8184

8285
lifecycle {
8386
create_before_destroy = true
@@ -97,6 +100,7 @@ resource "aws_memorydb_parameter_group" "this" {
97100
name_prefix = var.parameter_group_use_name_prefix ? "${local.create_parameter_group_name}-" : null
98101
description = var.parameter_group_description
99102
family = var.parameter_group_family
103+
region = var.region
100104

101105
dynamic "parameter" {
102106
for_each = var.parameter_group_parameters
@@ -124,6 +128,7 @@ resource "aws_memorydb_subnet_group" "this" {
124128
name_prefix = var.subnet_group_use_name_prefix ? "${local.create_subnet_group_name}-" : null
125129
description = var.subnet_group_description
126130
subnet_ids = var.subnet_ids
131+
region = var.region
127132

128133
lifecycle {
129134
create_before_destroy = true

variables.tf

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ variable "create" {
44
default = true
55
}
66

7+
variable "region" {
8+
description = "Region where this resource will be managed. Defaults to the Region set in the provider configuration"
9+
type = string
10+
default = null
11+
}
12+
713
variable "tags" {
814
description = "A map of tags to use on all resources"
915
type = map(string)
@@ -158,8 +164,15 @@ variable "create_users" {
158164

159165
variable "users" {
160166
description = "A map of user definitions (maps) to be created"
161-
type = any
162-
default = {}
167+
type = map(object({
168+
user_name = string
169+
access_string = string
170+
type = optional(string, "password")
171+
passwords = optional(list(string))
172+
tags = optional(map(string), {})
173+
}))
174+
default = {}
175+
nullable = false
163176
}
164177

165178
################################################################################

versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
terraform {
2-
required_version = ">= 1.0"
2+
required_version = ">= 1.5.7"
33

44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.82"
7+
version = ">= 6.0"
88
}
99
}
1010
}

0 commit comments

Comments
 (0)