Skip to content

Commit 3a30b9e

Browse files
committed
Enriched the init script and added support for three VPC zones
1 parent e54a9f8 commit 3a30b9e

File tree

2 files changed

+191
-44
lines changed

2 files changed

+191
-44
lines changed

serverless-fleets/common.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ function check_prerequisites {
3030
print_error "'jq' tool is not installed"
3131
exit 1
3232
fi
33+
34+
# Ensure that uuidgen tool is installed
35+
if ! command -v uuidgen &>/dev/null; then
36+
print_error "'uuidgen' tool is not installed"
37+
exit 1
38+
fi
3339
}
3440

3541
# ==============================

serverless-fleets/init-fleet-sandbox

Lines changed: 185 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#!/bin/bash
22

3+
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
4+
source ${SCRIPT_DIR}/common.sh
5+
6+
print_msg "\nChecking prerequisites ..."
7+
check_prerequisites
8+
39
# Env vars
410
CLEANUP_ON_ERROR=${CLEANUP_ON_ERROR:=false}
511
CLEANUP_ON_SUCCESS=${CLEANUP_ON_SUCCESS:=false}
@@ -8,6 +14,7 @@ NAME_PREFIX="${NAME_PREFIX:=ce-fleet-sandbox}"
814
SETUP_LOGGING="${SETUP_LOGGING:-true}"
915
SETUP_MONITORING="${SETUP_MONITORING:-true}"
1016

17+
IPS_PER_SUBNET=${IPS_PER_SUBNET:=1024}
1118

1219
# Generate a short uuid for some resources
1320
uuid=$(uuidgen | tr '[:upper:]' '[:lower:]' | awk -F- '{print $1}')
@@ -16,13 +23,17 @@ uuid=$(uuidgen | tr '[:upper:]' '[:lower:]' | awk -F- '{print $1}')
1623
resource_group_name="${NAME_PREFIX}--rg"
1724
ce_project_name="${NAME_PREFIX}--ce-project"
1825
vpc_name="${NAME_PREFIX}--is-vpc"
19-
apikey_name="${NAME_PREFIX}--apikey"
2026
sshkey_name="${NAME_PREFIX}--sshkey"
2127
cos_name="${NAME_PREFIX}--cos"
2228
cos_bucket_name_taskstore="${NAME_PREFIX}-taskstore-${uuid}"
2329
cos_bucket_name_input="${NAME_PREFIX}-input-${uuid}"
2430
cos_bucket_name_output="${NAME_PREFIX}-output-${uuid}"
2531

32+
vpegw_icr=${NAME_PREFIX}--is-vpegw-icr
33+
vpegw_cos=${NAME_PREFIX}--is-vpegw-cos
34+
vpegw_icl=${NAME_PREFIX}--is-vpegw-icl
35+
vpegw_monitoring=${NAME_PREFIX}--is-vpegw-monitoring
36+
2637
cos_key_name="${NAME_PREFIX}--cos-key"
2738
icl_name="${NAME_PREFIX}--icl"
2839
sysdig_name="${NAME_PREFIX}--sysdig"
@@ -32,9 +43,6 @@ sysdig_key_name="${NAME_PREFIX}--sysdig-key"
3243
# COMMON FUNCTIONS
3344
# ==============================
3445

