Fugue.AWS.Elasticache.Redis

Table of Contents

Module Members

new

(Function)

A Redis constructor.

The Redis constructor is used for creating a group of Redis cache nodes, where one is the primary read/write node and the others are read-only replicas.

Example usage:

import Fugue.AWS as AWS
import Fugue.AWS.EC2 as EC2
import Fugue.AWS.Elasticache as Elasticache
import Fugue.AWS.Pattern.Network as Network

net: Network.new {
  name: "EXAMPLE",
  cidr: "10.42.0.0/16",
  region: AWS.Us-east-1,
  publicSubnets: [
    (AWS.B, "10.42.12.0/24"),
    (AWS.C, "10.42.13.0/24")
  ],
  privateSubnets: [
    (AWS.B, "10.42.22.0/24"),
    (AWS.C, "10.42.23.0/24")
  ]
}

subnetGroup: Elasticache.CacheSubnetGroup.new {
  name: "private",
  description: "private subnets",
  subnets: net.privateSubnets,
}

clusterSecurityGroup: EC2.SecurityGroup.new {
  description: "redis-example-cluster",
  ipPermissions: [
    # add rules here...
  ],
  ipPermissionsEgress: None,
  vpc: net.vpc,
  tags: None
}

cluster: Elasticache.Redis.new {
  replicationGroupName: "example-cluster",
  replicationGroupDescription: "Example Redis cluster",
  cacheNodeType: Elasticache.Cache_t2_micro,
  numReplicas: 5,
  securityGroups: [clusterSecurityGroup],
  cacheSubnetGroup: subnetGroup,
}

Type Signature

 fun { cacheNodeType: CacheNodeType,
       securityGroups: Optional<List<SecurityGroup>>,
       primaryClusterName: Optional<String>,
       numReplicas: Optional<Int>,
       replicationGroupName: String,
       replicationGroupDescription: String,
       port: Optional<Int>,
       tags: Optional<List<Tag>>,
       cacheSubnetGroup: CacheSubnetGroup} -> ReplicationGroup
Argument: cacheNodeType

The node type to use for the cluster. Mutable.

Type: CacheNodeType

Argument: securityGroups

The list of SecurityGroups to associate with the cluster. Mutable.

Type: Optional<List<SecurityGroup>>

Argument: primaryClusterName

The name assigned to the primary read/write cluster. If it is omitted, the name of the replication group is used. Up to 20 lower case alphanumeric characters or hyphens. Must start with a letter. Cannot end with a hyphen or include two consecutive hyphens.

Type: Optional<String>

Argument: numReplicas

The number of read-only replicas in the replication group. Valid values are 0 to 5.

Type: Optional<Int>

Argument: replicationGroupName

The ReplicationGroup identifier. Up to 20 lower case alphanumeric characters or hyphens. Must start with a letter. Cannot end with a hyphen or include two consecutive hyphens.

Type: String

Argument: replicationGroupDescription
Type: String
Argument: port

The cache port number.

Type: Optional<Int>

Argument: tags

A list of Tags to attach to the cluster.

Type: Optional<List<Tag>>

Argument: cacheSubnetGroup

The CacheSubnetGroup to deploy the cluster.

Type: CacheSubnetGroup

Returns:

A ReplicationGroup value.

Type: ReplicationGroup