File tree Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Expand file tree Collapse file tree 3 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,10 @@ build:
1010publish :
1111 @$(PWD ) /publish.sh
1212
13+ publish-staging :
14+ @$(PWD ) /publish-staging.sh
15+
1316.PHONY : \
1417 build
15- publish
18+ publish
19+ publish-staging
Original file line number Diff line number Diff line change 1+ #! /bin/bash -e
2+
3+ # AWS Regions
4+ REGIONS=(
5+ " us-west-2"
6+ )
7+ LAYER_NAME=" bash-testing"
8+
9+ for region in ${REGIONS[@]} ; do
10+ echo " Publishing layer to $region ..."
11+
12+ LAYER_ARN=$( aws lambda publish-layer-version --region $region --layer-name $LAYER_NAME --description " Bash in AWS Lambda [https://github.com/gkrizek/bash-lambda-layer]" --compatible-runtimes provided --license MIT --zip-file fileb://export/layer.zip | jq -r .LayerVersionArn)
13+
14+ echo $LAYER_ARN
15+ echo " $region complete for Staging"
16+ echo " "
17+ done
18+
19+ echo " Successfully published to all regions"
Original file line number Diff line number Diff line change @@ -19,12 +19,13 @@ REGIONS=(
1919 " eu-west-3"
2020 " sa-east-1"
2121)
22+ LAYER_NAME=" bash"
2223
2324for region in ${REGIONS[@]} ; do
2425 echo " Publishing layer to $region ..."
2526
26- LAYER_ARN=$( aws lambda publish-layer-version --region $region --layer-name bash --description " Bash in AWS Lambda [https://github.com/gkrizek/bash-lambda-layer]" --compatible-runtimes provided --license MIT --zip-file fileb://export/layer.zip | jq -r .LayerVersionArn)
27- POLICY=$( aws lambda add-layer-version-permission --region $region --layer-name bash --version-number $( echo -n $LAYER_ARN | tail -c 1) --statement-id bash -public --action lambda:GetLayerVersion --principal \* )
27+ LAYER_ARN=$( aws lambda publish-layer-version --region $region --layer-name $LAYER_NAME --description " Bash in AWS Lambda [https://github.com/gkrizek/bash-lambda-layer]" --compatible-runtimes provided --license MIT --zip-file fileb://export/layer.zip | jq -r .LayerVersionArn)
28+ POLICY=$( aws lambda add-layer-version-permission --region $region --layer-name $LAYER_NAME --version-number $( echo -n $LAYER_ARN | tail -c 1) --statement-id $LAYER_NAME -public --action lambda:GetLayerVersion --principal \* )
2829
2930 echo $LAYER_ARN
3031 echo " $region complete"
You can’t perform that action at this time.
0 commit comments