35-
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
36-
source ${SCRIPT_DIR}/common.sh
37-
3846
# Clean up previous run
3947
function clean() {
4048
(
@@ -44,23 +52,34 @@ function clean() {
4452
rm -rf .rclone_${resource_group_name}.conf
4553

4654
if [[ "$SETUP_MONITORING" == "true" ]]; then
55+
ibmcloud is endpoint-gateway-delete ${sysdig_name}-vpegw --force 2>/dev/null
56+
ibmcloud is endpoint-gateway-delete ${vpegw_monitoring} --force 2>/dev/null
4757
ibmcloud resource service-key-delete ${sysdig_key_name} -f -q 2>/dev/null
4858
ibmcloud resource service-instance-delete ${sysdig_name} -g ${resource_group_name} -f -q 2>/dev/null
49-
ibmcloud is endpoint-gateway-delete ${sysdig_name}-vpegw --force 2>/dev/null
5059
fi
5160

5261
if [[ "$SETUP_LOGGING" == "true" ]]; then
5362
ibmcloud iam service-id-delete "${icl_name}-svc-id" -f 2>/dev/null
5463
ibmcloud is endpoint-gateway-delete "${icl_name}-vpegw" --force 2>/dev/null
64+
ibmcloud is endpoint-gateway-delete ${vpegw_icl} --force 2>/dev/null
5565
ibmcloud resource service-instance-delete "$icl_name" -g ${resource_group_name} -f -q 2>/dev/null
5666
fi
5767

58-
ibmcloud iam api-key-delete ${apikey_name} --force 2>/dev/null
68+
ibmcloud is endpoint-gateway-delete "${vpegw_icr}" --force 2>/dev/null
69+
ibmcloud is endpoint-gateway-delete "${vpegw_cos}" --force 2>/dev/null
5970

6071
ibmcloud is key-delete ${sshkey_name} --force 2>/dev/null
72+
73+
# START Remove old legacy components
74+
ibmcloud is subnet-public-gateway-detach $vpc_name-subnet --force 2>/dev/null
6175
ibmcloud is subnet-delete $vpc_name-subnet --force 2>/dev/null
62-
ibmcloud is network-acl-delete $vpc_name-acl --force 2>/dev/null
6376
ibmcloud is public-gateway-delete $vpc_name-gateway --force 2>/dev/null
77+
# END Remove old legacy components
78+
79+
ibmcloud is subnet-delete $vpc_name-subnet-1 --force 2>/dev/null
80+
ibmcloud is subnet-delete $vpc_name-subnet-2 --force 2>/dev/null
81+
ibmcloud is subnet-delete $vpc_name-subnet-3 --force 2>/dev/null
82+
ibmcloud is network-acl-delete $vpc_name-acl --force 2>/dev/null
6483
ibmcloud is security-group-delete $vpc_name-group --force 2>/dev/null
6584
ibmcloud is vpc-delete $vpc_name --force 2>/dev/null
6685
while [ $? == 0 ]; do
@@ -95,6 +114,9 @@ function clean() {
95114
fi
96115

97116
ibmcloud resource group-delete $resource_group_name --force 2>/dev/null
117+
118+
# In case this cleanup script hasn't been executed for a while, delete artifacts that are not longer relevant
119+
ibmcloud iam api-key-delete "${NAME_PREFIX}--apikey" --force 2>/dev/null
98120
)
99121
}
100122

@@ -109,8 +131,6 @@ function abortScript() {
109131
exit 1
110132
}
111133

112-
113-
114134
if [[ "$1" == "clean" ]]; then
115135
print_msg "\nCleaning up the created IBM Cloud resources ..."
116136
clean
@@ -145,9 +165,6 @@ fi
145165
echo ""
146166
echo "Please note: This script will install various IBM Cloud resources within the resource group '$resource_group_name'."
147167

148-
print_msg "\nChecking prerequisites ..."
149-
check_prerequisites
150-
151168

152169
# Ensure that latest versions of used IBM Cloud ClI is installed
153170
print_msg "\nPulling latest IBM Cloud CLI release ..."
@@ -190,6 +207,7 @@ else
190207
icl_guid=$(echo "$icl_instance"|jq -r '.[0].guid')
191208
icl_crn=$(echo "$icl_instance"|jq -r '.[0].crn')
192209
icl_ingestion_host=$(echo "$icl_instance"|jq -r '.[0].extensions.external_ingress_private')
210+
icl_ingestion_host_public=$(echo "$icl_instance"|jq -r '.[0].extensions.external_ingress')
193211
icl_dashboard_url=$(echo "$icl_instance"|jq -r '.[0].dashboard_url')
194212

195213
if ! does_serviceid_exist "${icl_name}-svc-id"; then
@@ -210,6 +228,44 @@ else
210228
abortScript
211229
fi
212230
fi
231+
232+
print_msg "\nSetting up S2S policy to allow logs-router to send logs to ICL ..."
233+
s2s_authorization=$(ibmcloud iam authorization-policies -o JSON|jq -r '.[]|select((.resources[].attributes[].value=="logs") and (.roles[].display_name=="Sender") and (.subjects[].attributes[].value=="logs-router"))|.id')
234+
if [[ "$s2s_authorization" != "" ]]; then
235+
echo "Already set!"
236+
else
237+
ibmcloud iam authorization-policy-create logs-router logs Sender
238+
if [ $? -ne 0 ]; then
239+
print_error "Creation of IAM S2S policy to enable logs router failed!"
240+
abortScript
241+
fi
242+
fi
243+
244+
print_msg "\nSetting up platform logs instance for logs in $REGION ..."
245+
IAM_TOKEN=`ibmcloud iam oauth-tokens --output json | jq -r '.iam_token'`
246+
tenants=$(curl -H "Content-Type: application/json" --silent -H "Authorization: ${IAM_TOKEN}" -H 'IBM-API-Version: 2025-03-01' -X GET https://management.$REGION.logs-router.cloud.ibm.com:443/v1/tenants)
247+
if (( $(echo "$tenants" | jq '.tenants|length') > 0 )); then
248+
echo "Platform logging instance is already set!"
249+
else
250+
uuid=$(uuidgen | tr '[:upper:]' '[:lower:]' | awk -F- '{print $1}')
251+
curl -H "Content-Type: application/json" -H "Authorization: ${IAM_TOKEN}" -H 'IBM-API-Version: 2025-03-01' --data "{
252+
\"name\": \"${REGION}-tenant-${uuid}\",
253+
\"targets\": [
254+
{
255+
\"log_sink_crn\": \"${icl_crn}\",
256+
\"name\": \"target-${uuid}\",
257+
\"parameters\": {
258+
\"host\": \"${icl_ingestion_host_public}\",
259+
\"port\": 443
260+
}
261+
}
262+
]
263+
}" -X POST https://management.$REGION.logs-router.cloud.ibm.com:443/v1/tenants
264+
if [ $? -ne 0 ]; then
265+
print_error "Failed to configure logs routing!"
266+
abortScript
267+
fi
268+
fi
213269
fi
214270

