From 589f40313c178c07c1fb59271842b16ced7549fa Mon Sep 17 00:00:00 2001 From: lohgannash Date: Fri, 6 Nov 2020 15:54:17 +1100 Subject: [PATCH 1/2] Allow config of volumes/volume sizes --- eks-cluster.cfndsl.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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) } From c954ad22c292a77ffca457848b812f8a8e8dc0a5 Mon Sep 17 00:00:00 2001 From: lohgannash Date: Fri, 6 Nov 2020 16:03:37 +1100 Subject: [PATCH 2/2] add volume test file --- tests/volume_size.test.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tests/volume_size.test.yaml 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