Skip to content

Commit 5be63ca

Browse files
author
Sohan
committed
create variable for description
2 parents e7f7668 + 65f02a6 commit 5be63ca

File tree

2 files changed

+51
-38
lines changed

2 files changed

+51
-38
lines changed

README.md

Lines changed: 41 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -144,51 +144,54 @@ Here are some examples of how you can use this module in your inventory structur
144144

145145
| Name | Description | Type | Default | Required |
146146
|------|-------------|:----:|:-----:|:-----:|
147-
| application | Application \(e.g. `cd` or `clouddrove`\). | string | `""` | no |
148-
| apply\_immediately | Specifies whether any modifications are applied immediately, or during the next maintenance window. Default is false. | string | `"false"` | no |
149-
| at\_rest\_encryption\_enabled | Enable encryption at rest. | string | `"false"` | no |
150-
| attributes | Additional attributes \(e.g. `1`\). | list | `<list>` | no |
151-
| auth\_token | The password used to access a password protected server. Can be specified only if transit\_encryption\_enabled = true. | string | `""` | no |
152-
| auto\_minor\_version\_upgrade | Specifies whether a minor engine upgrades will be applied automatically to the underlying Cache Cluster instances during the maintenance window. Defaults to true. | string | `"true"` | no |
153-
| automatic\_failover\_enabled | Specifies whether a read-only replica will be automatically promoted to read/write primary if the existing primary fails. If true, Multi-AZ is enabled for this replication group. If false, Multi-AZ is disabled for this replication group. Must be enabled for Redis \(cluster mode enabled\) replication groups. Defaults to false. | string | `"false"` | no |
154-
| 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) | n/a | yes |
155-
| az\_mode | \(Memcached only\) Specifies whether the nodes in this Memcached node group are created in a single Availability Zone or created across multiple Availability Zones in the cluster's region. Valid values for this parameter are single-az or cross-az, default is single-az. If you want to choose cross-az, num\_cache\_nodes must be greater than 1. | string | `"single-az"` | no |
156-
| cluster\_enabled | \(Memcache only\) Enabled or disabled cluster. | bool | `"false"` | no |
157-
| cluster\_replication\_enabled | \(Redis only\) Enabled or disabled replication\_group for redis cluster. | bool | `"false"` | no |
158-
| enable | Enable or disable of elasticache | bool | `"true"` | no |
159-
| engine | The name of the cache engine to be used for the clusters in this replication group. e.g. redis. | string | `""` | no |
160-
| engine\_version | The version number of the cache engine to be used for the cache clusters in this replication group. | string | `""` | no |
161-
| environment | Environment \(e.g. `prod`, `dev`, `staging`\). | string | `""` | no |
162-
| family | \(Required\) The family of the ElastiCache parameter group. | string | `""` | no |
163-
| label\_order | Label order, e.g. `name`,`application`. | list | `<list>` | no |
164-
| maintenance\_window | Maintenance window. | string | `"sun:05:00-sun:06:00"` | no |
165-
| managedby | ManagedBy, eg 'CloudDrove' or 'AnmolNagpal'. | string | `"anmol@clouddrove.com"` | no |
166-
| name | Name \(e.g. `app` or `cluster`\). | string | `""` | no |
167-
| node\_type | The compute and memory capacity of the nodes in the node group. | string | `""` | no |
168-
| notification\_topic\_arn | An Amazon Resource Name \(ARN\) of an SNS topic to send ElastiCache notifications to. | string | `""` | no |
169-
| num\_cache\_nodes | \(Required unless replication\_group\_id is provided\) The initial number of cache nodes that the cache cluster will have. For Redis, this value must be 1. For Memcache, this value must be between 1 and 20. If this number is reduced on subsequent runs, the highest numbered nodes will be removed. | string | `"1"` | no |
170-
| num\_node\_groups | Number of Shards \(nodes\). | string | `""` | no |
171-
| number\_cache\_clusters | \(Required for Cluster Mode Disabled\) The number of cache clusters \(primary and replicas\) this replication group will have. If Multi-AZ is enabled, the value of this parameter must be at least 2. Updates will occur before other modifications. | string | `""` | no |
172-
| port | the port number on which each of the cache nodes will accept connections. | string | `""` | no |
173-
| replicas\_per\_node\_group | Replicas per Shard. | string | `""` | no |
174-
| replication\_enabled | \(Redis only\) Enabled or disabled replication\_group for redis standalone instance. | bool | `"false"` | no |
175-
| replication\_group\_id | The replication group identifier This parameter is stored as a lowercase string. | string | `""` | no |
176-
| security\_group\_ids | One or more VPC security groups associated with the cache cluster. | list | `<list>` | no |
177-
| security\_group\_names | A list of cache security group names to associate with this replication group. | string | `""` | no |
178-
| snapshot\_arns | A single-element string list containing an Amazon Resource Name \(ARN\) of a Redis RDB snapshot file stored in Amazon S3. | string | `""` | no |
179-
| 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 | `""` | no |
180-
| snapshot\_retention\_limit | \(Redis only\) The number of days for which ElastiCache will retain automatic cache cluster snapshots before deleting them. For example, if you set SnapshotRetentionLimit to 5, then a snapshot that was taken today will be retained for 5 days before being deleted. If the value of SnapshotRetentionLimit is set to zero \(0\), backups are turned off. Please note that setting a snapshot\_retention\_limit is not supported on cache.t1.micro or cache.t2.\* cache nodes. | string | `"0"` | no |
181-
| snapshot\_window | \(Redis only\) The daily time range \(in UTC\) during which ElastiCache will begin taking a daily snapshot of your cache cluster. The minimum snapshot window is a 60 minute period. | string | `""` | no |
182-
| subnet\_ids | List of VPC Subnet IDs for the cache subnet group. | list | `<list>` | no |
183-
| tags | Additional tags \(e.g. map\(`BusinessUnit`,`XYZ`\). | map | `<map>` | no |
184-
| transit\_encryption\_enabled | Whether to enable encryption in transit. | string | `"false"` | no |
147+
| application | Application (e.g. `cd` or `clouddrove`). | string | `` | no |
148+
| apply_immediately | Specifies whether any modifications are applied immediately, or during the next maintenance window. Default is false. | string | `false` | no |
149+
| at_rest_encryption_enabled | Enable encryption at rest. | string | `false` | no |
150+
| attributes | Additional attributes (e.g. `1`). | list | `<list>` | no |
151+
| auth_token | The password used to access a password protected server. Can be specified only if transit_encryption_enabled = true. | string | `` | no |
152+
| auto_minor_version_upgrade | Specifies whether a minor engine upgrades will be applied automatically to the underlying Cache Cluster instances during the maintenance window. Defaults to true. | string | `true` | no |
153+
| automatic_failover_enabled | Specifies whether a read-only replica will be automatically promoted to read/write primary if the existing primary fails. If true, Multi-AZ is enabled for this replication group. If false, Multi-AZ is disabled for this replication group. Must be enabled for Redis (cluster mode enabled) replication groups. Defaults to false. | string | `false` | no |
154+
| 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) | - | yes |
155+
| az_mode | (Memcached only) Specifies whether the nodes in this Memcached node group are created in a single Availability Zone or created across multiple Availability Zones in the cluster's region. Valid values for this parameter are single-az or cross-az, default is single-az. If you want to choose cross-az, num_cache_nodes must be greater than 1. | string | `single-az` | no |
156+
| cluster_enabled | (Memcache only) Enabled or disabled cluster. | bool | `false` | no |
157+
| cluster_replication_enabled | (Redis only) Enabled or disabled replication_group for redis cluster. | bool | `false` | no |
158+
| description | Description for the cache subnet group. Defaults to `Managed by Terraform`. | string | `Managed by Terraform` | no |
159+
| enable | Enable or disable of elasticache | bool | `true` | no |
160+
| engine | The name of the cache engine to be used for the clusters in this replication group. e.g. redis. | string | `` | no |
161+
| engine_version | The version number of the cache engine to be used for the cache clusters in this replication group. | string | `` | no |
162+
| environment | Environment (e.g. `prod`, `dev`, `staging`). | string | `` | no |
163+
| family | (Required) The family of the ElastiCache parameter group. | string | `` | no |
164+
| label_order | Label order, e.g. `name`,`application`. | list | `<list>` | no |
165+
| maintenance_window | Maintenance window. | string | `sun:05:00-sun:06:00` | no |
166+
| managedby | ManagedBy, eg 'CloudDrove' or 'AnmolNagpal'. | string | `anmol@clouddrove.com` | no |
167+
| name | Name (e.g. `app` or `cluster`). | string | `` | no |
168+
| node_type | The compute and memory capacity of the nodes in the node group. | string | `` | no |
169+
| notification_topic_arn | An Amazon Resource Name (ARN) of an SNS topic to send ElastiCache notifications to. | string | `` | no |
170+
| num_cache_nodes | (Required unless replication_group_id is provided) The initial number of cache nodes that the cache cluster will have. For Redis, this value must be 1. For Memcache, this value must be between 1 and 20. If this number is reduced on subsequent runs, the highest numbered nodes will be removed. | string | `1` | no |
171+
| num_node_groups | Number of Shards (nodes). | string | `` | no |
172+
| number_cache_clusters | (Required for Cluster Mode Disabled) The number of cache clusters (primary and replicas) this replication group will have. If Multi-AZ is enabled, the value of this parameter must be at least 2. Updates will occur before other modifications. | string | `` | no |
173+
| port | the port number on which each of the cache nodes will accept connections. | string | `` | no |
174+
| replicas_per_node_group | Replicas per Shard. | string | `` | no |
175+
| replication_enabled | (Redis only) Enabled or disabled replication_group for redis standalone instance. | bool | `false` | no |
176+
| replication_group_id | The replication group identifier This parameter is stored as a lowercase string. | string | `` | no |
177+
| security_group_ids | One or more VPC security groups associated with the cache cluster. | list | `<list>` | no |
178+
| security_group_names | A list of cache security group names to associate with this replication group. | string | `` | no |
179+
| snapshot_arns | A single-element string list containing an Amazon Resource Name (ARN) of a Redis RDB snapshot file stored in Amazon S3. | string | `` | no |
180+
| 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 | `` | no |
181+
| snapshot_retention_limit | (Redis only) The number of days for which ElastiCache will retain automatic cache cluster snapshots before deleting them. For example, if you set SnapshotRetentionLimit to 5, then a snapshot that was taken today will be retained for 5 days before being deleted. If the value of SnapshotRetentionLimit is set to zero (0), backups are turned off. Please note that setting a snapshot_retention_limit is not supported on cache.t1.micro or cache.t2.* cache nodes. | string | `0` | no |
182+
| snapshot_window | (Redis only) The daily time range (in UTC) during which ElastiCache will begin taking a daily snapshot of your cache cluster. The minimum snapshot window is a 60 minute period. | string | `` | no |
183+
| subnet_ids | List of VPC Subnet IDs for the cache subnet group. | list | `<list>` | no |
184+
| tags | Additional tags (e.g. map(`BusinessUnit`,`XYZ`). | map | `<map>` | no |
185+
| transit_encryption_enabled | Whether to enable encryption in transit. | string | `false` | no |
185186

186187
## Outputs
187188

188189
| Name | Description |
189190
|------|-------------|
190191
| id | Redis cluster id. |
192+
| memcached_endpoint_address | Memcached endpoint address. |
191193
| port | Redis port. |
194+
| redis_endpoint | Redis endpoint address. |
192195
| tags | A mapping of tags to assign to the resource. |
193196

194197

outputs.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,13 @@ output "tags" {
1414
value = module.labels.tags
1515
description = "A mapping of tags to assign to the resource."
1616
}
17+
18+
output "redis_endpoint" {
19+
value = var.cluster_enabled ? "" : (var.cluster_replication_enabled ? join("", aws_elasticache_replication_group.cluster.*.configuration_endpoint_address) : join("", aws_elasticache_replication_group.default.*.primary_endpoint_address))
20+
description = "Redis endpoint address."
21+
}
22+
23+
output "memcached_endpoint_address" {
24+
value = var.cluster_enabled ? join("", aws_elasticache_cluster.default.*.configuration_endpoint) : ""
25+
description = "Memcached endpoint address."
26+
}

0 commit comments

Comments
 (0)