Skip to content

Commit 90341e4

Browse files
Merge branch 'develop' into idempotency-none-type
2 parents e4a9b5e + 1f3fd8d commit 90341e4

File tree

71 files changed

+1103
-332
lines changed

Some content is hidden

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

71 files changed

+1103
-332
lines changed
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
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+
cdk:
38+
name: Install CDK
39+
runs-on: ubuntu-latest
40+
permissions:
41+
contents: write
42+
id-token: write
43+
environment: layer-${{ inputs.environment }}
44+
steps:
45+
- id: credentials
46+
name: AWS Credentials
47+
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
48+
with:
49+
aws-region: ${{ inputs.region }}
50+
role-to-assume: ${{ secrets.REGION_IAM_ROLE }}
51+
mask-aws-account-id: true
52+
- id: workdir
53+
name: Create Workdir
54+
run: |
55+
mkdir -p build/project
56+
- id: cdk-install
57+
name: Install CDK
58+
working-directory: build
59+
run: |
60+
npm i aws-cdk
61+
- id: cdk-project
62+
name: CDK Project
63+
working-directory: build/project
64+
run: |
65+
npx cdk init app --language=typescript
66+
AWS_REGION="${{ inputs.region }}" npx cdk bootstrap
67+
68+
copy_layers:
69+
name: Copy Layers
70+
runs-on: ubuntu-latest
71+
permissions:
72+
contents: write
73+
id-token: write
74+
strategy:
75+
matrix:
76+
layer:
77+
- AWSLambdaPowertoolsPythonV3-python38-arm64
78+
- AWSLambdaPowertoolsPythonV3-python39-arm64
79+
- AWSLambdaPowertoolsPythonV3-python310-arm64
80+
- AWSLambdaPowertoolsPythonV3-python311-arm64
81+
- AWSLambdaPowertoolsPythonV3-python312-arm64
82+
- AWSLambdaPowertoolsPythonV3-python313-arm64
83+
- AWSLambdaPowertoolsPythonV3-python38-x86_64
84+
- AWSLambdaPowertoolsPythonV3-python39-x86_64
85+
- AWSLambdaPowertoolsPythonV3-python310-x86_64
86+
- AWSLambdaPowertoolsPythonV3-python311-x86_64
87+
- AWSLambdaPowertoolsPythonV3-python312-x86_64
88+
- AWSLambdaPowertoolsPythonV3-python313-x86_64
89+
environment: layer-${{ inputs.environment }}
90+
steps:
91+
- id: credentials
92+
name: AWS Credentials
93+
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502
94+
with:
95+
aws-region: us-east-1
96+
role-to-assume: ${{ secrets.REGION_IAM_ROLE }}
97+
mask-aws-account-id: true
98+
- id: go-setup
99+
name: Setup Go
100+
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
101+
- id: go-env
102+
name: Go Env
103+
run: go env
104+
- id: go-install-pkg
105+
name: Install
106+
run: go install github.com/aws-powertools/actions/layer-balancer/cmd/balance@latest
107+
- id: run-balance
108+
name: Run Balance
109+
run: balance -read-region us-east-1 -write-region ${{ inputs.region }} -write-role ${{ secrets.BALANCE_ROLE_ARN }} -layer-name ${{ matrix.layer }} -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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2121
- name: 'Dependency Review'
22-
uses: actions/dependency-review-action@4081bf99e2866ebe428fc0477b69eb4fcda7220a # v4.4.0
22+
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0

.github/workflows/layer_govcloud.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ jobs:
6666
aws --region us-east-1 lambda get-layer-version-by-arn --arn arn:aws:lambda:us-east-1:017000801446:layer:${{ matrix.layer }}-${{ matrix.arch }}:${{ inputs.version }} --query 'Content.Location' | xargs curl -L -o ${{ matrix.layer }}_${{ matrix.arch }}.zip
6767
aws --region us-east-1 lambda get-layer-version-by-arn --arn arn:aws:lambda:us-east-1:017000801446:layer:${{ matrix.layer }}-${{ matrix.arch }}:${{ inputs.version }} > ${{ matrix.layer }}_${{ matrix.arch }}.json
6868
- name: Store Zip
69-
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
69+
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
7070
with:
7171
name: ${{ matrix.layer }}_${{ matrix.arch }}.zip
7272
path: ${{ matrix.layer }}_${{ matrix.arch }}.zip
7373
retention-days: 1
7474
if-no-files-found: error
7575
- name: Store Metadata
76-
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
76+
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
7777
with:
7878
name: ${{ matrix.layer }}_${{ matrix.arch }}.json
7979
path: ${{ matrix.layer }}_${{ matrix.arch }}.json

