Skip to content

Commit 93ac869

Browse files
Modernizing module (#41)
* Modernizing module * Fixing linting issue * Updating Node.js
1 parent 6f0302d commit 93ac869

File tree

7 files changed

+57
-18
lines changed

7 files changed

+57
-18
lines changed
Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,24 @@
1-
name: CI
2-
3-
on: [push, pull_request]
4-
1+
name: Lint
2+
on:
3+
push:
4+
branches: [master]
5+
pull_request:
56
jobs:
67
build:
7-
runs-on: 'ubuntu-latest'
8-
8+
runs-on: ['ubuntu-latest']
99
steps:
10-
1110
- uses: 'actions/checkout@v2'
12-
1311
- uses: 'actions/setup-python@v2'
1412
with:
1513
python-version: '3.8'
16-
1714
- name: yamlllint
1815
run: |
19-
pip install yamllint==1.26.3
16+
pip install yamllint==1.35.1
2017
yamllint module.yml && yamllint test/*.yml
21-
2218
- name: cfn-lint
2319
run: |
24-
pip install cfn-lint==0.59.1
25-
cfn-lint -i W3002 -t module.yml && cfn-lint -t test/*.yml
26-
20+
pip install cfn-lint==1.20.1
21+
cfn-lint -i W3002 W1011 -t module.yml && cfn-lint -i W3002 W1011 -t test/*.yml
2722
- name: license
2823
run: |
2924
grep -q "LICENSE-2.0" module.yml

.github/workflows/test.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Test
2+
on:
3+
push:
4+
branches: [master]
5+
pull_request:
6+
permissions:
7+
id-token: write
8+
contents: read
9+
concurrency:
10+
group: test
11+
cancel-in-progress: false
12+
jobs:
13+
build:
14+
runs-on: ['ubuntu-latest']
15+
steps:
16+
- uses: 'actions/checkout@v2'
17+
- uses: aws-actions/configure-aws-credentials@v4
18+
with:
19+
role-to-assume: 'arn:aws:iam::068189904525:role/github-openid-connect'
20+
aws-region: 'eu-west-1'
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: '18.x'
24+
- name: test
25+
run: |
26+
npm ci
27+
cd test
28+
npm ci
29+
CFN_PACKAGE_BUCKET_NAME=cf-templates-1a2zmgbg9ut4o-eu-west-1 npm test
30+
cd -

module.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ Conditions:
144144
HasReservedConcurrentExecutions: !Not [!Equals [!Ref ReservedConcurrentExecutions, -1]]
145145
HasVpcModule: !Not [!Equals [!Ref VpcModule, '']]
146146
HasFunctionName: !Not [!Equals [!Ref FunctionName, '']]
147+
HasDescription: !Not [!Equals [!Ref Description, '']]
147148
HasDependencyModule1: !Not [!Equals [!Ref DependencyModule1, '']]
148149
HasDependencyModule2: !Not [!Equals [!Ref DependencyModule2, '']]
149150
HasDependencyModule3: !Not [!Equals [!Ref DependencyModule3, '']]
@@ -236,7 +237,7 @@ Resources:
236237
Properties:
237238
Code: '../../../lambda-src/' # we can not make this a parameter because `aws cloudformation package` does not take parameters into account
238239
DeadLetterConfig: !If [HasDeadLetterQueueModule, {TargetArn: {'Fn::ImportValue': !Sub '${DeadLetterQueueModule}-Arn'}}, !Ref 'AWS::NoValue']
239-
Description: !Ref Description
240+
Description: !If [HasDescription, !Ref Description, !Ref AWS::NoValue]
240241
Environment:
241242
Variables:
242243
VARIABLE1: !Ref EnvironmentVariable1

package-lock.json

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/defaults.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ Resources:
77
Properties:
88
Parameters:
99
Handler: 'defaults.handler'
10-
Runtime: 'nodejs16.x'
10+
Runtime: 'nodejs22.x'
1111
TemplateURL: './node_modules/@cfn-modules/lambda-function/module.yml'

test/layer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ Resources:
1818
Properties:
1919
Parameters:
2020
Handler: 'defaults.handler'
21-
Runtime: 'nodejs16.x'
21+
Runtime: 'nodejs22.x'
2222
LayerArns: !Ref Layer
2323
TemplateURL: './node_modules/@cfn-modules/lambda-function/module.yml'

test/named.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ Resources:
77
Properties:
88
Parameters:
99
Handler: 'defaults.handler'
10-
Runtime: 'nodejs16.x'
10+
Runtime: 'nodejs22.x'
1111
FunctionName: 'NamedLambda'
1212
TemplateURL: './node_modules/@cfn-modules/lambda-function/module.yml'

0 commit comments

Comments
 (0)