forked from eijikominami/aws-cloudformation-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildspec-sam.yml
31 lines (30 loc) · 1.1 KB
/
buildspec-sam.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
version: 0.2
phases:
install:
runtime-versions:
python: 3.8
commands:
- pip install -U pip
- pip install -U cfn-lint
# Use the latest version
- pip install -U awscli
# for Lambda
- pip install -U aws-sam-cli
- pip install -U boto3
# for Lambda Powertools
- pip install -U aws-lambda-powertools
# for cloudformation-guard
- wget https://github.com/aws-cloudformation/cloudformation-guard/releases/download/1.0.0/cfn-guard-linux-1.0.0.tar.gz
- tar -xvf cfn-guard-linux-1.0.0.tar.gz
pre_build:
commands:
#- find ./ -type f -name "*.yaml" | xargs --no-run-if-empty cfn-lint
- find ./ -type f -name "*.yaml" | xargs -I {} ./cfn-guard-linux/cfn-guard check -r ./security-standards.ruleset -t {}
build:
commands:
- sam validate --template ${TEMPLATE_FILE_PATH}template.yaml
- sam build --template ${TEMPLATE_FILE_PATH}template.yaml
- sam package --template-file .aws-sam/build/template.yaml --s3-bucket ${PACKAGE_BUCKET} --output-template-file packaged.yaml
artifacts:
files:
- packaged.yaml