Namespace Pulumi.Aws.ElastiCache
Classes
Cluster
Provides an ElastiCache Cluster resource, which manages a Memcached cluster or Redis instance.
For working with Redis (Cluster Mode Enabled) replication groups, see the
aws.elasticache.ReplicationGroup resource.
Note: When you change an attribute, such as
node_type, by default it is applied in the next maintenance window. Because of this, this provider may report a difference in its planning phase because the actual modification has not yet taken place. You can use theapply_immediatelyflag to instruct the service to apply the change immediately. Usingapply_immediatelycan result in a brief downtime as the server reboots. See the AWS Docs on Modifying an ElastiCache Cache Cluster for more information.
Example Usage
Memcached Cluster
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = new Aws.ElastiCache.Cluster("example", new Aws.ElastiCache.ClusterArgs
{
Engine = "memcached",
NodeType = "cache.m4.large",
NumCacheNodes = 2,
ParameterGroupName = "default.memcached1.4",
Port = 11211,
});
}
}
Redis Instance
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = new Aws.ElastiCache.Cluster("example", new Aws.ElastiCache.ClusterArgs
{
Engine = "redis",
EngineVersion = "3.2.10",
NodeType = "cache.m4.large",
NumCacheNodes = 1,
ParameterGroupName = "default.redis3.2",
Port = 6379,
});
}
}
Redis Cluster Mode Disabled Read Replica Instance
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var replica = new Aws.ElastiCache.Cluster("replica", new Aws.ElastiCache.ClusterArgs
{
ReplicationGroupId = aws_elasticache_replication_group.Example.Id,
});
}
}
ClusterArgs
ClusterState
GetCluster
GetClusterArgs
GetClusterResult
GetReplicationGroup
GetReplicationGroupArgs
GetReplicationGroupResult
ParameterGroup
Provides an ElastiCache parameter group resource.
NOTE: Attempting to remove the
reserved-memoryparameter whenfamilyis set toredis2.6orredis2.8may show a perpetual difference in this provider due to an Elasticache API limitation. Leave that parameter configured with any value to workaround the issue.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var @default = new Aws.ElastiCache.ParameterGroup("default", new Aws.ElastiCache.ParameterGroupArgs
{
Family = "redis2.8",
Parameters =
{
new Aws.ElastiCache.Inputs.ParameterGroupParameterArgs
{
Name = "activerehashing",
Value = "yes",
},
new Aws.ElastiCache.Inputs.ParameterGroupParameterArgs
{
Name = "min-slaves-to-write",
Value = "2",
},
},
});
}
}
ParameterGroupArgs
ParameterGroupState
ReplicationGroup
Provides an ElastiCache Replication Group resource.
For working with Memcached or single primary Redis instances (Cluster Mode Disabled), see the
aws.elasticache.Cluster resource.
Note: When you change an attribute, such as
engine_version, by default the ElastiCache API applies it in the next maintenance window. Because of this, this provider may report a difference in its planning phase because the actual modification has not yet taken place. You can use theapply_immediatelyflag to instruct the service to apply the change immediately. Usingapply_immediatelycan result in a brief downtime as servers reboots.
Example Usage
Redis Cluster Mode Enabled
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var baz = new Aws.ElastiCache.ReplicationGroup("baz", new Aws.ElastiCache.ReplicationGroupArgs
{
AutomaticFailoverEnabled = true,
ClusterMode = new Aws.ElastiCache.Inputs.ReplicationGroupClusterModeArgs
{
NumNodeGroups = 2,
ReplicasPerNodeGroup = 1,
},
NodeType = "cache.t2.small",
ParameterGroupName = "default.redis3.2.cluster.on",
Port = 6379,
ReplicationGroupDescription = "test description",
});
}
}
ReplicationGroupArgs
ReplicationGroupState
SecurityGroup
Provides an ElastiCache Security Group to control access to one or more cache clusters.
NOTE: ElastiCache Security Groups are for use only when working with an ElastiCache cluster outside of a VPC. If you are using a VPC, see the ElastiCache Subnet Group resource.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var barSecurityGroup = new Aws.Ec2.SecurityGroup("barSecurityGroup", new Aws.Ec2.SecurityGroupArgs
{
});
var barElasticache_securityGroupSecurityGroup = new Aws.ElastiCache.SecurityGroup("barElasticache/securityGroupSecurityGroup", new Aws.ElastiCache.SecurityGroupArgs
{
SecurityGroupNames =
{
barSecurityGroup.Name,
},
});
}
}
SecurityGroupArgs
SecurityGroupState
SubnetGroup
Provides an ElastiCache Subnet Group resource.
NOTE: ElastiCache Subnet Groups are only for use when working with an ElastiCache cluster inside of a VPC. If you are on EC2 Classic, see the ElastiCache Security Group resource.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var fooVpc = new Aws.Ec2.Vpc("fooVpc", new Aws.Ec2.VpcArgs
{
CidrBlock = "10.0.0.0/16",
Tags =
{
{ "Name", "tf-test" },
},
});
var fooSubnet = new Aws.Ec2.Subnet("fooSubnet", new Aws.Ec2.SubnetArgs
{
AvailabilityZone = "us-west-2a",
CidrBlock = "10.0.0.0/24",
Tags =
{
{ "Name", "tf-test" },
},
VpcId = fooVpc.Id,
});
var bar = new Aws.ElastiCache.SubnetGroup("bar", new Aws.ElastiCache.SubnetGroupArgs
{
SubnetIds =
{
fooSubnet.Id,
},
});
}
}