-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
153fd52
commit 132ae69
Showing
1 changed file
with
132 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,67 +78,107 @@ Here are some examples of how you can use this module in your inventory structur | |
### Redis | ||
```hcl | ||
module "redis" { | ||
source = "clouddrove/elasticache/aws | ||
version = "1.3.0" | ||
name = "redis" | ||
environment = "test" | ||
label_order = ["environment", "name"] | ||
engine = "redis" | ||
engine_version = "5.0.0" | ||
family = "redis5.0" | ||
port = 6379 | ||
node_type = "cache.t2.micro" | ||
subnet_ids = ["subnet-xxxxxxx","subnet-xxxxxxx","subnet-xxxxxxx"] | ||
security_group_ids = ["sg-xxxxxxxxx"] | ||
availability_zones = ["eu-west-1a","eu-west-1b" ] | ||
auto_minor_version_upgrade = true | ||
num_cache_clusters = 2 | ||
} | ||
source = "clouddrove/elasticache/aws | ||
version = "1.3.0" | ||
name = "redis" | ||
environment = "test" | ||
label_order = ["name", "environment"] | ||
vpc_id = module.vpc.vpc_id | ||
allowed_ip = [module.vpc.vpc_cidr_block] | ||
allowed_ports = [6379] | ||
cluster_replication_enabled = true | ||
replication_enabled = true | ||
engine = "redis" | ||
engine_version = "7.0" | ||
parameter_group_name = "default.redis7" | ||
port = 6379 | ||
node_type = "cache.t2.micro" | ||
subnet_ids = module.subnets.public_subnet_id | ||
availability_zones = [""] | ||
automatic_failover_enabled = false | ||
multi_az_enabled = false | ||
num_cache_clusters = 1 | ||
replicas_per_node_group = 1 | ||
retention_in_days = 0 | ||
snapshot_retention_limit = 7 | ||
log_delivery_configuration = [ | ||
{ | ||
destination_type = "cloudwatch-logs" | ||
log_format = "json" | ||
log_type = "slow-log" | ||
}, | ||
{ | ||
destination_type = "cloudwatch-logs" | ||
log_format = "json" | ||
log_type = "engine-log" | ||
} | ||
] | ||
extra_tags = { | ||
Application = "CloudDrove" | ||
} | ||
``` | ||
### Redis Cluster | ||
```hcl | ||
module "redis-cluster" { | ||
source = "clouddrove/elasticache/aws | ||
version = "1.3.0" | ||
name = "cluster" | ||
environment = "test" | ||
label_order = ["environment","name"] | ||
source = "clouddrove/elasticache/aws | ||
version = "1.3.0" | ||
name = "redis-cluster" | ||
environment = "test" | ||
label_order = ["environment", "name"] | ||
vpc_id = module.vpc.vpc_id | ||
allowed_ip = [module.vpc.vpc_cidr_block] | ||
allowed_ports = [6379] | ||
cluster_replication_enabled = true | ||
engine = "redis" | ||
engine_version = "5.0.0" | ||
family = "redis5.0" | ||
engine_version = "7.0" | ||
parameter_group_name = "default.redis7.cluster.on" | ||
port = 6379 | ||
node_type = "cache.t2.micro" | ||
subnet_ids = module.subnets.public_subnet_id | ||
security_group_ids = [module.redis-sg.security_group_ids] | ||
availability_zones = ["eu-west-1a","eu-west-1b" ] | ||
auto_minor_version_upgrade = true | ||
availability_zones = ["eu-west-1a", "eu-west-1b"] | ||
replicas_per_node_group = 2 | ||
num_node_groups = 1 | ||
num_cache_nodes = 1 | ||
snapshot_retention_limit = 7 | ||
automatic_failover_enabled = true | ||
} | ||
extra_tags = { | ||
Application = "CloudDrove" | ||
} | ||
``` | ||
### Memcache | ||
```hcl | ||
module "memcached" { | ||
source = "clouddrove/elasticache/aws | ||
version = "1.3.0" | ||
name = "memcached" | ||
environment = "test" | ||
label_order = ["environment", "name"] | ||
cluster_enabled = true | ||
engine = "memcached" | ||
engine_version = "1.5.10" | ||
family = "memcached1.5" | ||
parameter_group_name = "default.memcached1.5" | ||
az_mode = "cross-az" | ||
port = 11211 | ||
node_type = "cache.t2.micro" | ||
num_cache_nodes = 2 | ||
subnet_ids = ["subnet-xxxxxxx","subnet-xxxxxxx","subnet-xxxxxxx"] | ||
security_group_ids = ["sg-xxxxxxxxx"] | ||
availability_zones = ["eu-west-1a","eu-west-1b" ] | ||
source = "clouddrove/elasticache/aws | ||
version = "1.3.0" | ||
name = "memcached" | ||
environment = "test" | ||
label_order = ["name", "environment"] | ||
vpc_id = module.vpc.vpc_id | ||
allowed_ip = [module.vpc.vpc_cidr_block] | ||
allowed_ports = [11211] | ||
cluster_enabled = true | ||
engine = "memcached" | ||
engine_version = "1.6.17" | ||
family = "memcached1.5" | ||
parameter_group_name = "" | ||
az_mode = "cross-az" | ||
port = 11211 | ||
node_type = "cache.t2.micro" | ||
num_cache_nodes = 2 | ||
subnet_ids = module.subnets.public_subnet_id | ||
availability_zones = ["eu-west-1a", "eu-west-1b"] | ||
extra_tags = { | ||
Application = "CloudDrove" | ||
} | ||
``` | ||
|
||
|
@@ -151,61 +191,98 @@ Here are some examples of how you can use this module in your inventory structur | |
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| alias | The display name of the alias. The name must start with the word `alias` followed by a forward slash. | `string` | `"alias/redis"` | no | | ||
| allowed\_ip | List of allowed ip. | `list(any)` | `[]` | no | | ||
| allowed\_ports | List of allowed ingress ports | `list(any)` | `[]` | no | | ||
| apply\_immediately | Specifies whether any modifications are applied immediately, or during the next maintenance window. Default is false. | `bool` | `false` | no | | ||
| at\_rest\_encryption\_enabled | Enable encryption at rest. | `bool` | `true` | no | | ||
| attributes | Additional attributes (e.g. `1`). | `list(any)` | `[]` | no | | ||
| auth\_token | The password used to access a password protected server. Can be specified only if transit\_encryption\_enabled = true. | `string` | `"gihweisdjhewiuei"` | no | | ||
| auth\_token | The password used to access a password protected server. Can be specified only if transit\_encryption\_enabled = true. | `string` | `null` | no | | ||
| 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. | `bool` | `true` | no | | ||
| 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. | `bool` | `false` | no | | ||
| 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. | `bool` | `true` | no | | ||
| 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 | | ||
| 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 | | ||
| cluster\_enabled | (Memcache only) Enabled or disabled cluster. | `bool` | `false` | no | | ||
| cluster\_replication\_enabled | (Redis only) Enabled or disabled replication\_group for redis cluster. | `bool` | `false` | no | | ||
| description | Description for the cache subnet group. Defaults to `Managed by Terraform`. | `string` | `"Managed by Terraform"` | no | | ||
| customer\_master\_key\_spec | Specifies whether the key contains a symmetric key or an asymmetric key pair and the encryption algorithms or signing algorithms that the key supports. Valid values: SYMMETRIC\_DEFAULT, RSA\_2048, RSA\_3072, RSA\_4096, ECC\_NIST\_P256, ECC\_NIST\_P384, ECC\_NIST\_P521, or ECC\_SECG\_P256K1. Defaults to SYMMETRIC\_DEFAULT. | `string` | `"SYMMETRIC_DEFAULT"` | no | | ||
| deletion\_window\_in\_days | Duration in days after which the key is deleted after destruction of the resource. | `number` | `7` | no | | ||
| dns\_record\_name | The name of the record. | `string` | `""` | no | | ||
| egress\_rule | Enable to create egress rule | `bool` | `true` | no | | ||
| enable | Enable or disable of elasticache | `bool` | `true` | no | | ||
| enable\_key\_rotation | Specifies whether key rotation is enabled. | `string` | `true` | no | | ||
| enable\_security\_group | Enable default Security Group with only Egress traffic allowed. | `bool` | `true` | no | | ||
| engine | The name of the cache engine to be used for the clusters in this replication group. e.g. redis. | `string` | `""` | no | | ||
| engine\_version | The version number of the cache engine to be used for the cache clusters in this replication group. | `string` | `""` | no | | ||
| environment | Environment (e.g. `prod`, `dev`, `staging`). | `string` | `""` | no | | ||
| existing\_sg\_id | Provide existing security group id for updating existing rule | `string` | `null` | no | | ||
| extra\_tags | Additional tags (e.g. map(`BusinessUnit`,`XYZ`). | `map(string)` | `{}` | no | | ||
| family | (Required) The family of the ElastiCache parameter group. | `string` | `""` | no | | ||
| is\_enabled | Specifies whether the key is enabled. | `bool` | `true` | no | | ||
| is\_external | enable to udated existing security Group | `bool` | `false` | no | | ||
| key\_usage | Specifies the intended use of the key. Defaults to ENCRYPT\_DECRYPT, and only symmetric encryption and decryption are supported. | `string` | `"ENCRYPT_DECRYPT"` | no | | ||
| kms\_description | The description of the key as viewed in AWS console. | `string` | `"Parameter Store KMS master key"` | no | | ||
| kms\_key\_enabled | Specifies whether the kms is enabled or disabled. | `bool` | `true` | no | | ||
| 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 | | ||
| kms\_multi\_region | Indicates whether the KMS key is a multi-Region (true) or regional (false) key. | `bool` | `false` | no | | ||
| label\_order | Label order, e.g. `name`,`application`. | `list(any)` | `[]` | no | | ||
| log\_delivery\_configuration | The log\_delivery\_configuration block allows the streaming of Redis SLOWLOG or Redis Engine Log to CloudWatch Logs or Kinesis Data Firehose. Max of 2 blocks. | `list(map(any))` | `[]` | no | | ||
| maintenance\_window | Maintenance window. | `string` | `"sun:05:00-sun:06:00"` | no | | ||
| managedby | ManagedBy, eg 'CloudDrove' or 'AnmolNagpal'. | `string` | `"[email protected]"` | no | | ||
| memcached\_route53\_record\_enabled | Whether to create Route53 record memcached set. | `bool` | `false` | no | | ||
| memcached\_ssm\_parameter\_endpoint\_enabled | Name of the parameter. | `bool` | `false` | no | | ||
| 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. | `bool` | `false` | no | | ||
| name | Name (e.g. `app` or `cluster`). | `string` | `""` | no | | ||
| node\_type | The compute and memory capacity of the nodes in the node group. | `string` | `"cache.t2.small"` | no | | ||
| notification\_topic\_arn | An Amazon Resource Name (ARN) of an SNS topic to send ElastiCache notifications to. | `string` | `""` | no | | ||
| num\_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 | | ||
| num\_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. | `number` | `1` | no | | ||
| 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. | `number` | `1` | no | | ||
| num\_node\_groups | Number of Shards (nodes). | `string` | `""` | no | | ||
| parameter\_group\_name | The name of the parameter group to associate with this replication group. If this argument is omitted, the default cache parameter group for the specified engine is used. | `string` | `"default.redis5.0"` | no | | ||
| port | the port number on which each of the cache nodes will accept connections. | `string` | `""` | no | | ||
| replicas\_per\_node\_group | Replicas per Shard. | `string` | `""` | no | | ||
| replication\_enabled | (Redis only) Enabled or disabled replication\_group for redis standalone instance. | `bool` | `false` | no | | ||
| protocol | The protocol. If not icmp, tcp, udp, or all use the. | `string` | `"tcp"` | no | | ||
| replicas\_per\_node\_group | Replicas per Shard. | `number` | `2` | no | | ||
| replication\_group\_description | Name of either the CloudWatch Logs LogGroup or Kinesis Data Firehose resource. | `string` | `"User-created description for the replication group."` | no | | ||
| replication\_group\_id | The replication group identifier This parameter is stored as a lowercase string. | `string` | `""` | no | | ||
| repository | Terraform current module repo | `string` | `"https://github.com/clouddrove/terraform-aws-elasticache"` | no | | ||
| retention\_in\_days | Specifies the number of days you want to retain log events in the specified log group. | `number` | `0` | no | | ||
| security\_group\_ids | One or more VPC security groups associated with the cache cluster. | `list` | `[]` | no | | ||
| route53\_record\_enabled | Whether to create Route53 record set. | `bool` | `false` | no | | ||
| route53\_ttl | (Required for non-alias records) The TTL of the record. | `string` | `""` | no | | ||
| route53\_type | The record type. Valid values are A, AAAA, CAA, CNAME, MX, NAPTR, NS, PTR, SOA, SPF, SRV and TXT. | `string` | `""` | no | | ||
| route53\_zone\_id | Zone ID. | `string` | n/a | yes | | ||
| security\_group\_names | A list of cache security group names to associate with this replication group. | `any` | `null` | no | | ||
| sg\_description | The security group description. | `string` | `"Instance default security group (only egress access is allowed)."` | no | | ||
| sg\_egress\_description | Description of the egress and ingress rule | `string` | `"Description of the rule."` | no | | ||
| sg\_egress\_ipv6\_description | Description of the egress\_ipv6 rule | `string` | `"Description of the rule."` | no | | ||
| sg\_ids | of the security group id. | `list(any)` | `[]` | no | | ||
| sg\_ingress\_description | Description of the ingress rule | `string` | `"Description of the ingress rule use elasticache."` | no | | ||
| snapshot\_arns | A single-element string list containing an Amazon Resource Name (ARN) of a Redis RDB snapshot file stored in Amazon S3. | `any` | `null` | no | | ||
| 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 | | ||
| 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 | | ||
| 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. | `any` | `null` | no | | ||
| subnet\_ids | List of VPC Subnet IDs for the cache subnet group. | `list` | `[]` | no | | ||
| 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` | `null` | no | | ||
| ssm\_paramete\_kms\_key\_id | KMS key ID or ARN for encrypting a SecureString. | `string` | `""` | no | | ||
| ssm\_parameter\_description | SSM Parameters can be imported using. | `string` | `"Description of the parameter."` | no | | ||
| ssm\_parameter\_enabled | Name of the parameter. | `bool` | `true` | no | | ||
| ssm\_parameter\_endpoint\_enabled | Name of the parameter. | `bool` | `false` | no | | ||
| ssm\_parameter\_type | Type of the parameter. | `string` | `"SecureString"` | no | | ||
| subnet\_group\_description | Description for the cache subnet group. Defaults to `Managed by Terraform`. | `string` | `"The Description of the ElastiCache Subnet Group."` | no | | ||
| subnet\_ids | List of VPC Subnet IDs for the cache subnet group. | `list(any)` | `[]` | no | | ||
| transit\_encryption\_enabled | Whether to enable encryption in transit. | `bool` | `true` | no | | ||
| vpc\_id | The ID of the VPC that the instance security group belongs to. | `string` | `""` | no | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| Memcached\_ssm\_name | A list of all of the parameter values | | ||
| hostname | DNS hostname | | ||
| id | Redis cluster id. | | ||
| memcached\_arn | Memcached arn | | ||
| memcached\_endpoint | Memcached endpoint address. | | ||
| memcached\_hostname | DNS hostname | | ||
| port | Redis port. | | ||
| redis\_arn | Redis arn | | ||
| redis\_endpoint | Redis endpoint address. | | ||
| redis\_ssm\_name | A list of all of the parameter values | | ||
| sg\_id | n/a | | ||
| tags | A mapping of tags to assign to the resource. | | ||
|
||
|
||
|