@@ -101,12 +101,16 @@ jobs:
101101 - name : Create Layer
102102 id : create-layer
103103 run : |
104- LAYER_VERSION=$(aws --region us-gov-east-1 lambda publish-layer-version \
105- --layer-name AWSLambdaPowertoolsTypeScriptV2 \
104+ cat AWSLambdaPowertoolsTypeScriptV2.json | jq '{
105+ "LayerName": "AWSLambdaPowertoolsTypeScriptV2",
106+ "Description": .Description,
107+ "CompatibleRuntimes": .CompatibleRuntimes,
108+ "LicenseInfo": .LicenseInfo
109+ }' > input.json
110+
111+ LAYER_VERSION=$(aws --region us-gov-west-1 lambda publish-layer-version \
106112 --zip-file fileb://./AWSLambdaPowertoolsTypeScriptV2.zip \
107- --compatible-runtimes "$(echo \"$(jq -r '.CompatibleRuntimes | join(" ")' 'AWSLambdaPowertoolsTypeScriptV2.json')\" | sed -e "s/ /\" \"/g")" \
108- --license-info "MIT-0" \
109- --description "$(jq -r '.Description' 'AWSLambdaPowertoolsTypeScriptV2.json')" \
113+ --cli-input-json file://./input.json
110114 --query 'Version' \
111115 --output text)
112116
@@ -125,8 +129,12 @@ jobs:
125129 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:AWSLambdaPowertoolsTypeScriptV2:${{ env.LAYER_VERSION }}' --query 'Content.CodeSha256' --output text)
126130 SHA=$(jq -r '.Content.CodeSha256' 'AWSLambdaPowertoolsTypeScriptV2.json')
127131 test "$REMOTE_SHA" == "$SHA" && echo "SHA OK: ${SHA}" || exit 1
128- 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:AWSLambdaPowertoolsTypeScriptV2:${{ env.LAYER_VERSION }}' --output table
129-
132+ 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:AWSLambdaPowertoolsTypeScriptV2:${{ env.LAYER_VERSION }}' > govcloud.json
133+ echo ::notice::GovCloud Details
134+ cat govcloud.json | jq -r '{"Layer Version Arn": .LayerVersionArn, "Version": .Version, "Description": .Description, "Compatible Runtimes": .CompatibleRuntimes, "SHA": .Content.CodeSha256} | keys[] as $k | [$k, .[$k]] | @tsv' | column -t -s $'\t'
135+ echo ::notice::Commercial Details
136+ cat AWSLambdaPowertoolsTypeScriptV2.json | jq -r '{"Layer Version Arn": .LayerVersionArn, "Version": .Version, "Description": .Description, "Compatible Runtimes": .CompatibleRuntimes, "SHA": .Content.CodeSha256} | keys[] as $k | [$k, .[$k]] | @tsv' | column -t -s $'\t'
137+
130138 copy_west :
131139 name : Copy (West)
132140 needs : download
@@ -158,12 +166,16 @@ jobs:
158166 - name : Create Layer
159167 id : create-layer
160168 run : |
169+ cat AWSLambdaPowertoolsTypeScriptV2.json | jq '{
170+ "LayerName": "AWSLambdaPowertoolsTypeScriptV2",
171+ "Description": .Description,
172+ "CompatibleRuntimes": .CompatibleRuntimes,
173+ "LicenseInfo": .LicenseInfo
174+ }' > input.json
175+
161176 LAYER_VERSION=$(aws --region us-gov-west-1 lambda publish-layer-version \
162- --layer-name AWSLambdaPowertoolsTypeScriptV2 \
163177 --zip-file fileb://./AWSLambdaPowertoolsTypeScriptV2.zip \
164- --compatible-runtimes "$(echo \"$(jq -r '.CompatibleRuntimes | join(" ")' 'AWSLambdaPowertoolsTypeScriptV2.json')\" | sed -e "s/ /\" \"/g")" \
165- --license-info "MIT-0" \
166- --description "$(jq -r '.Description' 'AWSLambdaPowertoolsTypeScriptV2.json')" \
178+ --cli-input-json file://./input.json
167179 --query 'Version' \
168180 --output text)
169181
@@ -182,4 +194,8 @@ jobs:
182194 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:AWSLambdaPowertoolsTypeScriptV2:${{ env.LAYER_VERSION }}' --query 'Content.CodeSha256' --output text)
183195 SHA=$(jq -r '.Content.CodeSha256' 'AWSLambdaPowertoolsTypeScriptV2.json')
184196 test "$REMOTE_SHA" == "$SHA" && echo "SHA OK: ${SHA}" || exit 1
185- 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:AWSLambdaPowertoolsTypeScriptV2:${{ env.LAYER_VERSION }}' --output table
197+ 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:AWSLambdaPowertoolsTypeScriptV2:${{ env.LAYER_VERSION }}' > govcloud.json
198+ echo ::notice::GovCloud Details
199+ cat govcloud.json | jq -r '{"Layer Version Arn": .LayerVersionArn, "Version": .Version, "Description": .Description, "Compatible Runtimes": .CompatibleRuntimes, "SHA": .Content.CodeSha256} | keys[] as $k | [$k, .[$k]] | @tsv' | column -t -s $'\t'
200+ echo ::notice::Commercial Details
201+ cat AWSLambdaPowertoolsTypeScriptV2.json | jq -r '{"Layer Version Arn": .LayerVersionArn, "Version": .Version, "Description": .Description, "Compatible Runtimes": .CompatibleRuntimes, "SHA": .Content.CodeSha256} | keys[] as $k | [$k, .[$k]] | @tsv' | column -t -s $'\t'
0 commit comments