File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -49,11 +49,13 @@ for REGION in "${AWS_REGIONS[@]}"; do
4949 --action " lambda:GetLayerVersion" \
5050 --principal " *"
5151
52+ LAYER_ARN=" arn:aws:lambda:${REGION} :${AWS_ACCOUNT_ID} :layer:${LAYER_NAME} :${LAYER_VERSION} "
53+
5254 echo " Lambda layer is now publicly accessible in region: $REGION !"
53- echo " Layer ARN: arn:aws:lambda: ${REGION} : ${AWS_ACCOUNT_ID} :layer: ${LAYER_NAME} : ${LAYER_VERSION} "
55+ echo " Layer ARN: $LAYER_ARN "
5456
5557 # Store the mapping
56- REGION_LAYER_MAP[" $REGION " ]=" $LAYER_VERSION "
58+ REGION_LAYER_MAP[" $REGION " ]=" $LAYER_ARN "
5759done
5860
5961# Update Lambda layer to Kosli cli mapping in the primary region (e.g., first region in the list)
@@ -70,8 +72,8 @@ aws s3 cp "s3://${S3_BUCKET}/${S3_KEY}" "$TEMP_FILE" --region "$PRIMARY_REGION"
7072# Update the JSON file with mappings for all regions
7173echo " Updating JSON file with new mappings..."
7274for REGION in " ${! REGION_LAYER_MAP[@]} " ; do
73- LAYER_VERSION =${REGION_LAYER_MAP[$REGION]}
74- jq --arg binary " $TAG " --arg region " $REGION " --argjson layer " $LAYER_VERSION " ' .[$binary][$region] = $layer' " $TEMP_FILE " > " ${TEMP_FILE} .tmp" && mv " ${TEMP_FILE} .tmp" " $TEMP_FILE "
75+ LAYER_ARN =${REGION_LAYER_MAP[$REGION]}
76+ jq --arg binary " $TAG " --arg region " $REGION " --arg layer " $LAYER_ARN " ' .[$binary][$region] = $layer' " $TEMP_FILE " > " ${TEMP_FILE} .tmp" && mv " ${TEMP_FILE} .tmp" " $TEMP_FILE "
7577done
7678
7779# Validate the updated JSON file
You can’t perform that action at this time.
0 commit comments