16
16
options :
17
17
- Gamma
18
18
- Prod
19
- default : Gamma
20
19
required : true
21
20
version :
22
21
description : Layer version to duplicate
23
- type : number
22
+ type : string
24
23
required : true
25
24
workflow_call :
26
25
inputs :
27
26
environment :
28
27
description : Deployment environment
29
28
type : string
30
- default : Gamma
31
29
required : true
32
30
version :
33
31
description : Layer version to duplicate
34
- type : number
32
+ type : string
35
33
required : true
36
34
37
35
name : Layer Deployment (GovCloud)
@@ -111,8 +109,8 @@ jobs:
111
109
name : ${{ matrix.layer }}_${{ matrix.arch }}.json
112
110
- name : Verify Layer Signature
113
111
run : |
114
- SHA=$(jq -r '.Content.CodeSha256' ${{ matrix.layer }}_${{ matrix.arch }}.json)
115
- test $(openssl dgst -sha256 -binary ${{ matrix.layer }}_${{ matrix.arch }}.zip | openssl enc -base64) == $SHA && echo "SHA OK: ${SHA}" || exit 1
112
+ SHA=$(jq -r '.Content.CodeSha256' ' ${{ matrix.layer }}_${{ matrix.arch }}.json' )
113
+ test " $(openssl dgst -sha256 -binary ${{ matrix.layer }}_${{ matrix.arch }}.zip | openssl enc -base64)" == " $SHA" && echo "SHA OK: ${SHA}" || exit 1
116
114
- name : Configure AWS Credentials
117
115
uses : aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
118
116
with :
@@ -125,27 +123,29 @@ jobs:
125
123
LAYER_VERSION=$(aws --region us-gov-east-1 lambda publish-layer-version \
126
124
--layer-name ${{ matrix.layer }}-${{ matrix.arch }} \
127
125
--zip-file fileb://./${{ matrix.layer }}_${{ matrix.arch }}.zip \
128
- --compatible-runtimes $(jq -r " .CompatibleRuntimes[0]" ${{ matrix.layer }}_${{ matrix.arch }}.json) \
129
- --compatible-architectures $(jq -r " .CompatibleArchitectures[0]" ${{ matrix.layer }}_${{ matrix.arch }}.json) \
126
+ --compatible-runtimes " $(jq -r ' .CompatibleRuntimes[0]' ' ${{ matrix.layer }}_${{ matrix.arch }}.json')" \
127
+ --compatible-architectures " $(jq -r ' .CompatibleArchitectures[0]' ' ${{ matrix.layer }}_${{ matrix.arch }}.json')" \
130
128
--license-info "MIT-0" \
131
- --description "$(jq -r '.Description' ${{ matrix.layer }}_${{ matrix.arch }}.json)" \
129
+ --description "$(jq -r '.Description' ' ${{ matrix.layer }}_${{ matrix.arch }}.json' )" \
132
130
--query 'Version' \
133
131
--output text)
132
+
134
133
echo "LAYER_VERSION=$LAYER_VERSION" >> "$GITHUB_OUTPUT"
135
134
136
135
aws --region us-gov-east-1 lambda add-layer-version-permission \
137
- --layer-name ${{ matrix.layer }}-${{ matrix.arch }} \
136
+ --layer-name ' ${{ matrix.layer }}-${{ matrix.arch }}' \
138
137
--statement-id 'PublicLayer' \
139
138
--action lambda:GetLayerVersion \
140
139
--principal '*' \
141
- --version-number $LAYER_VERSION
140
+ --version-number " $LAYER_VERSION"
142
141
- name : Verify Layer
143
142
env :
144
143
LAYER_VERSION : ${{ steps.create-layer.outputs.LAYER_VERSION }}
145
144
run : |
146
- REMOTE_SHA=$(aws --region us-gov-east-1 lambda get-layer-version-by-arn --arn arn:aws-us-gov:lambda:us-gov-east-1:${{ secrets.AWS_ACCOUNT_ID }}:layer:${{ matrix.layer }}-${{ matrix.arch }}:${{ env.LAYER_VERSION }} --query 'Content.CodeSha256' --output text)
147
- SHA=$(jq -r '.Content.CodeSha256' ${{ matrix.layer }}_${{ matrix.arch }}.json)
148
- test $REMOTE_SHA == $SHA && echo "SHA OK: ${SHA}" || exit 1
145
+ REMOTE_SHA=$(aws --region us-gov-east-1 lambda get-layer-version-by-arn --arn 'arn:aws-us-gov:lambda:us-gov-east-1:${{ secrets.AWS_ACCOUNT_ID }}:layer:${{ matrix.layer }}-${{ matrix.arch }}:${{ env.LAYER_VERSION }}' --query 'Content.CodeSha256' --output text)
146
+ SHA=$(jq -r '.Content.CodeSha256' '${{ matrix.layer }}_${{ matrix.arch }}.json')
147
+ test "$REMOTE_SHA" == "$SHA "&& echo "SHA OK: ${SHA}" || exit 1
148
+ aws --region us-gov-east-1 lambda get-layer-version-by-arn --arn 'arn:aws-us-gov:lambda:us-gov-east-1:${{ secrets.AWS_ACCOUNT_ID }}:layer:${{ matrix.layer }}-${{ matrix.arch }}:${{ env.LAYER_VERSION }}' --output text
149
149
150
150
copy_west :
151
151
name : Copy (West)
@@ -178,8 +178,8 @@ jobs:
178
178
name : ${{ matrix.layer }}_${{ matrix.arch }}.json
179
179
- name : Verify Layer Signature
180
180
run : |
181
- SHA=$(jq -r '.Content.CodeSha256' ${{ matrix.layer }}_${{ matrix.arch }}.json)
182
- test $(openssl dgst -sha256 -binary ${{ matrix.layer }}_${{ matrix.arch }}.zip | openssl enc -base64) == $SHA && echo "SHA OK: ${SHA}" || exit 1
181
+ SHA=$(jq -r '.Content.CodeSha256' ' ${{ matrix.layer }}_${{ matrix.arch }}.json' )
182
+ test " $(openssl dgst -sha256 -binary ${{ matrix.layer }}_${{ matrix.arch }}.zip | openssl enc -base64)" == " $SHA" && echo "SHA OK: ${SHA}" || exit 1
183
183
- name : Configure AWS Credentials
184
184
uses : aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
185
185
with :
@@ -192,25 +192,26 @@ jobs:
192
192
LAYER_VERSION=$(aws --region us-gov-west-1 lambda publish-layer-version \
193
193
--layer-name ${{ matrix.layer }}-${{ matrix.arch }} \
194
194
--zip-file fileb://./${{ matrix.layer }}_${{ matrix.arch }}.zip \
195
- --compatible-runtimes $(jq -r " .CompatibleRuntimes[0]" ${{ matrix.layer }}_${{ matrix.arch }}.json) \
196
- --compatible-architectures $(jq -r " .CompatibleArchitectures[0]" ${{ matrix.layer }}_${{ matrix.arch }}.json) \
195
+ --compatible-runtimes " $(jq -r ' .CompatibleRuntimes[0]' ' ${{ matrix.layer }}_${{ matrix.arch }}.json')" \
196
+ --compatible-architectures " $(jq -r ' .CompatibleArchitectures[0]' ' ${{ matrix.layer }}_${{ matrix.arch }}.json')" \
197
197
--license-info "MIT-0" \
198
- --description "$(jq -r '.Description' ${{ matrix.layer }}_${{ matrix.arch }}.json)" \
198
+ --description "$(jq -r '.Description' ' ${{ matrix.layer }}_${{ matrix.arch }}.json' )" \
199
199
--query 'Version' \
200
200
--output text)
201
201
202
202
echo "LAYER_VERSION=$LAYER_VERSION" >> "$GITHUB_OUTPUT"
203
203
204
204
aws --region us-gov-west-1 lambda add-layer-version-permission \
205
- --layer-name ${{ matrix.layer }}-${{ matrix.arch }} \
205
+ --layer-name ' ${{ matrix.layer }}-${{ matrix.arch }}' \
206
206
--statement-id 'PublicLayer' \
207
207
--action lambda:GetLayerVersion \
208
208
--principal '*' \
209
- --version-number $LAYER_VERSION
209
+ --version-number " $LAYER_VERSION"
210
210
- name : Verify Layer
211
211
env :
212
212
LAYER_VERSION : ${{ steps.create-layer.outputs.LAYER_VERSION }}
213
213
run : |
214
- REMOTE_SHA=$(aws --region us-gov-west-1 lambda get-layer-version-by-arn --arn arn:aws-us-gov:lambda:us-gov-west-1:${{ secrets.AWS_ACCOUNT_ID }}:layer:${{ matrix.layer }}-${{ matrix.arch }}:${{ env.LAYER_VERSION }} --query 'Content.CodeSha256' --output text)
215
- SHA=$(jq -r '.Content.CodeSha256' ${{ matrix.layer }}_${{ matrix.arch }}.json)
216
- test $REMOTE_SHA == $SHA && echo "SHA OK: ${SHA}" || exit 1
214
+ REMOTE_SHA=$(aws --region us-gov-west-1 lambda get-layer-version-by-arn --arn 'arn:aws-us-gov:lambda:us-gov-west-1:${{ secrets.AWS_ACCOUNT_ID }}:layer:${{ matrix.layer }}-${{ matrix.arch }}:${{ env.LAYER_VERSION }}' --query 'Content.CodeSha256' --output text)
215
+ SHA=$(jq -r '.Content.CodeSha256' '${{ matrix.layer }}_${{ matrix.arch }}.json')
216
+ test "$REMOTE_SHA" == "$SHA "&& echo "SHA OK: ${SHA}" || exit 1
217
+ aws --region us-gov-west-1 lambda get-layer-version-by-arn --arn 'arn:aws-us-gov:lambda:us-gov-west-1:${{ secrets.AWS_ACCOUNT_ID }}:layer:${{ matrix.layer }}-${{ matrix.arch }}:${{ env.LAYER_VERSION }}' --output text
0 commit comments