1818
1919# Important: CDK global version number
2020# This controls the CDK and AWS Solutions Constructs version. Solutions
21- # Constructs versions map 1:1 to CDK versions. When setting this value,
21+ # Constructs versions map 1:1 to CDK versions. When setting this value,
2222# choose the latest AWS Solutions Constructs version.
23- required_cdk_version=1.132 .0
23+ required_cdk_version=1.155 .0
2424
2525# Get reference for all important folders
2626template_dir=" $PWD "
7474 b ) bucket=${OPTARG} ;;
7575 v ) version=${OPTARG} ;;
7676 t ) devtest=1;;
77- c)
77+ c)
7878 clean
7979 exit 0
8080 ;;
8181 * )
8282 echo " Usage: $0 -b <bucket> [-v <version>] [-t]"
83- echo " Version must be provided via a parameter or ../version.txt. Others are optional."
83+ echo " Version must be provided via a parameter or ../version.txt. Others are optional."
8484 echo " -t indicates this is a pre-prod build and instructs the build to use a non-prod Solution ID, DEV-SOxxxx"
8585 echo " Production example: ./build-s3-dist.sh -b solutions -v v1.0.0"
86- echo " Dev example: ./build-s3-dist.sh -b solutions -v v1.0.0 -t"
87- exit 1
86+ echo " Dev example: ./build-s3-dist.sh -b solutions -v v1.0.0 -t"
87+ exit 1
8888 ;;
8989 esac
9090done
9191
9292# ------------------------------------------------------------------------------
9393# DISABLE OVERRIDE WARNINGS
9494# ------------------------------------------------------------------------------
95- # Use with care: disables the warning for overridden properties on
95+ # Use with care: disables the warning for overridden properties on
9696# AWS Solutions Constructs
9797export overrideWarningsEnabled=false
9898
@@ -127,7 +127,7 @@ echo "export DIST_VERSION=$version" >> ./setenv.sh
127127#
128128# It takes precedence over the command line (oddly backwards, but to prevent
129129# errors)
130- #
130+ #
131131# Ex:
132132# #!/bin/bash
133133# SOLUTION_ID='SO0111'
162162if [[ -z " $SOLUTION_TRADEMARKEDNAME " ]]; then
163163 echo " SOLUTION_TRADEMARKEDNAME is missing from ../solution_env.sh"
164164 exit 1
165- else
165+ else
166166 export SOLUTION_TRADEMARKEDNAME
167167 echo " export DIST_SOLUTION_NAME=$SOLUTION_TRADEMARKEDNAME " >> ./setenv.sh
168168fi
@@ -196,7 +196,7 @@ export PATH=$(npm bin):$PATH
196196# Check cdk version
197197cdkver=` cdk --version | grep -Eo ' ^[0-9]{1,2}\.[0-9]+\.[0-9]+' `
198198echo CDK version $cdkver
199- if [[ $cdkver != $required_cdk_version ]]; then
199+ if [[ $cdkver != $required_cdk_version ]]; then
200200 echo Required CDK version is $required_cdk_version , found $cdkver
201201 exit 255
202202fi
@@ -215,10 +215,19 @@ find . -name package-lock.json | while read file;do rm $file; done
215215
216216mkdir -p $temp_work_dir /source/solution_deploy/lambdalayer/python
217217cp ${template_dir} /${source_dir} /LambdaLayers/* .py $temp_work_dir /source/solution_deploy/lambdalayer/python
218- pip install -r $template_dir /requirements.txt -t $temp_work_dir /source/solution_deploy/lambdalayer/python
218+ do_cmd pip install -r $template_dir /requirements.txt -t $temp_work_dir /source/solution_deploy/lambdalayer/python
219219cd $temp_work_dir /source/solution_deploy/lambdalayer
220220zip --recurse-paths ${build_dist_dir} /lambda/layer.zip python
221221
222+ echo " ------------------------------------------------------------------------------"
223+ echo " [Pack] Member Stack Lambda Layer (used by custom resources)"
224+ echo " ------------------------------------------------------------------------------"
225+ do_cmd mkdir -p $temp_work_dir /source/solution_deploy/memberlambdalayer/python
226+ do_cmd cp ${template_dir} /${source_dir} /LambdaLayers/cfnresponse.py $temp_work_dir /source/solution_deploy/memberlambdalayer/python
227+ do_cmd cp ${template_dir} /${source_dir} /LambdaLayers/logger.py $temp_work_dir /source/solution_deploy/memberlambdalayer/python
228+ do_cmd cd $temp_work_dir /source/solution_deploy/memberlambdalayer
229+ do_cmd zip --recurse-paths ${build_dist_dir} /lambda/memberLayer.zip python
230+
222231echo " ------------------------------------------------------------------------------"
223232echo " [Pack] Custom Action Lambda"
224233echo " ------------------------------------------------------------------------------"
@@ -229,12 +238,18 @@ zip ${build_dist_dir}/lambda/createCustomAction.py.zip createCustomAction.py
229238# These are not packaged with the Lambda
230239do_cmd cp ../../LambdaLayers/* .py .
231240
241+ echo " ------------------------------------------------------------------------------"
242+ echo " [Pack] Updatable Runbook Provider Lambda"
243+ echo " ------------------------------------------------------------------------------"
244+ do_cmd cd $temp_work_dir /source/solution_deploy/source
245+ do_cmd zip ${build_dist_dir} /lambda/updatableRunbookProvider.py.zip updatableRunbookProvider.py
246+
232247echo " ------------------------------------------------------------------------------"
233248echo " [Pack] Orchestrator Lambdas"
234249echo " ------------------------------------------------------------------------------"
235250# cd $template_dir
236251cd $temp_work_dir /source/Orchestrator
237- ls | while read file; do
252+ ls | while read file; do
238253 if [ ! -d $file ]; then
239254 zip ${build_dist_dir} /lambda/${file} .zip ${file}
240255 fi
@@ -247,7 +262,7 @@ echo "--------------------------------------------------------------------------
247262echo " [Create] Playbooks"
248263echo " ------------------------------------------------------------------------------"
249264for playbook in ` ls ${template_dir} /${source_dir} /playbooks` ; do
250- if [ $playbook == ' NEWPLAYBOOK' ] || [ $playbook == ' .coverage' ]; then
265+ if [ $playbook == ' NEWPLAYBOOK' ] || [ $playbook == ' .coverage' ] || [ $playbook == ' common ' ] ; then
251266 continue
252267 fi
253268 echo Create $playbook playbook
0 commit comments