Skip to content

Commit dbd5d4c

Browse files
authored
Merge pull request #124 from GwonsooLee/add_gp3
aed gp3 for ebs volume
2 parents 8546fee + 968a94d commit dbd5d4c

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

pkg/builder/builder.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,8 @@ func (b Builder) CheckValidation() error {
336336
return fmt.Errorf("not available volume type : %s", block.VolumeType)
337337
}
338338

339-
if block.VolumeType == "gp2" && block.VolumeSize < 1 {
340-
return errors.New("volume size of gp2 type should be larger than 1GiB")
339+
if tool.IsStringInArray(block.VolumeType, []string{"gp2", "gp3"}) && block.VolumeSize < 1 {
340+
return errors.New("volume size of gp2 or gp3 type should be larger than 1GiB")
341341
}
342342

343343
if tool.IsStringInArray(block.VolumeType, constants.IopsRequiredBlockType) && block.VolumeSize < 4 {

pkg/builder/builder_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ func TestCheckValidationStack(t *testing.T) {
345345

346346
b.Stacks[0].BlockDevices[0].VolumeType = "gp2"
347347
b.Stacks[0].BlockDevices[0].VolumeSize = 0
348-
if err := b.CheckValidation(); err == nil || err.Error() != "volume size of gp2 type should be larger than 1GiB" {
348+
if err := b.CheckValidation(); err == nil || err.Error() != "volume size of gp2 or gp3 type should be larger than 1GiB" {
349349
t.Errorf("validation failed: volume size - gp2")
350350
}
351351

pkg/constants/constants.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ var (
185185
AWSConfigPath = HomeDir() + "/.aws/config"
186186

187187
// AvailableBlockTypes is a list of available ebs block types
188-
AvailableBlockTypes = []string{"io1", "io2", "gp2", "st1", "sc1"}
188+
AvailableBlockTypes = []string{"io1", "io2", "gp2", "gp3", "st1", "sc1"}
189189

190190
// IopsRequiredBlockType is a list of ebs type which requires iops
191191
IopsRequiredBlockType = []string{"io1", "io2"}

test/test_manifest.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,17 @@ stacks:
9696
lifecycle_callbacks:
9797
pre_terminate_past_cluster:
9898
- service hello stop
99+
# lifecycle hooks
100+
lifecycle_hooks:
101+
# Lifecycle hooks for launching new instances
102+
launch_transition:
103+
- lifecycle_hook_name: hello-launch-lifecycle-hook
104+
heartbeat_timeout: 30
105+
default_result: CONTINUE
106+
notification_metadata: "this is test for launching"
107+
#notification_target_arn: arn:aws:sns:ap-northeast-2:816736805842:test
108+
#role_arn: arn:aws:iam::816736805842:role/test-autoscaling-role
109+
99110
regions:
100111
- region: ap-northeast-2
101112
instance_type: t3.medium
@@ -278,6 +289,9 @@ stacks:
278289
volume_size: 8
279290
volume_type: "io2"
280291
iops: 100
292+
- device_name: /dev/xvdb
293+
volume_size: 400
294+
volume_type: "gp3"
281295
autoscaling: *autoscaling_policy
282296
alarms: *autoscaling_alarms
283297

0 commit comments

Comments
 (0)