215271

@@ -272,17 +328,6 @@ if ! ibmcloud is vpc $vpc_name >/dev/null 2>&1; then
272328
echo "VPC '$vpc_name' is now available, now!"
273329
fi
274330

275-
#
276-
# Create the Public gateway
277-
if ! ibmcloud is public-gateway $vpc_name-gateway $vpc_name >/dev/null 2>&1; then
278-
print_msg "\nCreating the VPC Public gateway '$vpc_name-gateway' ..."
279-
ibmcloud is public-gateway-create $vpc_name-gateway $vpc_name $REGION-1 --resource-group-name $resource_group_name
280-
if [ $? -ne 0 ]; then
281-
print_error "VPC Public gateway creation failed!"
282-
abortScript
283-
fi
284-
fi
285-
286331
#
287332
# Create the Network ACL
288333
if ! ibmcloud is network-acl $vpc_name-acl $vpc_name >/dev/null 2>&1; then
@@ -295,16 +340,65 @@ if ! ibmcloud is network-acl $vpc_name-acl $vpc_name >/dev/null 2>&1; then
295340
fi
296341

297342
#
298-
# Create the VPC subnet
299-
if ! ibmcloud is subnet $vpc_name-subnet $vpc_name >/dev/null 2>&1; then
300-
print_msg "\nCreating the VPC Subnet '$vpc_name-subnet' ..."
301-
ibmcloud is subnet-create $vpc_name-subnet $vpc_name --zone $REGION-1 --resource-group-name $resource_group_name --ipv4-address-count 256 --pgw $vpc_name-gateway --acl $vpc_name-acl
302-
if [ $? -ne 0 ]; then
303-
print_error "VPC Subnet creation failed!"
304-
abortScript
305-
fi
343+
# Cleanup the old single-zone subnet and public gateway
344+
print_msg "\nCleanup old VPC components from previous versions of this script"
345+
if ibmcloud is subnet-public-gateway $vpc_name-subnet >/dev/null 2>&1; then
346+
ibmcloud is subnet-public-gateway-detach $vpc_name-subnet --force 2>/dev/null
347+
fi
348+
if ibmcloud is public-gateway $vpc_name-gateway >/dev/null 2>&1; then
349+
ibmcloud is public-gateway-delete $vpc_name-gateway --force 2>/dev/null
350+
fi
351+
if ibmcloud is endpoint-gateway "${icl_name}-vpegw" --vpc $vpc_name >/dev/null 2>&1; then
352+
ibmcloud is endpoint-gateway-delete "${icl_name}-vpegw" --force 2>/dev/null
306353
fi
354+
if ibmcloud is endpoint-gateway "${sysdig_name}-vpegw" --vpc $vpc_name >/dev/null 2>&1; then
355+
ibmcloud is endpoint-gateway-delete "${sysdig_name}-vpegw" --force 2>/dev/null
356+
fi
357+
if ibmcloud is subnet $vpc_name-subnet $vpc_name >/dev/null 2>&1; then
358+
ibmcloud is subnet-delete $vpc_name-subnet --force 2>/dev/null
359+
fi
360+
361+
#
362+
# Create the VPC subnet(s)
363+
for i in {1..3}
364+
do
365+
if ! ibmcloud is subnet $vpc_name-subnet-$i $vpc_name >/dev/null 2>&1; then
366+
print_msg "\nCreating the VPC Subnet '$vpc_name-subnet-$i' ..."
367+
ibmcloud is subnet-create $vpc_name-subnet-$i $vpc_name --zone $REGION-$i --resource-group-name $resource_group_name --ipv4-address-count $IPS_PER_SUBNET --acl $vpc_name-acl
368+
if [ $? -ne 0 ]; then
369+
print_error "VPC Subnet creation failed!"
370+
abortScript
371+
fi
372+
fi
373+
374+
#
375+
# Create a public gateway in all three zones
376+
if ! ibmcloud is public-gateway $vpc_name-gateway-$i $vpc_name >/dev/null 2>&1; then
377+
print_msg "\nCreating the VPC Public gateway '$vpc_name-gateway-$i' ..."
378+
ibmcloud is public-gateway-create $vpc_name-gateway-$i $vpc_name $REGION-$i --resource-group-name $resource_group_name
379+
if [ $? -ne 0 ]; then
380+
print_error "VPC Public gateway in zone $i creation failed!"
381+
abortScript
382+
fi
383+
fi
307384

