Skip to content

Commit 8c8aa80

Browse files
committed
support iam auth
1 parent 93facd1 commit 8c8aa80

File tree

7 files changed

+16
-18
lines changed

7 files changed

+16
-18
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ Examples codified under the [`examples`](https://github.com/terraform-aws-module
118118
| Name | Version |
119119
|------|---------|
120120
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
121-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.0 |
121+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.47 |
122122

123123
## Providers
124124

125125
| Name | Version |
126126
|------|---------|
127-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.0 |
127+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.47 |
128128

129129
## Modules
130130

@@ -185,7 +185,7 @@ No modules.
185185
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to use on all resources | `map(string)` | `{}` | no |
186186
| <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 |
187187
| <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 |
188-
| <a name="input_users"></a> [users](#input\_users) | A map of user definitions (maps) to be created | `map(any)` | `{}` | no |
188+
| <a name="input_users"></a> [users](#input\_users) | A map of user definitions (maps) to be created | `any` | `{}` | no |
189189

190190
## Outputs
191191

examples/complete/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ Note that this example may create resources which will incur monetary charges on
2626
| Name | Version |
2727
|------|---------|
2828
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
29-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.0 |
29+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.47 |
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.0 |
36+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.47 |
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 | ~> 4.0 |
46+
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 5.0 |
4747

4848
## Resources
4949

examples/complete/main.tf

+5-7
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module "memory_db" {
3030
name = local.name
3131
description = "Example MemoryDB cluster"
3232

33-
engine_version = "6.2"
33+
engine_version = "7.0"
3434
auto_minor_version_upgrade = true
3535
node_type = "db.r6gd.xlarge"
3636
num_shards = 2
@@ -49,13 +49,13 @@ module "memory_db" {
4949
admin = {
5050
user_name = "admin-user"
5151
access_string = "on ~* &* +@all"
52-
passwords = [random_password.password["admin"].result]
52+
type = "iam"
5353
tags = { user = "admin" }
5454
}
5555
readonly = {
5656
user_name = "readonly-user"
5757
access_string = "on ~* &* -@all +@read"
58-
passwords = [random_password.password["readonly"].result]
58+
passwords = [random_password.password.result]
5959
tags = { user = "readonly" }
6060
}
6161
}
@@ -67,7 +67,7 @@ module "memory_db" {
6767
# Parameter group
6868
parameter_group_name = "${local.name}-param-group"
6969
parameter_group_description = "Example MemoryDB parameter group"
70-
parameter_group_family = "memorydb_redis6"
70+
parameter_group_family = "memorydb_redis7"
7171
parameter_group_parameters = [
7272
{
7373
name = "activedefrag"
@@ -95,7 +95,7 @@ module "memory_db" {
9595

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

100100
name = local.name
101101
cidr = "10.99.0.0/18"
@@ -139,8 +139,6 @@ resource "aws_sns_topic" "example" {
139139
}
140140

141141
resource "random_password" "password" {
142-
for_each = toset(["admin", "readonly"])
143-
144142
length = 16
145143
special = true
146144
override_special = "_%@"

examples/complete/versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.0"
7+
version = ">= 5.47"
88
}
99
random = {
1010
source = "hashicorp/random"

main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ resource "aws_memorydb_user" "this" {
5858
access_string = each.value.access_string
5959

6060
authentication_mode {
61-
type = "password"
62-
passwords = each.value.passwords
61+
type = try(each.value.type, "password")
62+
passwords = try(each.value.passwords, null)
6363
}
6464

6565
tags = merge(var.tags, lookup(each.value, "tags", {}))

variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ variable "create_users" {
146146

147147
variable "users" {
148148
description = "A map of user definitions (maps) to be created"
149-
type = map(any)
149+
type = any
150150
default = {}
151151
}
152152

versions.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.0"
7+
version = ">= 5.47"
88
}
99
}
1010
}

0 commit comments

Comments
 (0)