Skip to content

Commit 76716e5

Browse files
authored
Merge pull request #24 from aws-ia/ephemeral_project-updates
Updates from project type
2 parents 11c1abd + 97dbc77 commit 76716e5

File tree

22 files changed

+108
-23
lines changed

22 files changed

+108
-23
lines changed

.checkov.yml renamed to .config/.checkov.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
download-external-modules: False
2-
evaluate-variables: true
1+
download-external-modules: True
2+
evaluate-variables: True
33
file:
44
- 'tf.json'
55
framework:
File renamed without changes.
File renamed without changes.
File renamed without changes.

.config/.tfsec.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"minimum_severity": "MEDIUM"
3+
}

.copier-answers.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is auto-generated, changes will be overwritten
2-
_commit: v0.0.8
3-
_src_path: /task/d8054634-017f-11ee-b538-a6e0baabaef0/projecttype
2+
_commit: v0.1.1
3+
_src_path: /task/d1f87790-0b99-11ee-8c8f-b23aa8435a4f/projecttype
44
starting_version: v0.0.0
55
version_file: VERSION
66

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ repos:
1010
hooks:
1111
- id: terraform-docs-go
1212
args:
13-
- "--config=.terraform-docs.yaml"
13+
- "--config=.config/.terraform-docs.yaml"
1414
- "--lockfile=false"
1515
- "--recursive"
1616
- "--recursive-path=examples/"

.project_automation/functional_tests/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ echo "Running Checkov Analysis"
1616
terraform init
1717
terraform plan -out tf.plan
1818
terraform show -json tf.plan > tf.json
19-
checkov --download-external-modules true
19+
checkov --config-file ${PROJECT_PATH}/.config/.checkov.yml
2020

2121
#********** Terratest execution **********
2222
echo "Running Terratest"

.project_automation/publication/entrypoint.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# managed and local tasks always use these variables for the project and project type path
55
PROJECT_PATH=${BASE_PATH}/project
66
PROJECT_TYPE_PATH=${BASE_PATH}/projecttype
7-
git config --global --add safe.directory ${PROJECT_PATH}
87

98
echo "[STAGE: Publication]"
109
VERSION=$(cat VERSION)

.project_automation/static_tests/entrypoint.sh

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# managed and local tasks always use these variables for the project and project type path
55
PROJECT_PATH=${BASE_PATH}/project
66
PROJECT_TYPE_PATH=${BASE_PATH}/projecttype
7-
git config --global --add safe.directory ${PROJECT_PATH}
87

98
echo "Starting Static Tests"
109

@@ -14,35 +13,43 @@ terraform validate
1413

1514
#********** tflint ********************
1615
echo 'Starting tflint'
17-
tflint --init
18-
MYLINT=$(tflint --force)
16+
tflint --init --config ${PROJECT_PATH}/.config/.tflint.hcl
17+
MYLINT=$(tflint --force --config ${PROJECT_PATH}/.config/.tflint.hcl)
1918
if [ -z "$MYLINT" ]
2019
then
2120
echo "Success - tflint found no linting issues!"
2221
else
23-
echo "Failure - tflint found linting issues!"
22+
echo "Failure - tflint found linting issues!"
2423
echo "$MYLINT"
2524
exit 1
2625
fi
2726
#********** tfsec *********************
28-
# tfsec will report to the console with success or Failure
29-
# therefore there is no need to provide such conditional stetements
3027
echo 'Starting tfsec'
31-
tfsec .
28+
MYTFSEC=$(tfsec . --config-file ${PROJECT_PATH}/.config/.tfsec.yml || true)
29+
if [[ $MYTFSEC == *"No problems detected!"* ]];
30+
then
31+
echo "Success - tfsec found no security issues!"
32+
echo "$MYTFSEC"
33+
else
34+
echo "Failure - tfsec found security issues!"
35+
echo "$MYTFSEC"
36+
exit 1
37+
fi
38+
3239
#********** Markdown Lint **************
3340
echo 'Starting markdown lint'
34-
MYMDL=$(mdl .header.md || true)
41+
MYMDL=$(mdl --config ${PROJECT_PATH}/.config/.mdlrc .header.md examples/*/.header.md || true)
3542
if [ -z "$MYMDL" ]
3643
then
3744
echo "Success - markdown lint found no linting issues!"
3845
else
39-
echo "Failure - markdown lint found linting issues!"
46+
echo "Failure - markdown lint found linting issues!"
4047
echo "$MYMDL"
4148
exit 1
4249
fi
4350
#********** Terraform Docs *************
4451
echo 'Starting terraform-docs'
45-
TDOCS="$(terraform-docs --lockfile=false ./)"
52+
TDOCS="$(terraform-docs --config ${PROJECT_PATH}/.config/.terraform-docs.yaml --lockfile=false ./)"
4653
git add -N README.md
4754
GDIFF="$(git diff --compact-summary)"
4855
if [ -z "$GDIFF" ]
@@ -53,4 +60,4 @@ else
5360
exit 1
5461
fi
5562
#***************************************
56-
echo "End of Static Tests"
63+
echo "End of Static Tests"

0 commit comments

Comments
 (0)