@@ -76,6 +76,7 @@ func CreateBastion(c *cli.Context) (string, string, error) {
76
76
spot bool
77
77
publicIpAddress bool
78
78
bastionInstanceId string
79
+ volumeSize int64
79
80
volumeEncryption bool
80
81
volumeType string
81
82
)
@@ -126,16 +127,21 @@ func CreateBastion(c *cli.Context) (string, string, error) {
126
127
publicIpAddress = false
127
128
}
128
129
130
+ volumeSize = 8
131
+ if c .IsSet ("volume-size" ) {
132
+ volumeSize = c .Int64 ("volume-size" ) //Default volume-size
133
+ }
134
+
129
135
volumeEncryption = true
130
136
if c .Bool ("volume-encryption" ) {
131
137
volumeEncryption = false
132
138
}
133
- volumeType = c .String ("volume-type" )
134
139
140
+ volumeType = c .String ("volume-type" )
135
141
if volumeType == "" {
136
142
volumeType = "gp2" //Default volume-type
137
143
}
138
-
144
+
139
145
subnetId = c .String ("subnet-id" )
140
146
if subnetId == "" {
141
147
subnets , err := GetSubnets (sess )
@@ -165,7 +171,7 @@ func CreateBastion(c *cli.Context) (string, string, error) {
165
171
166
172
userdata = BuildLinuxUserdata (sshKey , c .String ("ssh-user" ), expire , expireAfter , c .String ("efs" ), c .String ("access-points" ))
167
173
168
- bastionInstanceId , err = StartEc2 (id , sess , ami , instanceProfile , subnetId , securitygroupId , instanceType , launchedBy , userdata , keyName , spot , publicIpAddress , volumeEncryption , volumeType )
174
+ bastionInstanceId , err = StartEc2 (id , sess , ami , instanceProfile , subnetId , securitygroupId , instanceType , launchedBy , userdata , keyName , spot , publicIpAddress , volumeSize , volumeEncryption , volumeType )
169
175
if err != nil {
170
176
return "" , "" , err
171
177
}
@@ -190,6 +196,7 @@ func CmdLaunchWindowsBastion(c *cli.Context) error {
190
196
spot bool
191
197
publicIpAddress bool
192
198
bastionInstanceId string
199
+ volumeSize int64
193
200
volumeEncryption bool
194
201
volumeType string
195
202
)
@@ -224,13 +231,17 @@ func CmdLaunchWindowsBastion(c *cli.Context) error {
224
231
publicIpAddress = false
225
232
}
226
233
234
+ volumeSize = 8
235
+ if c .IsSet ("volume-size" ) {
236
+ volumeSize = c .Int64 ("volume-size" ) //Default volume-size
237
+ }
238
+
227
239
volumeEncryption = true
228
240
if c .Bool ("volume-encryption" ) {
229
241
volumeEncryption = false
230
242
}
231
243
232
244
volumeType = c .String ("volume-type" )
233
-
234
245
if volumeType == "" {
235
246
volumeType = "gp2" //Default volume-type
236
247
}
@@ -281,7 +292,7 @@ func CmdLaunchWindowsBastion(c *cli.Context) error {
281
292
282
293
userdata = BuildWindowsUserdata ()
283
294
284
- bastionInstanceId , err = StartEc2 (id , sess , ami , instanceProfile , subnetId , securitygroupId , instanceType , launchedBy , userdata , keyName , spot , publicIpAddress , volumeEncryption , volumeType )
295
+ bastionInstanceId , err = StartEc2 (id , sess , ami , instanceProfile , subnetId , securitygroupId , instanceType , launchedBy , userdata , keyName , spot , publicIpAddress , volumeSize , volumeEncryption , volumeType )
285
296
if err != nil {
286
297
return err
287
298
}
0 commit comments