diff --git a/eks-cluster.cfndsl.rb b/eks-cluster.cfndsl.rb index f6a1287..d3d2892 100644 --- a/eks-cluster.cfndsl.rb +++ b/eks-cluster.cfndsl.rb @@ -190,6 +190,20 @@ end + volumes = [] + volume_size = external_parameters.fetch(:volume_size, nil) + + unless volume_size.nil? + volumes << { + DeviceName: '/dev/xvda', + Ebs: { + VolumeSize: volume_size + } + } + template_data[:BlockDeviceMappings] = volumes + end + + EC2_LaunchTemplate(:EksNodeLaunchTemplate) { LaunchTemplateData(template_data) } diff --git a/tests/volume_size.test.yaml b/tests/volume_size.test.yaml new file mode 100644 index 0000000..2c8598b --- /dev/null +++ b/tests/volume_size.test.yaml @@ -0,0 +1,6 @@ +test_metadata: + type: config + name: volume_size + description: Test custom volume size + +volume_size: 120 \ No newline at end of file