Skip to content

Commit 8a52665

Browse files
author
Joe Snell
committed
cleanup
1 parent 1628d46 commit 8a52665

File tree

5 files changed

+59
-34
lines changed

5 files changed

+59
-34
lines changed

bin/deploy

Lines changed: 0 additions & 3 deletions
This file was deleted.

bin/deploy.py

Lines changed: 0 additions & 5 deletions
This file was deleted.

languages/python/bin/build.sh

Lines changed: 0 additions & 20 deletions
This file was deleted.

languages/python/bin/deploy

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,61 @@
11
set -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}"

languages/python/bin/deploy.py

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)