385+
#
386+
# Attach a public gateway to all three subnets
387+
if ! ibmcloud is subnet-public-gateway $vpc_name-subnet-$i >/dev/null 2>&1; then
388+
print_msg "\nAttaching the Public gateway '$vpc_name-gateway-$i' to subnet '$vpc_name-subnet-$i' ..."
389+
ibmcloud is subnet-public-gateway-attach $vpc_name-subnet-$i --pgw $vpc_name-gateway-$i
390+
if [ $? -ne 0 ]; then
391+
print_error "Attaching a public gateway to the subnet $vpc_name-subnet-$i failed!"
392+
abortScript
393+
fi
394+
fi
395+
done
396+
397+
subnet_id_1=$(ibmcloud is subnet $vpc_name-subnet-1 --vpc $vpc_name --output JSON | jq -r '.id')
398+
subnet_id_2=$(ibmcloud is subnet $vpc_name-subnet-2 --vpc $vpc_name --output JSON | jq -r '.id')
399+
subnet_id_3=$(ibmcloud is subnet $vpc_name-subnet-3 --vpc $vpc_name --output JSON | jq -r '.id')
400+
401+
#
308402
# Create the security group and its rules
309403
if ! ibmcloud is security-group $vpc_name-group $vpc_name >/dev/null 2>&1; then
310404
print_msg "\nCreating the VPC Security group '$vpc_name-group' ..."
@@ -316,26 +410,69 @@ if ! ibmcloud is security-group $vpc_name-group $vpc_name >/dev/null 2>&1; then
316410

317411
print_msg "\nCreating required VPC Security group rules ..."
318412
ibmcloud is security-group-rule-add $vpc_name-group outbound all --remote 0.0.0.0/0 --vpc $vpc_name >/dev/null
413+
ibmcloud is security-group-rule-add $vpc_name-group outbound all --remote 161.26.0.0/16 --vpc $vpc_name >/dev/null
414+
ibmcloud is security-group-rule-add $vpc_name-group outbound all --remote 166.8.0.0/14 --vpc $vpc_name >/dev/null
415+
ibmcloud is security-group-rule-add $vpc_name-group outbound all --remote $vpc_name-group --vpc $vpc_name >/dev/null
319416
ibmcloud is security-group-rule-add $vpc_name-group inbound all --remote $vpc_name-group --vpc $vpc_name >/dev/null
320417
echo "Done"
321418

322419
print_msg "\nPrinting the VPC Security group '$vpc_name-group' ..."
323420
ibmcloud is security-group $vpc_name-group
324421
fi
325422

