Skip to content

Commit

Permalink
Merge pull request #11 from theonestack/feature/data-tiering
Browse files Browse the repository at this point in the history
adds support for enabling data tiering
  • Loading branch information
aaronwalker authored Oct 21, 2024
2 parents 656ee55 + 3667a82 commit 598580e
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions redis.cfhighlander.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions redis.cfndsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions spec/cache-cluster_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down
1 change: 1 addition & 0 deletions spec/clustered_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions spec/default_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down
1 change: 1 addition & 0 deletions spec/node-group_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down
1 change: 1 addition & 0 deletions spec/non-clustered_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down

0 comments on commit 598580e

Please sign in to comment.