.github/workflows/layer_govcloud_python313.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ jobs:
6161
aws --region us-east-1 lambda get-layer-version-by-arn --arn arn:aws:lambda:us-east-1:017000801446:layer:${{ matrix.layer }}-${{ matrix.arch }}:${{ inputs.version }} --query 'Content.Location' | xargs curl -L -o ${{ matrix.layer }}_${{ matrix.arch }}.zip
6262
aws --region us-east-1 lambda get-layer-version-by-arn --arn arn:aws:lambda:us-east-1:017000801446:layer:${{ matrix.layer }}-${{ matrix.arch }}:${{ inputs.version }} > ${{ matrix.layer }}_${{ matrix.arch }}.json
6363
- name: Store Zip
64-
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
64+
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
6565
with:
6666
name: ${{ matrix.layer }}_${{ matrix.arch }}.zip
6767
path: ${{ matrix.layer }}_${{ matrix.arch }}.zip
6868
retention-days: 1
6969
if-no-files-found: error
7070
- name: Store Metadata
71-
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
71+
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
7272
with:
7373
name: ${{ matrix.layer }}_${{ matrix.arch }}.json
7474
path: ${{ matrix.layer }}_${{ matrix.arch }}.json

.github/workflows/layer_rename.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ jobs:
6666
aws --region us-east-1 lambda get-layer-version-by-arn --arn arn:aws:lambda:us-east-1:017000801446:layer:${{ matrix.layer }}-x86:${{ inputs.version }} --query 'Content.Location' | xargs curl -L -o ${{ matrix.layer }}_x86_64.zip
6767
aws --region us-east-1 lambda get-layer-version-by-arn --arn arn:aws:lambda:us-east-1:017000801446:layer:${{ matrix.layer }}-x86:${{ inputs.version }} > ${{ matrix.layer }}_x86_64.json
6868
- name: Store Zip
69-
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
69+
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
7070
with:
7171
name: ${{ matrix.layer }}_x86_64.zip
7272
path: ${{ matrix.layer }}_x86_64.zip
7373
retention-days: 1
7474
if-no-files-found: error
7575
- name: Store Metadata
76-
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
76+
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
7777
with:
7878
name: ${{ matrix.layer }}_x86_64.json
7979
path: ${{ matrix.layer }}_x86_64.json

.github/workflows/on_closed_issues.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
permissions:
2222
issues: write # comment on issues
2323
steps:
24-
- uses: aws-actions/closed-issue-message@80edfc24bdf1283400eb04d20a8a605ae8bf7d48
24+
- uses: aws-powertools/actions/.github/actions/close-issue-message@428c1934f4b22c0984ff4a39b66c2f70765bbed6
2525
with:
2626
repo-token: "${{ secrets.GITHUB_TOKEN }}"
2727
message: |

.github/workflows/ossf_scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
repo_token: ${{ secrets.SCORECARD_TOKEN }} # read-only fine-grained token to read branch protection settings
3636

3737
- name: "Upload results"
38-
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
38+
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
3939
with:
4040
name: SARIF file
4141
path: results.sarif

.github/workflows/pre-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ jobs:
232232

233233
- name: Upload to PyPi prod
234234
if: ${{ !inputs.skip_pypi }}
235-
uses: pypa/gh-action-pypi-publish@15c56dba361d8335944d31a2ecd17d700fc7bcbc # v1.12.2
235+
uses: pypa/gh-action-pypi-publish@67339c736fd9354cd4f8cb0b744f2b82a74b5c70 # v1.12.3
236236

237237
# Creates a PR with the latest version we've just released
238238
# since our trunk is protected against any direct pushes from automation

.github/workflows/publish_v2_layer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124

125125
- name: Set up Docker Buildx
126126
id: builder
127-
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
127+
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
128128
with:
129129
install: true
130130
driver: docker
@@ -146,7 +146,7 @@ jobs:
146146
- name: zip output
147147
run: zip -r cdk.out.zip cdk.out
148148
- name: Archive CDK artifacts
149-
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
149+
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
150150
with:
151151
name: cdk-layer-artefact
152152
path: layer/cdk.out.zip

.github/workflows/publish_v3_layer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ jobs:
127127

128128
- name: Set up Docker Buildx
129129
id: builder
130-
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1
130+
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
131131
with:
132132
install: true
133133
driver: docker
@@ -149,7 +149,7 @@ jobs:
149149
- name: zip output
150150
run: zip -r cdk.py${{ matrix.python-version }}.out.zip cdk.out
151151
- name: Archive CDK artifacts
152-
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
152+
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
153153
with:
154154
name: cdk-layer-artifact-py${{ matrix.python-version }}
155155
path: layer_v3/cdk.py${{ matrix.python-version }}.out.zip

0 commit comments

Comments
 (0)