423+
#
424+
# Creating the VPE Gateway for ICR
425+
if ! ibmcloud is endpoint-gateway "$vpegw_icr" --vpc $vpc_name >/dev/null 2>&1; then
426+
ibmcloud cr region-set $REGION
427+
registry_endpoint=$(ibmcloud cr info|grep -m 1 "Container Registry"|awk '{print $3}')
428+
print_msg "\nCreating a VPE Gateway to enable Image pulls from ICR (endpoint: ${registry_endpoint})..."
429+
ibmcloud is endpoint-gateway-create \
430+
--vpc $vpc_name \
431+
--sg $vpc_name-group \
432+
--target "crn:v1:bluemix:public:container-registry:$REGION:::endpoint:${registry_endpoint}" \
433+
--name "$vpegw_icr" \
434+
--new-reserved-ip "{\"subnet\": {\"id\": \"${subnet_id_1}\"},\"name\":\"${vpegw_icr}-ip-1\",\"auto_delete\":true}" \
435+
--new-reserved-ip "{\"subnet\": {\"id\": \"${subnet_id_2}\"},\"name\":\"${vpegw_icr}-ip-2\",\"auto_delete\":true}" \
436+
--new-reserved-ip "{\"subnet\": {\"id\": \"${subnet_id_3}\"},\"name\":\"${vpegw_icr}-ip-3\",\"auto_delete\":true}" \
437+
--allow-dns-resolution-binding false
438+
if [ $? -ne 0 ]; then
439+
print_error "ICR VPE Gateway creation failed!"
440+
abortScript
441+
fi
442+
fi
443+
444+
#
445+
# Creating the VPE Gateway for COS
446+
if ! ibmcloud is endpoint-gateway "$vpegw_cos" --vpc $vpc_name >/dev/null 2>&1; then
447+
print_msg "\nCreating a VPE Gateway to access COS ..."
448+
ibmcloud is endpoint-gateway-create \
449+
--vpc $vpc_name \
450+
--sg $vpc_name-group \
451+
--target "crn:v1:bluemix:public:cloud-object-storage:global:::endpoint:s3.direct.$REGION.cloud-object-storage.appdomain.cloud" \
452+
--name "$vpegw_cos" \
453+
--new-reserved-ip "{\"subnet\": {\"id\": \"${subnet_id_1}\"},\"name\":\"${vpegw_cos}-ip-1\",\"auto_delete\":true}" \
454+
--new-reserved-ip "{\"subnet\": {\"id\": \"${subnet_id_2}\"},\"name\":\"${vpegw_cos}-ip-2\",\"auto_delete\":true}" \
455+
--new-reserved-ip "{\"subnet\": {\"id\": \"${subnet_id_3}\"},\"name\":\"${vpegw_cos}-ip-3\",\"auto_delete\":true}" \
456+
--allow-dns-resolution-binding false
457+
if [ $? -ne 0 ]; then
458+
print_error "COS VPE Gateway creation failed!"
459+
abortScript
460+
fi
461+
fi
462+
326463
#
327464
# Creating the VPE Gateway to enable log ingestion
328465
if [[ "$SETUP_LOGGING" == "true" ]]; then
329-
if ! ibmcloud is endpoint-gateway "${icl_name}-vpegw" --vpc $vpc_name >/dev/null 2>&1; then
466+
if ! ibmcloud is endpoint-gateway "${vpegw_icl}" --vpc $vpc_name >/dev/null 2>&1; then
330467
print_msg "\nCreating a VPE Gateway to enable log ingestion ..."
331-
subnet_id=$(ibmcloud is subnet $vpc_name-subnet --vpc $vpc_name --output JSON | jq -r '.id')
332468
ibmcloud is endpoint-gateway-create \
333469
--vpc $vpc_name \
334-
--subnet $vpc_name-subnet \
335470
--sg $vpc_name-group \
336471
--target ${icl_crn} \
337-
--name "${icl_name}-vpegw" \
338-
--new-reserved-ip "{\"subnet\": {\"id\": \"${subnet_id}\"},\"name\":\"${icl_name}-vpegw-ip\",\"auto_delete\":false}" \
472+
--name "${vpegw_icl}" \
473+
--new-reserved-ip "{\"subnet\": {\"id\": \"${subnet_id_1}\"},\"name\":\"${vpegw_icl}-ip-1\",\"auto_delete\":true}" \
474+
--new-reserved-ip "{\"subnet\": {\"id\": \"${subnet_id_2}\"},\"name\":\"${vpegw_icl}-ip-2\",\"auto_delete\":true}" \
475+
--new-reserved-ip "{\"subnet\": {\"id\": \"${subnet_id_3}\"},\"name\":\"${vpegw_icl}-ip-3\",\"auto_delete\":true}" \
339476
--allow-dns-resolution-binding false
340477
if [ $? -ne 0 ]; then
341478
print_error "ICL VPE Gateway creation failed!"
@@ -345,16 +482,16 @@ if [[ "$SETUP_LOGGING" == "true" ]]; then
345482
fi
346483

