Skip to content

Commit a56e559

Browse files
authored
Merge branch 'main' into event-handler/response-resolver-logic
2 parents 5da8885 + 9b829f8 commit a56e559

32 files changed

+263
-235
lines changed

.github/scripts/update_layer_arn.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# see .github/workflows/publish_layer.yml
99

1010

11-
# Get the new version number from the first command-line argument
11+
# Get the new layer version from the first command-line argument
1212
new_version=$1
1313
if [ -z "$new_version" ]; then
1414
echo "Usage: $0 <new_version>"

.github/workflows/bootstrap_region.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,6 @@ jobs:
9999
run: go install github.com/aws-powertools/actions/layer-balancer/cmd/balance@29979bc5339bf54f76a11ac36ff67701986bb0f0
100100
- id: run-balance
101101
name: Run Balance
102-
run: balance -read-region us-east-1 -write-region ${{ inputs.region }} -write-role ${{ secrets.BALANCE_ROLE_ARN }} -layer-name AWSLambdaPowertoolsTypeScriptV2 -dry-run=false
102+
env:
103+
BALANCE_ROLE_ARN: ${{ secrets.BALANCE_ROLE_ARN }}
104+
run: balance -read-region us-east-1 -write-region ${{ inputs.region }} -write-role $BALANCE_ROLE_ARN -layer-name AWSLambdaPowertoolsTypeScriptV2 -dry-run=false

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ jobs:
1919
- name: 'Checkout Repository'
2020
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2121
- name: 'Dependency Review'
22-
uses: actions/dependency-review-action@da24556b548a50705dd671f47852072ea4c105d9 # v4.7.1
22+
uses: actions/dependency-review-action@bc41886e18ea39df68b1b1245f4184881938e050 # v4.7.2

.github/workflows/dispatch_analytics.yml

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

.github/workflows/layer_balance.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ jobs:
4040
contents: read
4141
id-token: write
4242
environment: layer-${{ inputs.environment }}
43+
env:
44+
BALANCE_ROLE_ARN: ${{ secrets.BALANCE_ROLE_ARN }}
4345
steps:
4446
- id: credentials
4547
name: AWS Credentials
@@ -62,8 +64,8 @@ jobs:
6264
- id: run-balance-new-region
6365
name: Run Balance
6466
if: ${{ inputs.start_at == '' }}
65-
run: balance -read-region us-east-1 -write-region ${{ inputs.region }} -write-role ${{ secrets.BALANCE_ROLE_ARN }} -layer-name AWSLambdaPowertoolsTypeScriptV2 -dry-run=false
67+
run: balance -read-region us-east-1 -write-region ${{ inputs.region }} -write-role $BALANCE_ROLE_ARN -layer-name AWSLambdaPowertoolsTypeScriptV2 -dry-run=false
6668
- id: run-balance-existing
6769
name: Run Balance (Existing Region)
6870
if: ${{ inputs.start_at != '' }}
69-
run: balance -read-region us-east-1 -start-at ${{ inputs.start_at }} -write-region ${{ inputs.region }} -write-role ${{ secrets.BALANCE_ROLE_ARN }} -layer-name AWSLambdaPowertoolsTypeScriptV2 -dry-run=false
71+
run: balance -read-region us-east-1 -start-at ${{ inputs.start_at }} -write-region ${{ inputs.region }} -write-role $BALANCE_ROLE_ARN -layer-name AWSLambdaPowertoolsTypeScriptV2 -dry-run=false

.github/workflows/layers_partition_verify.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# Partition Layer Verification
22
# ---
33
# This workflow queries the Partition layer info in production only
4+
#
5+
# CodeQL Security Note:
6+
# This workflow uses dynamic secret access via secrets[format(...)] which triggers
7+
# an "Excessive Secrets Exposure" alert. However, this is safe because:
8+
# - Secrets are scoped per environment (China/GovCloud Gamma/Prod)
9+
# - Each job only accesses secrets for its specific partition and region
10+
# - No global secrets array containing mixed credentials (API keys, PEM files, etc.)
11+
# - The secrets object is already minimally scoped to the environment being used
412

513
on:
614
workflow_dispatch:
@@ -102,7 +110,7 @@ jobs:
102110
permissions:
103111
id-token: write
104112
contents: read
105-
# Environment should interperlate as "GovCloud Prod" or "China Beta"
113+
# Environment should interpolate as "GovCloud Prod" or "China Beta"
106114
environment: ${{ inputs.partition }} ${{ inputs.environment }}
107115
strategy:
108116
matrix:
@@ -118,6 +126,7 @@ jobs:
118126
- name: Configure AWS Credentials
119127
uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1
120128
with:
129+
# Dynamic secret access is safe here - secrets are scoped per environment
121130
role-to-assume: ${{ secrets[format('IAM_ROLE_{0}', steps.transform.outputs.CONVERTED_REGION)] }}
122131
aws-region: ${{ matrix.region}}
123132
mask-aws-account-id: true
@@ -129,6 +138,7 @@ jobs:
129138
- name: Verify Layer
130139
run: |
131140
export layer_output='AWSLambdaPowertoolsTypeScriptV2-${{matrix.region}}.json'
141+
# Dynamic secret access is safe here - secrets are scoped per environment
132142
aws --region ${{ matrix.region}} lambda get-layer-version-by-arn --arn "arn:${{ needs.setup.outputs.partition }}:lambda:${{ matrix.region}}:${{ secrets[format('AWS_ACCOUNT_{0}', steps.transform.outputs.CONVERTED_REGION)] }}:layer:AWSLambdaPowertoolsTypeScriptV2:${{ steps.partition_version.outputs.partition_version }}" > $layer_output
133143
REMOTE_SHA=$(jq -r '.Content.CodeSha256' $layer_output)
134144
LOCAL_SHA=$(jq -r '.Content.CodeSha256' AWSLambdaPowertoolsTypeScriptV2.json)

.github/workflows/layers_partitions.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@
1515
# 1. After the `make-release` workflow finishes and the PR for the documentation update gets created, trigger this workflow manually via `workflow_dispatch` with environment, version, and partition inputs for each Gamma and Prod environment in the China and GovCloud partitions
1616
# 2. Monitor deployment progress and verify successful layer publication across all target regions
1717
# 3. Once this workflow is completed, the PR for the documentation update can me merged
18+
#
19+
# CodeQL Security Note:
20+
# This workflow uses dynamic secret access via secrets[format(...)] which triggers
21+
# an "Excessive Secrets Exposure" alert. However, this is safe because:
22+
# - Secrets are scoped per environment (China/GovCloud Gamma/Prod)
23+
# - Each job only accesses secrets for its specific partition and region
24+
# - No global secrets array containing mixed credentials (API keys, PEM files, etc.)
25+
# - The secrets object is already minimally scoped to the environment being used
1826

1927
on:
2028
workflow_dispatch:
@@ -142,6 +150,7 @@ jobs:
142150
- name: Configure AWS Credentials
143151
uses: aws-actions/configure-aws-credentials@7474bc4690e29a8392af63c5b98e7449536d5c3a # v4.3.1
144152
with:
153+
# Dynamic secret access is safe here - secrets are scoped per environment
145154
role-to-assume: ${{ secrets[format('IAM_ROLE_{0}', steps.transform.outputs.CONVERTED_REGION)] }}
146155
aws-region: ${{ matrix.region}}
147156
mask-aws-account-id: true
@@ -175,6 +184,7 @@ jobs:
175184
LAYER_VERSION: ${{ steps.create-layer.outputs.LAYER_VERSION }}
176185
run: |
177186
export layer_output='AWSLambdaPowertoolsTypeScriptV2-${{matrix.region}}.json'
187+
# Dynamic secret access is safe here - secrets are scoped per environment
178188
aws --region ${{ matrix.region}} lambda get-layer-version-by-arn --arn 'arn:${{ needs.setup.outputs.partition }}:lambda:${{ matrix.region}}:${{ secrets[format('AWS_ACCOUNT_{0}', steps.transform.outputs.CONVERTED_REGION)] }}:layer:AWSLambdaPowertoolsTypeScriptV2:${{ env.LAYER_VERSION }}' > $layer_output
179189
REMOTE_SHA=$(jq -r '.Content.CodeSha256' $layer_output)
180190
LOCAL_SHA=$(jq -r '.Content.CodeSha256' AWSLambdaPowertoolsTypeScriptV2.json)

.github/workflows/make-release.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,7 @@ name: Make Release
1717
# 4. Merge the PR created by the `publish_layer` workflow to update the documentation
1818
# 5. Update draft release notes with the latest changes and publish the release on GitHub
1919

20-
on:
21-
workflow_dispatch:
22-
inputs:
23-
layer_documentation_version:
24-
description: "Lambda layer version to be updated in our documentation. e.g. if the current layer number is 3, this value must be 4."
25-
type: string
26-
required: true
20+
on: workflow_dispatch
2721

2822
permissions:
2923
contents: read
@@ -59,8 +53,10 @@ jobs:
5953
node-version: "22"
6054
cache: "npm"
6155
- name: Setup auth tokens
56+
env:
57+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6258
run: |
63-
npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
59+
npm set "//registry.npmjs.org/:_authToken=$NPM_TOKEN"
6460
- name: Setup dependencies
6561
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
6662
- name: Publish to npm
@@ -97,13 +93,15 @@ jobs:
9793
# publish_layer -> reusable_deploy_layer_stack -> reusable_update_layer_arn_docs
9894
publish_layer:
9995
needs: publish-npm
100-
secrets: inherit
96+
secrets:
97+
AWS_LAYERS_BETA_ROLE_ARN: ${{ secrets.AWS_LAYERS_BETA_ROLE_ARN }}
98+
AWS_LAYERS_PROD_ROLE_ARN: ${{ secrets.AWS_LAYERS_PROD_ROLE_ARN }}
99+
TOKEN_GITHUB: ${{ secrets.GITHUB_TOKEN }}
101100
permissions:
102101
id-token: write
103102
contents: write
104103
pages: write
105104
pull-requests: write
106105
uses: ./.github/workflows/publish_layer.yml
107106
with:
108-
latest_published_version: ${{ needs.publish-npm.outputs.RELEASE_VERSION }}
109-
layer_documentation_version: ${{ inputs.layer_documentation_version }}
107+
latest_published_version: ${{ needs.publish-npm.outputs.RELEASE_VERSION }}

.github/workflows/on_doc_merge.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ jobs:
1616
permissions:
1717
id-token: write # trade JWT token for AWS credentials in AWS Docs account
1818
contents: read # read from this repo to publish docs
19-
secrets: inherit
19+
secrets:
20+
AWS_DOCS_ROLE_ARN: ${{ secrets.AWS_DOCS_ROLE_ARN }}
21+
AWS_DOCS_BUCKET: ${{ secrets.AWS_DOCS_BUCKET }}
2022
uses: ./.github/workflows/reusable_publish_docs.yml
2123
with:
2224
version: main

.github/workflows/ossf_scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ jobs:
4343

4444
# Upload the results to GitHub's code scanning dashboard.
4545
- name: "Upload to code-scanning"
46-
uses: github/codeql-action/upload-sarif@96f518a34f7a870018057716cc4d7a5c014bd61c # v3.29.5
46+
uses: github/codeql-action/upload-sarif@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.5
4747
with:
4848
sarif_file: results.sarif

0 commit comments

Comments
 (0)