redis_clusters
Description
The Provose redis_clusters
module sets up a Redis instance using Amazon ElastiCache for Redis.
Currently, Provose only supports setting up clusters that contain a single instance, meaning that the instances.instance_count
parameter is not yet supported.
Examples
module "myproject" {
source = "github.com/provose/provose?ref=v2.0.0"
provose_config = {
authentication = {
aws = {
region = "us-east-1"
}
}
name = "myproject"
internal_root_domain = "example-internal.com"
internal_subdomain = "production"
}
# Here, we create two Redis clusters named "cluster1" and "cluster2".
redis_clusters = {
# This cluster's DNS name is cluster1.production.example-internal.com
cluster1 = {
engine_version = "5.0.6"
instances = {
instance_type = "cache.t3.micro"
}
}
# This cluster's DNS name is cluster2.production.example-internal.com
cluster2 = {
engine_version = "5.0.6"
instances = {
instance_type = "cache.m5.large"
}
# This means that changes to the cluster are applied in the next
# mantenance window as opposed to immediately.
apply_immediately = false
}
}
}
Inputs
-
instances
– Required. This is a group of settings for the instances that run the ElastiCache cluster.instance_type
– Required. This lists the ElastiCache-specific instance type to deploy. An example value is"cache.m5.large"
. A complete list of available instance types is here in the AWS documentation.
-
engine_version
– Required. This lists the Redis version to deploy–like"5.0.6"
. A complete list of available versions is available here in the AWS documentation. -
apply_immediately
– Optional. This defaults totrue
, which makes configuration changes apply to the cluster immediately. When set tofalse
, configuration changes are instead applied during the cluster’s next maintenance window.
Outputs
-
redis_clusters.aws_security_group.redis
– This is aaws_security_group
resource that governs access to the cluster. By default, the Redis cluster is accessible within the containing VPC created by Provose. -
redis_clusters.aws_elasticache_subnet_group.redis
– This is theaws_elasticache_subnet_group
resource that defines which subnets are available to the clusters. By default, this is all of the subnets in the VPC. -
redis_clusters.aws_elasticache_cluster.redis
– This is a mapping from cluster names toaws_elasticache_cluster
resources that configure each cluster. -
redis_clusters.aws_route53_record.redis
– This is a mapping from cluster names toaws_route53_record
resources representing Route 53 DNS records that give friendly names to the clusters.