Skip to content

SPHTech-Platform/terraform-aws-elasticache-redis

Repository files navigation

Requirements

Name Version
terraform >= 1.0
aws >= 4.0
awscc >= 0.67.0

Providers

Name Version
aws 5.5.0
awscc 0.67.0

Modules

No modules.

Resources

Name Type
aws_cloudwatch_metric_alarm.cache_cpu resource
aws_cloudwatch_metric_alarm.cache_memory resource
aws_cloudwatch_metric_alarm.cache_serverless_data resource
aws_cloudwatch_metric_alarm.cache_serverless_ecpu resource
aws_cloudwatch_metric_alarm.cache_serverless_throttled_commands resource
aws_elasticache_parameter_group.this resource
aws_elasticache_replication_group.this resource
aws_elasticache_subnet_group.this resource
awscc_elasticache_serverless_cache.this resource

Inputs

Name Description Type Default Required
alarm_actions The list of actions to execute when this alarm transitions into an ALARM state from any other state. list(string) [] no
alarm_cpu_threshold_percent CPU threshold alarm level number 75 no
alarm_data_threshold_percent Data threshold alarm level for elasticache serverless number 75 no
alarm_ecpu_threshold_percent ECPU threshold alarm level for elasticache serverless number 75 no
alarm_memory_threshold_bytes Alarm memory threshold bytes number 10000000 no
apply_immediately Specifies whether any database modifications are applied immediately, or during the next maintenance window bool true no
auth_token Password used to access a password protected server. Can be specified only if transit_encryption_enabled = true string null no
cluster_id Cluster ID string null no
cluster_mode_enabled Set to false to diable cluster module bool false no
cluster_size Cluster size number 1 no
create_elasticache_subnet_group Create Elasticache Subnet Group bool true no
daily_snapshot_time The daily time range (in UTC) during which the service takes automatic snapshot of the Serverless Cache string "18:00" no
elasticache_parameter_group_family ElastiCache parameter group family string "redis7" no
enabled Set to false to prevent the module from creating any resources bool true no
engine_version Redis engine version. https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/supported-engine-versions.html string "7.0" no
instance_type Elastic cache instance type string "cache.t2.micro" 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 null no
maintenance_window Maintenance window string "wed:03:00-wed:04:00" no
max_data_storage The maximun cached data capacity of the Serverless Cache in GB number 10 no
max_ecpu_per_second The maximum ECPU per second of the Serverless Cache number 1000 no
name Name of the application string "value" no
notification_topic_arn ARN of an SNS topic to send ElastiCache notifications string "" no
num_node_groups Number of node groups (shards) for this Redis replication group. Changing this number will trigger an online resizing operation before other settings modifications. Required unless global_replication_group_id is set number 2 no
ok_actions The list of actions to execute when this alarm transitions into an OK state from any other state. list(string) [] no
parameter_group_name Existing Parameter Group name string "" no
parameters A list of Redis parameters to apply. Note that parameters may differ from one Redis family to another
list(object({
name = string
value = string
}))
[] no
port Redis port number 6379 no
preferred_cache_cluster_azs 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 considered. The first item in the list will be the primary node. Ignored when updating list(string)
[
"ap-southeast-1a",
"ap-southeast-1b"
]
no
replicas_per_node_group Number of replica nodes in each node group. Valid values are 0 to 5. Changing this number will trigger an online resizing operation before other settings modifications. number 1 no
replication_enabled Set to false to diable replication in redis cluster bool false no
replication_group_id ElastiCache replication_group_id string "" no
security_groups List of Security Group IDs to place the cluster into list(string) [] no
serverless_user_group_id The ID of the user group for Serverless Cache string "" no
snapshot_arns_to_restore The ARN's of snapshot to restore Serverless Cache list(string) [] no
snapshot_retention_limit 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 snapshot_retention_limit is set to zero (0), backups are turned off. Please note that setting a snapshot_retention_limit is not supported on cache.t1.micro cache nodes number 5 no
subnet_group_name Subnet group name for the ElastiCache instance string "" no
subnets AWS subnet ids list(string) [] no
tags Additional tags (_e.g._ map("BusinessUnit","ABC") map(string) {} no
use_serverless Use serverless ElastiCache service bool false no

Outputs

Name Description
arn Elasticache Replication Group ARN
cluster_enabled Indicates if cluster mode is enabled.
configuration_endpoint_address Address of the replication group configuration endpoint when cluster mode is enabled.
endpoint Redis primary or configuration endpoint, whichever is appropriate for the given cluster mode
engine_version_actual Because ElastiCache pulls the latest minor or patch for a version, this attribute returns the running version of the cache engine.
id ID of the ElastiCache Replication Group.
member_clusters Redis cluster members
parameter_group_arn The AWS ARN associated with the parameter group.
parameter_group_id The ElastiCache parameter group name.
reader_endpoint_address The address of the endpoint for the reader node in the replication group, if the cluster mode is disabled
subnet_group_name The Name of the ElastiCache Subnet Group.
subnet_group_subnet_ids The Subnet IDs of the ElastiCache Subnet Group.