@@ -41,7 +41,7 @@ verify_input_as_integers () {
41
41
if ! [[ " $1 " =~ ^[0-9]+$ ]]
42
42
then
43
43
echo -e " +----------------------------------------------------+\n"
44
- echo " > Sorry, volume Size and provisioned IOPS needs to be an interger value."
44
+ echo " > Sorry, volume Size, provisioned IOPS and provisioned throughput needs to be an interger value."
45
45
echo -e " \n+----------------------------------------------------+"
46
46
exit 1
47
47
fi
104
104
105
105
# ###########################################################
106
106
107
+ calculate_gp3_limits () { # Calculating limits for Gp3 volume type
108
+
109
+ if [[ $volumeSize -lt 1 || $volumeSize -gt 16384 ]]
110
+ then
111
+ echo -e " +----------------------------------------------------+\n"
112
+ echo -e " > Volume size for $volumeType can not be less than 1GiB or greater than 16384GiB"
113
+ echo -e " \n+----------------------------------------------------+"
114
+ exit 1
115
+ fi
116
+
117
+ if [[ -z $volumeIOPS ]]
118
+ then
119
+ volumeIOPS=3000 # Set IOPS as Baseline(3000) for gp3 volume if it was created using CLI without provisioned IOPS .
120
+ else
121
+ verify_input_as_integers $volumeIOPS
122
+ if [[ $volumeIOPS -lt 3000 || $volumeIOPS -gt 64000 ]]
123
+ then
124
+ echo -e " +----------------------------------------------------+\n"
125
+ echo -e " > Provisioned IOPS can not be less than 3000 or greater than 16000 for Gp3 volume type.."
126
+ echo -e " \n+----------------------------------------------------+"
127
+ exit 1
128
+ elif [[ $(( volumeIOPS / volumeSize)) -gt 500 ]]
129
+ then
130
+ echo -e " +----------------------------------------------------+\n"
131
+ echo -e " > Maximum ratio of 500:1 is permitted between IOPS and volume size for Gp3 volume type."
132
+ echo -e " \n+----------------------------------------------------+"
133
+ exit 1
134
+ fi
135
+ fi
136
+
137
+ if [[ -z $volumeThroughput ]]
138
+ then
139
+ volumeThroughput=125 # Set Throughput as Baseline(125MiB/s) for gp3 volume if it was created using CLI without provisioned Throughput .
140
+ else
141
+ verify_input_as_integers $volumeThroughput
142
+ if [[ $volumeThroughput -lt 125 || $volumeThroughput -gt 1000 ]]
143
+ then
144
+ echo -e " +----------------------------------------------------+\n"
145
+ echo -e " > Provisioned throughput can not be less than 125MiB/s or greater than 1000MiB/s for Gp3 volume type.."
146
+ echo -e " \n+----------------------------------------------------+"
147
+ exit 1
148
+ elif [[ $(( volumeIOPS / volumeThroughput)) -lt 4 ]]
149
+ then
150
+ echo -e " +----------------------------------------------------+\n"
151
+ echo -e " > Maximum ratio of 0.25:1 is permitted between Throughput (MiBps) and IOPS for Gp3 volume type."
152
+ echo -e " \n+----------------------------------------------------+"
153
+ exit 1
154
+ fi
155
+ fi
156
+
157
+ echo -e " +----------------------------------------------------+\n"
158
+ echo -e " > Maximum available IOPS for your volume are $volumeIOPS "
159
+ echo -e " > Maximum Available throughput is $volumeThroughput MiB/s"
160
+ echo -e " \n+----------------------------------------------------+"
161
+ }
162
+ # ###########################################################
163
+
107
164
calculate_io_limits () {
108
165
109
166
if [[ $volumeIOPS -lt 100 || $volumeIOPS -gt 64000 ]]
@@ -219,6 +276,16 @@ case "$volumeType" in
219
276
verify_input_as_integers $volumeSize
220
277
calculate_gp2_limits # Calling gp2 function to calculate maximum limits.
221
278
;;
279
+ [gG][pP][3]) # If answer is gp2
280
+ echo -e " Enter Volume Size in GiB:"
281
+ read volumeSize
282
+ verify_input_as_integers $volumeSize
283
+ echo -e " Enter Provisioned IOPS, if volume was created via CLI without provisioned IOPS please press Enter:"
284
+ read volumeIOPS
285
+ echo -e " Enter Provisioned Throughput, if volume was created via CLI without provisioned Throughput please press Enter:"
286
+ read volumeThroughput
287
+ calculate_gp3_limits # Calling gp2 function to calculate maximum limits.
288
+ ;;
222
289
[iI][oO][12]) # If answer is io1
223
290
echo -e " Enter Provisioned IOPS:"
224
291
read volumeIOPS
0 commit comments