Skip to content

Commit ded7e75

Browse files
authored
Terraform 0.15 support by marking outputs as sensitive (#15)
* Terraform 0.15 support by marking outputs as sensitive * Update docs
1 parent bf350c3 commit ded7e75

File tree

5 files changed

+83
-62
lines changed

5 files changed

+83
-62
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ repos:
1818
args: ['--allow-missing-credentials']
1919
- id: trailing-whitespace
2020
- repo: git://github.com/antonbabenko/pre-commit-terraform
21-
rev: v1.45.0
21+
rev: v1.48.0
2222
hooks:
2323
- id: terraform_fmt
2424
- id: terraform_docs

CHANGELOG.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
All notable changes to this project will be documented in this file.
44

5-
<a name="unreleased"></a>
6-
## [Unreleased]
5+
<a name="2.0.0"></a>
6+
## [2.0.0] - 2021-04-19
77

8-
- Update README.md
8+
- Add support for Terraform 0.15 by setting sensitive outputs to have the sensitive = true flag. (https://www.terraform.io/upgrade-guides/0-15.html#sensitive-output-values)
9+
- Terraform version requirement bumped to 0.14.5 in order to support sensitive values
910

1011

1112
<a name="1.4.0"></a>
@@ -72,7 +73,7 @@ All notable changes to this project will be documented in this file.
7273
- Initial commit of docs
7374

7475

75-
[Unreleased]: https://github.com/umotif-public/terraform-aws-elasticache-redis/compare/1.4.0...HEAD
76+
[2.0.0]: https://github.com/umotif-public/terraform-aws-elasticache-redis/compare/1.4.0...2.0.0
7677
[1.4.0]: https://github.com/umotif-public/terraform-aws-elasticache-redis/compare/1.3.1...1.4.0
7778
[1.3.1]: https://github.com/umotif-public/terraform-aws-elasticache-redis/compare/1.3.0...1.3.1
7879
[1.3.0]: https://github.com/umotif-public/terraform-aws-elasticache-redis/compare/1.2.0...1.3.0

README.md

Lines changed: 74 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ A Terraform module to create an AWS Redis ElastiCache cluster
66

77
## Terraform versions
88

9-
Terraform 0.12. Pin module version to `~> v1.0`. Submit pull-requests to `master` branch.
9+
Terraform 0.14.5. Pin module version to `~> v2.0`.
10+
Terraform 0.12 - 0.14.4. Pin module version to `~> v1.0`.
11+
Submit pull-requests to `master` branch.
1012

1113
## Usage
1214

@@ -55,7 +57,8 @@ module "redis" {
5557

5658
## Assumptions
5759

58-
Module is to be used with Terraform > 0.12.
60+
Module v1.0 is to be used with Terraform > 0.12
61+
Module v2.0+ is to be used with Terraform > 0.14.5
5962

6063
## Examples
6164

@@ -71,74 +74,90 @@ Module managed by [Marcin Cuber](https://github.com/marcincuber) [linkedin](http
7174

7275
| Name | Version |
7376
|------|---------|
74-
| terraform | >= 0.12.6 |
75-
| aws | >= 3.26 |
76-
| random | >= 3.0 |
77+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.14.5 |
78+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.26 |
79+
| <a name="requirement_random"></a> [random](#requirement\_random) | >= 3.1.0 |
7780

7881
## Providers
7982

8083
| Name | Version |
8184
|------|---------|
82-
| aws | >= 3.26 |
83-
| random | >= 3.0 |
85+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.26 |
86+
| <a name="provider_random"></a> [random](#provider\_random) | >= 3.1.0 |
87+
88+
## Modules
89+
90+
No modules.
91+
92+
## Resources
93+
94+
| Name | Type |
95+
|------|------|
96+
| [aws_elasticache_parameter_group.redis](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elasticache_parameter_group) | resource |
97+
| [aws_elasticache_replication_group.redis](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elasticache_replication_group) | resource |
98+
| [aws_elasticache_subnet_group.redis](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/elasticache_subnet_group) | resource |
99+
| [aws_security_group.redis](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group) | resource |
100+
| [aws_security_group_rule.redis_egress](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource |
101+
| [aws_security_group_rule.redis_ingress_cidr_blocks](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource |
102+
| [aws_security_group_rule.redis_ingress_self](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | resource |
103+
| [random_id.redis_pg](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/id) | resource |
84104

85105
## Inputs
86106

87107
| Name | Description | Type | Default | Required |
88108
|------|-------------|------|---------|:--------:|
89-
| apply\_immediately | Specifies whether any modifications are applied immediately, or during the next maintenance window. | `bool` | `false` | no |
90-
| at\_rest\_encryption\_enabled | Whether to enable encryption at rest. | `bool` | `true` | no |
91-
| auth\_token | The password used to access a password protected server. Can be specified only if `transit_encryption_enabled = true`. | `string` | `""` | no |
92-
| auto\_minor\_version\_upgrade | n/a | `string` | `true` | no |
93-
| automatic\_failover\_enabled | Specifies whether a read-only replica will be automatically promoted to read/write primary if the existing primary fails. | `bool` | `true` | no |
94-
| availability\_zones | A list of EC2 availability zones in which the replication group's cache clusters will be created. The order of the availability zones in the list is not important. | `list(string)` | `null` | no |
95-
| cluster\_mode\_enabled | Enable creation of a native redis cluster. | `bool` | `false` | no |
96-
| description | The description of the all resources. | `string` | `"Managed by Terraform"` | no |
97-
| engine\_version | The version number of the cache engine to be used for the cache clusters in this replication group. | `string` | `"5.0.6"` | no |
98-
| family | The family of the ElastiCache parameter group. | `string` | `"redis5.0"` | no |
99-
| final\_snapshot\_identifier | The name of your final node group (shard) snapshot. ElastiCache creates the snapshot from the primary node in the cluster. If omitted, no final snapshot will be made. | `string` | `null` | no |
100-
| ingress\_cidr\_blocks | List of Ingress CIDR blocks. | `list(string)` | `[]` | no |
101-
| ingress\_self | Specify whether the security group itself will be added as a source to the ingress rule. | `bool` | `false` | no |
102-
| kms\_key\_id | The ARN of the key that you wish to use if encrypting at rest. If not supplied, uses service managed encryption. Can be specified only if `at_rest_encryption_enabled = true` | `string` | `""` | no |
103-
| maintenance\_window | Specifies the weekly time range for when maintenance on the cache cluster is performed. | `string` | `""` | no |
104-
| multi\_az\_enabled | Specifies whether to enable Multi-AZ Support for the replication group. If true, `automatic_failover_enabled` must also be enabled. Defaults to false. | `string` | `null` | no |
105-
| name\_prefix | The replication group identifier. This parameter is stored as a lowercase string. | `string` | n/a | yes |
106-
| node\_type | The compute and memory capacity of the nodes in the node group. | `string` | n/a | yes |
107-
| notification\_topic\_arn | An Amazon Resource Name (ARN) of an SNS topic to send ElastiCache notifications to. Example: `arn:aws:sns:us-east-1:012345678999:my_sns_topic` | `string` | `""` | no |
108-
| num\_node\_groups | Required when `cluster_mode_enabled` is set to true. Specify the number of node groups (shards) for this Redis replication group. Changing this number will trigger an online resizing operation before other settings modifications. | `number` | `0` | no |
109-
| number\_cache\_clusters | The number of cache clusters (primary and replicas) this replication group will have. | `number` | n/a | yes |
110-
| parameter | A list of Redis parameters to apply. Note that parameters may differ from one Redis family to another | <pre>list(object({<br> name = string<br> value = string<br> }))</pre> | `[]` | no |
111-
| port | The port number on which each of the cache nodes will accept connections. | `number` | `6379` | no |
112-
| replicas\_per\_node\_group | Required when `cluster_mode_enabled` is set to true. Specify the number of replica nodes in each node group. Valid values are 0 to 5. Changing this number will force a new resource. | `number` | `0` | no |
113-
| security\_group\_ids | List of Security Groups. | `list(string)` | `[]` | no |
114-
| snapshot\_retention\_limit | The number of days for which ElastiCache will retain automatic cache cluster snapshots before deleting them. | `number` | `30` | no |
115-
| snapshot\_window | The daily time range (in UTC) during which ElastiCache will begin taking a daily snapshot of your cache cluster. | `string` | `""` | no |
116-
| subnet\_ids | List of VPC Subnet IDs for the cache subnet group. | `list(string)` | n/a | yes |
117-
| tags | A mapping of tags to assign to all resources. | `map(string)` | `{}` | no |
118-
| transit\_encryption\_enabled | Whether to enable encryption in transit. | `bool` | `true` | no |
119-
| vpc\_id | VPC Id to associate with Redis ElastiCache. | `string` | n/a | yes |
109+
| <a name="input_apply_immediately"></a> [apply\_immediately](#input\_apply\_immediately) | Specifies whether any modifications are applied immediately, or during the next maintenance window. | `bool` | `false` | no |
110+
| <a name="input_at_rest_encryption_enabled"></a> [at\_rest\_encryption\_enabled](#input\_at\_rest\_encryption\_enabled) | Whether to enable encryption at rest. | `bool` | `true` | no |
111+
| <a name="input_auth_token"></a> [auth\_token](#input\_auth\_token) | The password used to access a password protected server. Can be specified only if `transit_encryption_enabled = true`. | `string` | `""` | no |
112+
| <a name="input_auto_minor_version_upgrade"></a> [auto\_minor\_version\_upgrade](#input\_auto\_minor\_version\_upgrade) | n/a | `string` | `true` | no |
113+
| <a name="input_automatic_failover_enabled"></a> [automatic\_failover\_enabled](#input\_automatic\_failover\_enabled) | Specifies whether a read-only replica will be automatically promoted to read/write primary if the existing primary fails. | `bool` | `true` | no |
114+
| <a name="input_availability_zones"></a> [availability\_zones](#input\_availability\_zones) | A list of EC2 availability zones in which the replication group's cache clusters will be created. The order of the availability zones in the list is not important. | `list(string)` | `null` | no |
115+
| <a name="input_cluster_mode_enabled"></a> [cluster\_mode\_enabled](#input\_cluster\_mode\_enabled) | Enable creation of a native redis cluster. | `bool` | `false` | no |
116+
| <a name="input_description"></a> [description](#input\_description) | The description of the all resources. | `string` | `"Managed by Terraform"` | no |
117+
| <a name="input_engine_version"></a> [engine\_version](#input\_engine\_version) | The version number of the cache engine to be used for the cache clusters in this replication group. | `string` | `"5.0.6"` | no |
118+
| <a name="input_family"></a> [family](#input\_family) | The family of the ElastiCache parameter group. | `string` | `"redis5.0"` | no |
119+
| <a name="input_final_snapshot_identifier"></a> [final\_snapshot\_identifier](#input\_final\_snapshot\_identifier) | The name of your final node group (shard) snapshot. ElastiCache creates the snapshot from the primary node in the cluster. If omitted, no final snapshot will be made. | `string` | `null` | no |
120+
| <a name="input_ingress_cidr_blocks"></a> [ingress\_cidr\_blocks](#input\_ingress\_cidr\_blocks) | List of Ingress CIDR blocks. | `list(string)` | `[]` | no |
121+
| <a name="input_ingress_self"></a> [ingress\_self](#input\_ingress\_self) | Specify whether the security group itself will be added as a source to the ingress rule. | `bool` | `false` | no |
122+
| <a name="input_kms_key_id"></a> [kms\_key\_id](#input\_kms\_key\_id) | The ARN of the key that you wish to use if encrypting at rest. If not supplied, uses service managed encryption. Can be specified only if `at_rest_encryption_enabled = true` | `string` | `""` | no |
123+
| <a name="input_maintenance_window"></a> [maintenance\_window](#input\_maintenance\_window) | Specifies the weekly time range for when maintenance on the cache cluster is performed. | `string` | `""` | no |
124+
| <a name="input_multi_az_enabled"></a> [multi\_az\_enabled](#input\_multi\_az\_enabled) | Specifies whether to enable Multi-AZ Support for the replication group. If true, `automatic_failover_enabled` must also be enabled. Defaults to false. | `string` | `null` | no |
125+
| <a name="input_name_prefix"></a> [name\_prefix](#input\_name\_prefix) | The replication group identifier. This parameter is stored as a lowercase string. | `string` | n/a | yes |
126+
| <a name="input_node_type"></a> [node\_type](#input\_node\_type) | The compute and memory capacity of the nodes in the node group. | `string` | n/a | yes |
127+
| <a name="input_notification_topic_arn"></a> [notification\_topic\_arn](#input\_notification\_topic\_arn) | An Amazon Resource Name (ARN) of an SNS topic to send ElastiCache notifications to. Example: `arn:aws:sns:us-east-1:012345678999:my_sns_topic` | `string` | `""` | no |
128+
| <a name="input_num_node_groups"></a> [num\_node\_groups](#input\_num\_node\_groups) | Required when `cluster_mode_enabled` is set to true. Specify the number of node groups (shards) for this Redis replication group. Changing this number will trigger an online resizing operation before other settings modifications. | `number` | `0` | no |
129+
| <a name="input_number_cache_clusters"></a> [number\_cache\_clusters](#input\_number\_cache\_clusters) | The number of cache clusters (primary and replicas) this replication group will have. | `number` | n/a | yes |
130+
| <a name="input_parameter"></a> [parameter](#input\_parameter) | A list of Redis parameters to apply. Note that parameters may differ from one Redis family to another | <pre>list(object({<br> name = string<br> value = string<br> }))</pre> | `[]` | no |
131+
| <a name="input_port"></a> [port](#input\_port) | The port number on which each of the cache nodes will accept connections. | `number` | `6379` | no |
132+
| <a name="input_replicas_per_node_group"></a> [replicas\_per\_node\_group](#input\_replicas\_per\_node\_group) | Required when `cluster_mode_enabled` is set to true. Specify the number of replica nodes in each node group. Valid values are 0 to 5. Changing this number will force a new resource. | `number` | `0` | no |
133+
| <a name="input_security_group_ids"></a> [security\_group\_ids](#input\_security\_group\_ids) | List of Security Groups. | `list(string)` | `[]` | no |
134+
| <a name="input_snapshot_retention_limit"></a> [snapshot\_retention\_limit](#input\_snapshot\_retention\_limit) | The number of days for which ElastiCache will retain automatic cache cluster snapshots before deleting them. | `number` | `30` | no |
135+
| <a name="input_snapshot_window"></a> [snapshot\_window](#input\_snapshot\_window) | The daily time range (in UTC) during which ElastiCache will begin taking a daily snapshot of your cache cluster. | `string` | `""` | no |
136+
| <a name="input_subnet_ids"></a> [subnet\_ids](#input\_subnet\_ids) | List of VPC Subnet IDs for the cache subnet group. | `list(string)` | n/a | yes |
137+
| <a name="input_tags"></a> [tags](#input\_tags) | A mapping of tags to assign to all resources. | `map(string)` | `{}` | no |
138+
| <a name="input_transit_encryption_enabled"></a> [transit\_encryption\_enabled](#input\_transit\_encryption\_enabled) | Whether to enable encryption in transit. | `bool` | `true` | no |
139+
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | VPC Id to associate with Redis ElastiCache. | `string` | n/a | yes |
120140

121141
## Outputs
122142

123143
| Name | Description |
124144
|------|-------------|
125-
| elasticache\_auth\_token | The Redis Auth Token. |
126-
| elasticache\_parameter\_group\_id | The ElastiCache parameter group name. |
127-
| elasticache\_port | The Redis port. |
128-
| elasticache\_replication\_group\_arn | The Amazon Resource Name (ARN) of the created ElastiCache Replication Group. |
129-
| elasticache\_replication\_group\_id | The ID of the ElastiCache Replication Group. |
130-
| elasticache\_replication\_group\_member\_clusters | The identifiers of all the nodes that are part of this replication group. |
131-
| elasticache\_replication\_group\_primary\_endpoint\_address | The address of the endpoint for the primary node in the replication group. |
132-
| elasticache\_replication\_group\_reader\_endpoint\_address | The address of the endpoint for the reader node in the replication group. |
133-
| security\_group\_arn | The ARN of the Redis ElastiCache security group. |
134-
| security\_group\_description | The description of the Redis ElastiCache security group. |
135-
| security\_group\_egress | The egress rules of the Redis ElastiCache security group. |
136-
| security\_group\_id | The ID of the Redis ElastiCache security group. |
137-
| security\_group\_ingress | The ingress rules of the Redis ElastiCache security group. |
138-
| security\_group\_name | The name of the Redis ElastiCache security group. |
139-
| security\_group\_owner\_id | The owner ID of the Redis ElastiCache security group. |
140-
| security\_group\_vpc\_id | The VPC ID of the Redis ElastiCache security group. |
141-
145+
| <a name="output_elasticache_auth_token"></a> [elasticache\_auth\_token](#output\_elasticache\_auth\_token) | The Redis Auth Token. |
146+
| <a name="output_elasticache_parameter_group_id"></a> [elasticache\_parameter\_group\_id](#output\_elasticache\_parameter\_group\_id) | The ElastiCache parameter group name. |
147+
| <a name="output_elasticache_port"></a> [elasticache\_port](#output\_elasticache\_port) | The Redis port. |
148+
| <a name="output_elasticache_replication_group_arn"></a> [elasticache\_replication\_group\_arn](#output\_elasticache\_replication\_group\_arn) | The Amazon Resource Name (ARN) of the created ElastiCache Replication Group. |
149+
| <a name="output_elasticache_replication_group_id"></a> [elasticache\_replication\_group\_id](#output\_elasticache\_replication\_group\_id) | The ID of the ElastiCache Replication Group. |
150+
| <a name="output_elasticache_replication_group_member_clusters"></a> [elasticache\_replication\_group\_member\_clusters](#output\_elasticache\_replication\_group\_member\_clusters) | The identifiers of all the nodes that are part of this replication group. |
151+
| <a name="output_elasticache_replication_group_primary_endpoint_address"></a> [elasticache\_replication\_group\_primary\_endpoint\_address](#output\_elasticache\_replication\_group\_primary\_endpoint\_address) | The address of the endpoint for the primary node in the replication group. |
152+
| <a name="output_elasticache_replication_group_reader_endpoint_address"></a> [elasticache\_replication\_group\_reader\_endpoint\_address](#output\_elasticache\_replication\_group\_reader\_endpoint\_address) | The address of the endpoint for the reader node in the replication group. |
153+
| <a name="output_security_group_arn"></a> [security\_group\_arn](#output\_security\_group\_arn) | The ARN of the Redis ElastiCache security group. |
154+
| <a name="output_security_group_description"></a> [security\_group\_description](#output\_security\_group\_description) | The description of the Redis ElastiCache security group. |
155+
| <a name="output_security_group_egress"></a> [security\_group\_egress](#output\_security\_group\_egress) | The egress rules of the Redis ElastiCache security group. |
156+
| <a name="output_security_group_id"></a> [security\_group\_id](#output\_security\_group\_id) | The ID of the Redis ElastiCache security group. |
157+
| <a name="output_security_group_ingress"></a> [security\_group\_ingress](#output\_security\_group\_ingress) | The ingress rules of the Redis ElastiCache security group. |
158+
| <a name="output_security_group_name"></a> [security\_group\_name](#output\_security\_group\_name) | The name of the Redis ElastiCache security group. |
159+
| <a name="output_security_group_owner_id"></a> [security\_group\_owner\_id](#output\_security\_group\_owner\_id) | The owner ID of the Redis ElastiCache security group. |
160+
| <a name="output_security_group_vpc_id"></a> [security\_group\_vpc\_id](#output\_security\_group\_vpc\_id) | The VPC ID of the Redis ElastiCache security group. |
142161
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
143162

144163
## License

outputs.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ output "security_group_egress" {
7171
output "elasticache_auth_token" {
7272
description = "The Redis Auth Token."
7373
value = aws_elasticache_replication_group.redis.auth_token
74+
sensitive = true
7475
}
7576

7677
output "elasticache_port" {

versions.tf

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

44
required_providers {
55
aws = ">= 3.26"
6-
random = ">= 3.0"
6+
random = ">= 3.1.0"
77
}
88
}

0 commit comments

Comments
 (0)