347484
if [[ "$SETUP_MONITORING" == "true" ]]; then
348-
if ! ibmcloud is endpoint-gateway "${sysdig_name}-vpegw" --vpc $vpc_name >/dev/null 2>&1; then
485+
if ! ibmcloud is endpoint-gateway "${vpegw_monitoring}" --vpc $vpc_name >/dev/null 2>&1; then
349486
print_msg "\nCreating a VPE Gateway to enable monitoring ingestion ..."
350-
subnet_id=$(ibmcloud is subnet $vpc_name-subnet --vpc $vpc_name --output JSON | jq -r '.id')
351487
ibmcloud is endpoint-gateway-create \
352488
--vpc $vpc_name \
353-
--subnet $vpc_name-subnet \
354489
--sg $vpc_name-group \
355490
--target ${sysdig_crn} \
356-
--name "${sysdig_name}-vpegw" \
357-
--new-reserved-ip "{\"subnet\": {\"id\": \"${subnet_id}\"},\"name\":\"${sysdig_name}-vpegw-ip\",\"auto_delete\":false}" \
491+
--name "${vpegw_sysdig}" \
492+
--new-reserved-ip "{\"subnet\": {\"id\": \"${subnet_id_1}\"},\"name\":\"${vpegw_monitoring}-ip-1\",\"auto_delete\":true}" \
493+
--new-reserved-ip "{\"subnet\": {\"id\": \"${subnet_id_2}\"},\"name\":\"${vpegw_monitoring}-ip-2\",\"auto_delete\":true}" \
494+
--new-reserved-ip "{\"subnet\": {\"id\": \"${subnet_id_3}\"},\"name\":\"${vpegw_monitoring}-ip-3\",\"auto_delete\":true}" \
358495
--allow-dns-resolution-binding false
359496
if [ $? -ne 0 ]; then
360497
print_error "Monitoring VPE Gateway creation failed!"
@@ -456,7 +593,6 @@ registry_secret_ref=$(echo $icr_integration|jq -r '.secret_ref')
456593
registry_server=$(echo $icr_integration|jq -r '.server')
457594
echo "Registry secret '$registry_secret_ref' for images hosted on '$registry_server' has been created"
458595

459-
## walk
460596
print_msg "\nCreating a Code Engine Persistant Data Store 'fleet-cos-secret' to access the COS bucket as the task state store ..."
461597
create_or_update=update
462598
if ! ibmcloud ce secret get --name fleet-cos-secret >/dev/null 2>&1; then
@@ -493,9 +629,14 @@ create_or_update=update
493629
if ! ibmcloud ce secret get --name codeengine-fleet-defaults >/dev/null 2>&1; then
494630
create_or_update=create
495631
fi
632+
security_group_crn="$(ibmcloud is security-group ${vpc_name}-group --output json | jq -r '.crn')"
496633
ibmcloud ce secret $create_or_update -n codeengine-fleet-defaults \
497-
--from-literal pool_subnet_crn_1="$(ibmcloud is subnet ${vpc_name}-subnet --output json | jq -r '.crn')" \
498-
--from-literal pool_security_group_crns_1="$(ibmcloud is security-group ${vpc_name}-group --output json | jq -r '.crn')"
634+
--from-literal pool_subnet_crn_1="$(ibmcloud is subnet ${vpc_name}-subnet-1 --output json | jq -r '.crn')" \
635+
--from-literal pool_security_group_crns_1="${security_group_crn}" \
636+
--from-literal pool_subnet_crn_2="$(ibmcloud is subnet ${vpc_name}-subnet-2 --output json | jq -r '.crn')" \
637+
--from-literal pool_security_group_crns_2="${security_group_crn}" \
638+
--from-literal pool_subnet_crn_3="$(ibmcloud is subnet ${vpc_name}-subnet-3 --output json | jq -r '.crn')" \
639+
--from-literal pool_security_group_crns_3="${security_group_crn}"
499640

500641
if [[ "$SETUP_LOGGING" == "true" && "$icl_ingestion_apikey" != "" ]]; then
501642
print_msg "\nMake sure logs are sent to '${icl_ingestion_host}' ..."

0 commit comments

Comments
 (0)