diff --git a/redis.cfhighlander.rb b/redis.cfhighlander.rb index 70a8174..c510b18 100644 --- a/redis.cfhighlander.rb +++ b/redis.cfhighlander.rb @@ -44,6 +44,9 @@ description: 'The number of clusters this replication group initially has' end + ComponentParam 'DataTieringEnabled', 'false', allowedValues: ['false', 'true'], + description: 'Enables DataTiering and requires InstanceType to be a r6gd type' + end end \ No newline at end of file diff --git a/redis.cfndsl.rb b/redis.cfndsl.rb index ad2306e..b298558 100644 --- a/redis.cfndsl.rb +++ b/redis.cfndsl.rb @@ -78,6 +78,8 @@ replication_mode = external_parameters.fetch(:replication_mode, 'node_group') automatic_failover = external_parameters.fetch(:automatic_failover, true) + Condition('DataTieringEnabled', FnEquals(Ref(:DataTieringEnabled), 'true')) + engine = external_parameters.fetch(:engine, 'redis') ElastiCache_ReplicationGroup(:ReplicationGroupRedis) { @@ -94,6 +96,8 @@ AutoMinorVersionUpgrade minor_upgrade AutomaticFailoverEnabled automatic_failover + DataTieringEnabled FnIf('DataTieringEnabled', Ref(:DataTieringEnabled), Ref('AWS::NoValue')) + CacheNodeType Ref(:InstanceType) CacheParameterGroupName Ref(:ParameterGroupRedis) CacheSubnetGroupName Ref(:SubnetGroupRedis) diff --git a/spec/cache-cluster_spec.rb b/spec/cache-cluster_spec.rb index f75d4ab..f91903f 100644 --- a/spec/cache-cluster_spec.rb +++ b/spec/cache-cluster_spec.rb @@ -22,6 +22,7 @@ "CacheNodeType" => {"Ref"=>"InstanceType"}, "CacheParameterGroupName" => {"Ref"=>"ParameterGroupRedis"}, "CacheSubnetGroupName" => {"Ref"=>"SubnetGroupRedis"}, + "DataTieringEnabled" => {"Fn::If"=>["DataTieringEnabled", {"Ref"=>"DataTieringEnabled"}, {"Ref"=>"AWS::NoValue"}]}, "Engine" => "redis", "NumCacheClusters" => {"Ref"=>"NumCacheClusters"}, "ReplicationGroupDescription" => {"Fn::Sub"=>"${EnvironmentName}-redis"}, diff --git a/spec/clustered_spec.rb b/spec/clustered_spec.rb index eba68b5..7517b74 100644 --- a/spec/clustered_spec.rb +++ b/spec/clustered_spec.rb @@ -22,6 +22,7 @@ "CacheNodeType" => {"Ref"=>"InstanceType"}, "CacheParameterGroupName" => {"Ref"=>"ParameterGroupRedis"}, "CacheSubnetGroupName" => {"Ref"=>"SubnetGroupRedis"}, + "DataTieringEnabled" => {"Fn::If"=>["DataTieringEnabled", {"Ref"=>"DataTieringEnabled"}, {"Ref"=>"AWS::NoValue"}]}, "Engine" => "redis", "NumNodeGroups" => {"Ref"=>"NumNodeGroups"}, "Port" => 1234, diff --git a/spec/default_spec.rb b/spec/default_spec.rb index cf00917..ef816ac 100644 --- a/spec/default_spec.rb +++ b/spec/default_spec.rb @@ -22,6 +22,7 @@ "CacheNodeType" => {"Ref"=>"InstanceType"}, "CacheParameterGroupName" => {"Ref"=>"ParameterGroupRedis"}, "CacheSubnetGroupName" => {"Ref"=>"SubnetGroupRedis"}, + "DataTieringEnabled" => {"Fn::If"=>["DataTieringEnabled", {"Ref"=>"DataTieringEnabled"}, {"Ref"=>"AWS::NoValue"}]}, "Engine" => "redis", "NumNodeGroups" => {"Ref"=>"NumNodeGroups"}, "ReplicasPerNodeGroup" => {"Ref"=>"ReplicasPerNodeGroup"}, diff --git a/spec/node-group_spec.rb b/spec/node-group_spec.rb index 7afd09b..dbf54a6 100644 --- a/spec/node-group_spec.rb +++ b/spec/node-group_spec.rb @@ -22,6 +22,7 @@ "CacheNodeType" => {"Ref"=>"InstanceType"}, "CacheParameterGroupName" => {"Ref"=>"ParameterGroupRedis"}, "CacheSubnetGroupName" => {"Ref"=>"SubnetGroupRedis"}, + "DataTieringEnabled" => {"Fn::If"=>["DataTieringEnabled", {"Ref"=>"DataTieringEnabled"}, {"Ref"=>"AWS::NoValue"}]}, "Engine" => "redis", "NumNodeGroups" => {"Ref"=>"NumNodeGroups"}, "ReplicasPerNodeGroup" => {"Ref"=>"ReplicasPerNodeGroup"}, diff --git a/spec/non-clustered_spec.rb b/spec/non-clustered_spec.rb index a6e694b..2d9267d 100644 --- a/spec/non-clustered_spec.rb +++ b/spec/non-clustered_spec.rb @@ -22,6 +22,7 @@ "CacheNodeType" => {"Ref"=>"InstanceType"}, "CacheParameterGroupName" => {"Ref"=>"ParameterGroupRedis"}, "CacheSubnetGroupName" => {"Ref"=>"SubnetGroupRedis"}, + "DataTieringEnabled" => {"Fn::If"=>["DataTieringEnabled", {"Ref"=>"DataTieringEnabled"}, {"Ref"=>"AWS::NoValue"}]}, "Engine" => "redis", "NumNodeGroups" => {"Ref"=>"NumNodeGroups"}, "ReplicasPerNodeGroup" => {"Ref"=>"ReplicasPerNodeGroup"},