File tree Expand file tree Collapse file tree 5 files changed +59
-34
lines changed
Expand file tree Collapse file tree 5 files changed +59
-34
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11set -e
22
3- python ./deploy.py
3+ LAYER_NAME="parameter-store-extension"
4+
5+ REGIONS=(
6+ ap-northeast-1
7+ ap-northeast-2
8+ ap-south-1
9+ ap-southeast-1
10+ ap-southeast-2
11+ ca-central-1
12+ eu-central-1
13+ eu-west-1
14+ eu-west-2
15+ eu-west-3
16+ sa-east-1
17+ us-east-1
18+ us-east-2
19+ us-west-1
20+ us-west-2
21+ )
22+
23+ GIT_TAG=$1
24+ if [ -z $GIT_TAG ]
25+ then
26+ echo "empty git tag"
27+ exit 1
28+ fi
29+
30+ if output=$(git status --porcelain --untracked-files=no) && [ -z "$output" ]; then
31+ echo "Tagging ${GIT_TAG}"
32+ else
33+ echo "Working directory is not clean, exiting"
34+ exit 1
35+ fi
36+
37+ MSG="Parameter Store AWS Lambda Extension ${GIT_TAG}"
38+
39+ git tag -a "${GIT_TAG}" -m "${MSG}"
40+ git push --follow-tags origin ${GIT_TAG}
41+
42+ for region in "${REGIONS[@]}"; do
43+ echo "Publishing Parameter Store Lambda layer to ${region}..."
44+ layer_version=$(aws lambda publish-layer-version \
45+ --layer-name $LAYER_NAME \
46+ --zip-file "fileb://extensions.zip" \
47+ --description "${MSG}" \
48+ --region $region \
49+ --output text \
50+ --query Version)
51+ echo "published Parameter Store Lambda extension layer version ${layer_version} to ${region}"
52+
53+ echo "Setting public permissions for Parameter Store Lambda extension layer version ${layer_version} in ${region}"
54+ output=$(aws lambda add-layer-version-permission \
55+ --layer-name $LAYER_NAME \
56+ --version-number $layer_version \
57+ --statement-id public \
58+ --action lambda:GetLayerVersion \
59+ --principal "*" \
60+ --region $region)
61+ echo "Public permissions set for Parameter Store Lambda extension layer version ${layer_version} in region ${region}"
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments