Skip to content

Commit 62e5baf

Browse files
authored
Merge branch 'main' into feat-3515-idempotency-custom-prefix-key
2 parents b479a08 + 22eda14 commit 62e5baf

File tree

171 files changed

+4491
-2775
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+4491
-2775
lines changed
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# bootstraps new regions
2+
#
3+
# PURPOSE
4+
# Ensures new regions are deployable in future releases
5+
#
6+
# JOB 1 PROCESS
7+
#
8+
# 1. Installs CDK
9+
# 2. Bootstraps region
10+
#
11+
# JOB 2 PROCESS
12+
# 1. Sets up Go
13+
# 2. Installs the balance script
14+
# 3. Runs balance script to copy layers between aws regions
15+
16+
on:
17+
workflow_dispatch:
18+
inputs:
19+
environment:
20+
type: choice
21+
options:
22+
- beta
23+
- prod
24+
description: Deployment environment
25+
region:
26+
type: string
27+
required: true
28+
description: AWS region to bootstrap (i.e. eu-west-1)
29+
30+
name: Region Bootstrap
31+
run-name: Region Bootstrap ${{ inputs.region }}
32+
33+
permissions:
34+
contents: read
35+
36+
jobs:
37+
bootstrap:
38+
name: Bootstrap Region
39+
runs-on: ubuntu-latest
40+
permissions:
41+
contents: read
42+
id-token: write
43+
environment: layer-${{ inputs.environment }}
44+
steps:
45+
- name: checkout
46+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
47+
with:
48+
ref: ${{ github.sha }}
49+
- name: Setup Node.js
50+
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
51+
with:
52+
node-version: "22"
53+
- name: Setup dependencies
54+
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
55+
- id: credentials
56+
name: AWS Credentials
57+
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
58+
with:
59+
aws-region: ${{ inputs.region }}
60+
role-to-assume: ${{ secrets.REGION_IAM_ROLE }}
61+
mask-aws-account-id: true
62+
- id: workdir
63+
name: Create Workdir
64+
run: |
65+
mkdir -p build/project
66+
- id: cdk-project
67+
name: CDK Project
68+
working-directory: build/project
69+
run: |
70+
npx cdk init app --language=typescript
71+
AWS_REGION="${{ inputs.region }}" npx cdk bootstrap
72+
73+
copy_layers:
74+
name: Copy Layers
75+
runs-on: ubuntu-latest
76+
needs: bootstrap
77+
permissions:
78+
contents: read
79+
id-token: write
80+
environment: layer-${{ inputs.environment }}
81+
steps:
82+
- id: credentials
83+
name: AWS Credentials
84+
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
85+
with:
86+
aws-region: us-east-1
87+
role-to-assume: ${{ secrets.REGION_IAM_ROLE }}
88+
mask-aws-account-id: true
89+
- id: go-setup
90+
name: Setup Go
91+
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
92+
with:
93+
go-version: '>=1.23.0'
94+
- id: go-env
95+
name: Go Env
96+
run: go env
97+
- id: go-install-pkg
98+
name: Install
99+
run: go install github.com/aws-powertools/actions/layer-balancer/cmd/balance@29979bc5339bf54f76a11ac36ff67701986bb0f0
100+
- id: run-balance
101+
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

.github/workflows/make-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
run: |
5858
npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
5959
- name: Setup dependencies
60-
uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872
60+
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
6161
- name: Publish to npm
6262
run: |
6363
NPM_CONFIG_PROVENANCE=true npx lerna publish from-package --git-head ${{ github.sha }} --yes

.github/workflows/make-version.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
node-version: "22"
2929
cache: "npm"
3030
- name: Setup dependencies
31-
uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872
31+
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
3232
- name: Version
3333
id: bump-version
3434
run: npx lerna version --conventional-commits --force-publish --no-git-tag-version --no-push --no-commit-hooks --yes

.github/workflows/publish-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
run: |
4848
npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
4949
- name: Setup dependencies
50-
uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872
50+
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
5151
- name: Publish to npm
5252
run: |
5353
NPM_CONFIG_PROVENANCE=true npx lerna publish from-package --force-publish ${{ github.event.input.package }} --git-head ${{ github.sha }} --yes

.github/workflows/publish_layer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
with:
4040
node-version: "22"
4141
- name: Setup dependencies
42-
uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872
42+
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
4343
- name: CDK build
4444
run: npm run cdk -w layers -- synth --context PowertoolsPackageVersion=${{ inputs.latest_published_version }} -o cdk.out
4545
- name: Zip output

.github/workflows/quality_check.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
node-version: ${{ matrix.version }}
4343
cache: "npm"
4444
- name: Setup dependencies
45-
uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872
45+
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
4646
with:
4747
nodeVersion: ${{ matrix.version }}
4848
- name: Linting
@@ -71,7 +71,7 @@ jobs:
7171
node-version: 22
7272
cache: "npm"
7373
- name: Setup dependencies
74-
uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872
74+
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
7575
- name: Run linting
7676
run: npm run lint
7777
- name: Run tests
@@ -89,7 +89,7 @@ jobs:
8989
node-version: 22
9090
cache: "npm"
9191
- name: Setup dependencies
92-
uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872
92+
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
9393
- name: Run linting
9494
run: npm run lint -w layers
9595
- name: Run tests
@@ -107,7 +107,7 @@ jobs:
107107
node-version: 22
108108
cache: "npm"
109109
- name: Setup dependencies
110-
uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872
110+
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
111111
- name: Run linting
112112
run: npm run lint -w examples/snippets
113113
check-docs:
@@ -123,6 +123,6 @@ jobs:
123123
node-version: 22
124124
cache: "npm"
125125
- name: Setup dependencies
126-
uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872
126+
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
127127
- name: Run linting
128128
run: npm run lint:markdown

.github/workflows/reusable-run-linting-check-and-unit-tests.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
"packages/tracer",
5151
"packages/parser",
5252
"packages/parameters",
53+
"packages/validation",
5354
"packages/metrics"
5455
]
5556
fail-fast: false
@@ -62,7 +63,7 @@ jobs:
6263
node-version: ${{ matrix.version }}
6364
cache: "npm"
6465
- name: Setup dependencies
65-
uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872
66+
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
6667
with:
6768
nodeVersion: ${{ matrix.version }}
6869
- name: Linting
@@ -91,7 +92,7 @@ jobs:
9192
node-version: 22
9293
cache: "npm"
9394
- name: Setup dependencies
94-
uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872
95+
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
9596
- name: Run linting
9697
run: npm run lint
9798
- name: Run tests
@@ -109,7 +110,7 @@ jobs:
109110
node-version: 22
110111
cache: "npm"
111112
- name: Setup dependencies
112-
uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872
113+
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
113114
- name: Run linting
114115
run: npm run lint -w layers
115116
- name: Run tests
@@ -127,7 +128,7 @@ jobs:
127128
node-version: 22
128129
cache: "npm"
129130
- name: Setup dependencies
130-
uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872
131+
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
131132
- name: Run linting
132133
run: npm run lint -w examples/snippets
133134
check-docs:
@@ -143,6 +144,6 @@ jobs:
143144
node-version: 22
144145
cache: "npm"
145146
- name: Setup dependencies
146-
uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872
147+
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
147148
- name: Run linting
148149
run: npm run lint:markdown

.github/workflows/reusable_deploy_layer_stack.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
with:
7777
node-version: "22"
7878
- name: Setup dependencies
79-
uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872
79+
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
8080
- name: Download artifact
8181
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
8282
with:

.github/workflows/reusable_publish_docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
node-version: "22"
5858
cache: "npm"
5959
- name: Setup dependencies
60-
uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872
60+
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
6161
- name: Set up Python
6262
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
6363
with:

.github/workflows/run-e2e-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
with:
6060
node-version: '22'
6161
- name: Setup dependencies
62-
uses: aws-powertools/actions/.github/actions/cached-node-modules@d406bac5563f1d8c793519a3eedfe620f6a14872
62+
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
6363
with:
6464
nodeVersion: '22'
6565
- name: Setup AWS credentials

.github/workflows/update_ssm.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# SSM Parameters update
2+
#
3+
# PROCESS
4+
# Creates parameters in regional AWS accounts for each layer we create, using the inputs to target specific releases
5+
# * environment: will prefix /beta/ into the parameter
6+
# * write_latest: will create a latest alias instead of a version number in the parameter
7+
# * package_version: semantic version number of the released layer (3.x.y)
8+
# * layer_version: this is sequential layer version from the ARN
9+
#
10+
# A successful parameter would look similar to:
11+
# /aws/service/powertools/python/arm64/python3.8/3.1.0
12+
# And will have a value of:
13+
# arn:aws:lambda:eu-west-1:094274105915:layer:AWSLambdaPowertoolsPythonV3-python38-arm64:4
14+
15+
on:
16+
workflow_dispatch:
17+
inputs:
18+
environment:
19+
description: Environment to deploy to
20+
type: choice
21+
options:
22+
- Beta
23+
- Prod
24+
required: true
25+
26+
write_latest:
27+
description: Write to the latest path
28+
type: boolean
29+
required: false
30+
31+
package_version:
32+
description: Semantic Version of published layer
33+
type: string
34+
required: true
35+
36+
layer_version:
37+
description: Layer version
38+
type: string
39+
required: true
40+
41+
name: SSM Parameters
42+
run-name: SSM Parameters - TypeScript
43+
44+
permissions:
45+
contents: read
46+
47+
jobs:
48+
typescript:
49+
runs-on: ubuntu-latest
50+
environment: SSM
51+
strategy:
52+
matrix:
53+
region: ["af-south-1", "ap-east-1", "ap-northeast-1", "ap-northeast-2", "ap-northeast-3",
54+
"ap-south-1", "ap-south-2", "ap-southeast-1", "ap-southeast-2", "ap-southeast-3",
55+
"ap-southeast-4", "ca-central-1", "ca-west-1", "eu-central-1", "eu-central-2",
56+
"eu-north-1", "eu-south-1", "eu-south-2", "eu-west-1", "eu-west-2", "eu-west-3",
57+
"il-central-1", "me-central-1", "me-south-1", "sa-east-1", "us-east-1",
58+
"us-east-2", "us-west-1", "us-west-2", "ap-southeast-5"
59+
]
60+
61+
permissions:
62+
contents: write
63+
id-token: write
64+
steps:
65+
- id: transform
66+
run: |
67+
echo 'CONVERTED_REGION=${{ matrix.region }}' | tr 'a-z\-' 'A-Z_' >> "$GITHUB_OUTPUT"
68+
- id: creds
69+
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
70+
with:
71+
aws-region: ${{ matrix.region }}
72+
role-to-assume: ${{ secrets[format('{0}', steps.transform.outputs.CONVERTED_REGION)] }}
73+
mask-aws-account-id: true
74+
- id: write-version
75+
env:
76+
prefix: ${{ inputs.environment == 'beta' && '/aws/service/powertools/beta' || '/aws/service/powertools' }}
77+
run: |
78+
aws ssm put-parameter --name ${{ env.prefix }}/typescript/generic/all/${{ inputs.package_version }} --value "arn:aws:lambda:${{ matrix.region }}:094274105915:layer:AWSLambdaPowertoolsTypeScriptV2:${{ inputs.layer_version }}" --type String --overwrite
79+
80+
- id: write-latest
81+
if: inputs.write_latest == true
82+
env:
83+
prefix: ${{ inputs.environment == 'beta' && '/aws/service/powertools/beta' || '/aws/service/powertools' }}
84+
run: |
85+
aws ssm put-parameter --name ${{ env.prefix }}/typescript/generic/all/latest --value "arn:aws:lambda:${{ matrix.region }}:094274105915:layer:AWSLambdaPowertoolsTypeScriptV2:${{ inputs.layer_version }}" --type String --overwrite

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ venv
3737

3838
# Static documentation site generated by Mkdocs
3939
site
40+
.cache
4041

4142
# Generated API documentation (from TypeDoc)
4243
/api
@@ -46,4 +47,4 @@ tmp
4647

4748
# TS build files
4849
tsconfig.tsbuildinfo
49-
.tsbuildinfo
50+
.tsbuildinfo

0 commit comments

Comments
 (0)