Skip to content

Commit 6bf7482

Browse files
authored
Merge pull request #4 from clouddrove/CD-147
fix labels managedby variables
2 parents 9f2f0e7 + 50ee184 commit 6bf7482

File tree

4 files changed

+91
-81
lines changed

4 files changed

+91
-81
lines changed

README.md

Lines changed: 81 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<hr>
3939

4040

41-
We eat, drink, sleep and most importantly love **DevOps**. We are working towards stratergies for standardizing architecture while ensuring security for the infrastructure. We are strong believer of the philosophy <b>Bigger problems are always solved by breaking them into smaller manageable problems</b>. Resonating with microservices architecture, it is considered best-practice to run database, cluster, storage in smaller <b>connected yet manageable pieces</b> within the infrastructure.
41+
We eat, drink, sleep and most importantly love **DevOps**. We are working towards strategies for standardizing architecture while ensuring security for the infrastructure. We are strong believer of the philosophy <b>Bigger problems are always solved by breaking them into smaller manageable problems</b>. Resonating with microservices architecture, it is considered best-practice to run database, cluster, storage in smaller <b>connected yet manageable pieces</b> within the infrastructure.
4242

4343
This module is basically combination of [Terraform open source](https://www.terraform.io/) and includes automatation tests and examples. It also helps to create and improve your infrastructure with minimalistic code instead of maintaining the whole infrastructure code yourself.
4444

@@ -71,29 +71,30 @@ This module has a few dependencies:
7171
Here are some examples of how you can use this module in your inventory structure:
7272
### Redis
7373
```hcl
74-
module "redis" {
75-
source = "git::https://github.com/clouddrove/terraform-aws-elasticache?ref=tags/0.12.2"
76-
name = "redis"
77-
application = "clouddrove"
78-
environment = "test"
79-
label_order = ["environment", "application", "name"]
80-
engine = "redis"
81-
engine_version = "5.0.0"
82-
family = "redis5.0"
83-
port = 6379
84-
node_type = "cache.t2.micro"
85-
subnet_ids = ["subnet-xxxxxxx","subnet-xxxxxxx","subnet-xxxxxxx"]
86-
security_group_ids = ["sg-xxxxxxxxx"]
87-
availability_zones = ["eu-west-1a","eu-west-1b" ]
88-
auto_minor_version_upgrade = true
89-
number_cache_clusters = 2
90-
}
74+
module "redis" {
75+
source = "git::https://github.com/clouddrove/terraform-aws-elasticache?ref=tags/0.12.4"
76+
name = "redis"
77+
application = "clouddrove"
78+
environment = "test"
79+
label_order = ["environment", "application", "name"]
80+
engine = "redis"
81+
engine_version = "5.0.0"
82+
family = "redis5.0"
83+
port = 6379
84+
node_type = "cache.t2.micro"
85+
subnet_ids = ["subnet-xxxxxxx","subnet-xxxxxxx","subnet-xxxxxxx"]
86+
security_group_ids = ["sg-xxxxxxxxx"]
87+
availability_zones = ["eu-west-1a","eu-west-1b" ]
88+
auto_minor_version_upgrade = true
89+
number_cache_clusters = 2
90+
}
91+
9192
```
9293
### Redis Cluster
9394
```hcl
94-
module "redis-cluster" {
95-
source = "git::https://github.com/clouddrove/terraform-aws-elasticache?ref=tags/0.12.2"
96-
name = "cluster"
95+
module "redis-cluster" {
96+
source = "git::https://github.com/clouddrove/terraform-aws-elasticache?ref=tags/0.12.4"
97+
name = "cluster"
9798
application = "clouddrove"
9899
environment = "test"
99100
label_order = ["environment", "application", "name"]
@@ -105,33 +106,33 @@ module "redis-cluster" {
105106
node_type = "cache.t2.micro"
106107
subnet_ids = module.subnets.public_subnet_id
107108
security_group_ids = [module.redis-sg.security_group_ids]
108-
availability_zones = ["eu-west-1a", "eu-west-1b"]
109+
availability_zones = ["eu-west-1a","eu-west-1b" ]
109110
auto_minor_version_upgrade = true
110111
replicas_per_node_group = 2
111112
num_node_groups = 1
112113
automatic_failover_enabled = true
113-
}
114+
}
114115
```
115116
### Memcache
116117
```hcl
117-
module "memcached" {
118-
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.2"
119-
name = "memcached"
120-
application = "clouddrove"
121-
environment = "test"
122-
label_order = ["environment", "application", "name"]
123-
cluster_enabled = true
124-
engine = "memcached"
125-
engine_version = "1.5.10"
126-
family = "memcached1.5"
127-
az_mode = "cross-az"
128-
port = 11211
129-
node_type = "cache.t2.micro"
130-
num_cache_nodes = 2
131-
subnet_ids = ["subnet-xxxxxxx","subnet-xxxxxxx","subnet-xxxxxxx"]
132-
security_group_ids = ["sg-xxxxxxxxx"]
133-
availability_zones = ["eu-west-1a","eu-west-1b" ]
134-
}
118+
module "memcached" {
119+
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.4"
120+
name = "memcached"
121+
application = "clouddrove"
122+
environment = "test"
123+
label_order = ["environment", "application", "name"]
124+
cluster_enabled = true
125+
engine = "memcached"
126+
engine_version = "1.5.10"
127+
family = "memcached1.5"
128+
az_mode = "cross-az"
129+
port = 11211
130+
node_type = "cache.t2.micro"
131+
num_cache_nodes = 2
132+
subnet_ids = ["subnet-xxxxxxx","subnet-xxxxxxx","subnet-xxxxxxx"]
133+
security_group_ids = ["sg-xxxxxxxxx"]
134+
availability_zones = ["eu-west-1a","eu-west-1b" ]
135+
}
135136
```
136137

137138

@@ -143,42 +144,44 @@ module "memcached" {
143144

144145
| Name | Description | Type | Default | Required |
145146
|------|-------------|:----:|:-----:|:-----:|
146-
| application | Application (e.g. `cd` or `clouddrove`). | string | `` | no |
147-
| apply_immediately | Specifies whether any modifications are applied immediately, or during the next maintenance window. Default is false. | string | `false` | no |
148-
| at_rest_encryption_enabled | Enable encryption at rest. | string | `false` | no |
149-
| attributes | Additional attributes (e.g. `1`). | list | `<list>` | no |
150-
| auth_token | The password used to access a password protected server. Can be specified only if transit_encryption_enabled = true. | string | `` | no |
151-
| 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 |
152-
| 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 |
153-
| 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 |
154-
| 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 |
155-
| cluster_enabled | (Memcache only) Enabled or disabled cluster. | bool | `false` | no |
156-
| cluster_replication_enabled | (Redis only) Enabled or disabled replication_group for redis cluster. | bool | `false` | no |
157-
| engine | The name of the cache engine to be used for the clusters in this replication group. e.g. redis. | string | `` | no |
158-
| engine_version | The version number of the cache engine to be used for the cache clusters in this replication group. | string | `` | no |
159-
| environment | Environment (e.g. `prod`, `dev`, `staging`). | string | `` | no |
160-
| family | (Required) The family of the ElastiCache parameter group. | string | `` | no |
161-
| label_order | Label order, e.g. `name`,`application`. | list | `<list>` | no |
162-
| maintenance_window | Maintenance window. | string | `sun:05:00-sun:06:00` | no |
163-
| name | Name (e.g. `app` or `cluster`). | string | `` | no |
164-
| node_type | The compute and memory capacity of the nodes in the node group. | string | `` | no |
165-
| notification_topic_arn | An Amazon Resource Name (ARN) of an SNS topic to send ElastiCache notifications to. | string | `` | no |
166-
| 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 |
167-
| num_node_groups | Number of Shards (nodes). | string | `` | no |
168-
| 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 |
169-
| port | the port number on which each of the cache nodes will accept connections. | string | `` | no |
170-
| replicas_per_node_group | Replicas per Shard. | string | `` | no |
171-
| replication_enabled | (Redis only) Enabled or disabled replication_group for redis standalone instance. | bool | `false` | no |
172-
| replication_group_id | The replication group identifier This parameter is stored as a lowercase string. | string | `` | no |
173-
| security_group_ids | One or more VPC security groups associated with the cache cluster. | list | `<list>` | no |
174-
| security_group_names | A list of cache security group names to associate with this replication group. | string | `` | no |
175-
| 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 |
176-
| 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 |
177-
| 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 |
178-
| 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 |
179-
| subnet_ids | List of VPC Subnet IDs for the cache subnet group. | list | `<list>` | no |
180-
| tags | Additional tags (e.g. map(`BusinessUnit`,`XYZ`). | map | `<map>` | no |
181-
| 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) | 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 |
182185

183186
## Outputs
184187

@@ -219,4 +222,4 @@ At [CloudDrove][website], we offer expert guidance, implementation support and s
219222
[linkedin]: https://cpco.io/linkedin
220223
[twitter]: https://twitter.com/clouddrove/
221224
[email]: https://clouddrove.com/contact-us.html
222-
[terraform_modules]: https://github.com/clouddrove?utf8=%E2%9C%93&q=terraform-&type=&language=
225+
[terraform_modules]: https://github.com/clouddrove?utf8=%E2%9C%93&q=terraform-&type=&language=

README.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ usage : |-
3636
### Redis
3737
```hcl
3838
module "redis" {
39-
source = "git::https://github.com/clouddrove/terraform-aws-elasticache?ref=tags/0.12.2"
39+
source = "git::https://github.com/clouddrove/terraform-aws-elasticache?ref=tags/0.12.4"
4040
name = "redis"
4141
application = "clouddrove"
4242
environment = "test"
@@ -57,7 +57,7 @@ usage : |-
5757
### Redis Cluster
5858
```hcl
5959
module "redis-cluster" {
60-
source = "git::https://github.com/clouddrove/terraform-aws-elasticache?ref=tags/0.12.2"
60+
source = "git::https://github.com/clouddrove/terraform-aws-elasticache?ref=tags/0.12.4"
6161
name = "cluster"
6262
application = "clouddrove"
6363
environment = "test"
@@ -80,7 +80,7 @@ usage : |-
8080
### Memcache
8181
```hcl
8282
module "memcached" {
83-
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.2"
83+
source = "https://github.com/clouddrove/terraform-aws-s3?ref=tags/0.12.4"
8484
name = "memcached"
8585
application = "clouddrove"
8686
environment = "test"

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ module "labels" {
1313
name = var.name
1414
application = var.application
1515
environment = var.environment
16+
managedby = var.managedby
1617
label_order = var.label_order
1718
}
1819

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ variable "tags" {
3636
description = "Additional tags (e.g. map(`BusinessUnit`,`XYZ`)."
3737
}
3838

39+
variable "managedby" {
40+
type = string
41+
default = "anmol@clouddrove.com"
42+
description = "ManagedBy, eg 'CloudDrove' or 'AnmolNagpal'."
43+
}
44+
3945
variable "enable" {
4046
type = bool
4147
default = true

0 commit comments

Comments
 (0)