Skip to content

Commit d102af4

Browse files
author
IA Automator
committed
initial commit
0 parents  commit d102af4

38 files changed

+919
-0
lines changed

.checkov.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
download-external-modules: False
2+
evaluate-variables: true
3+
file:
4+
- 'tf.json'
5+
framework:
6+
- terraform_plan
7+
skip-check:
8+
- CKV2_GCP*
9+
- CKV_AZURE*
10+
- CKV2_AZURE*
11+
repo-root-for-plan-enrichment:
12+
- '.'
13+
summary-position: bottom
14+
output: 'cli'
15+
compact: True
16+
quiet: True

.copier-answers.yml

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

.gitignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
build/
2+
plan.out
3+
plan.out.json
4+
5+
# Local .terraform directories
6+
**/.terraform/*
7+
8+
# .tfstate files
9+
*.tfstate
10+
*.tfstate.*
11+
12+
# Crash log files
13+
crash.log
14+
15+
# Exclude all .tfvars files, which are likely to contain sentitive data, such as
16+
# password, private keys, and other secrets. These should not be part of version
17+
# control as they are data points which are potentially sensitive and subject
18+
# to change depending on the environment.
19+
#
20+
*.tfvars
21+
22+
# Ignore override files as they are usually used to override resources locally and so
23+
# are not checked in
24+
override.tf
25+
override.tf.json
26+
*_override.tf
27+
*_override.tf.json
28+
29+
# Include override files you do wish to add to version control using negated pattern
30+
#
31+
# !example_override.tf
32+
33+
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
34+
# example: *tfplan*
35+
36+
# Ignore CLI configuration files
37+
.terraformrc
38+
terraform.rc
39+
.terraform.lock.hcl
40+
41+
go.mod
42+
go.sum

.header.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Terraform Module Project
2+
3+
:no_entry_sign: Do not edit this readme.md file. To learn how to change this content and work with this repository, refer to CONTRIBUTING.md
4+
5+
## Readme Content
6+
7+
This file will contain any instructional information about this module.

.mdlrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Ignoring the following rules
2+
# MD007 Unordered list indentation
3+
# MD013 Line length
4+
# MD029 Ordered list item prefix
5+
rules "~MD007", "~MD013", "~MD029"

.pre-commit-config.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
fail_fast: false
3+
minimum_pre_commit_version: "2.6.0"
4+
repos:
5+
-
6+
repo: https://github.com/terraform-docs/terraform-docs
7+
# To update run:
8+
# pre-commit autoupdate --freeze
9+
rev: 212db41760d7fc45d736d5eb94a483d0d2a12049 # frozen: v0.16.0
10+
hooks:
11+
- id: terraform-docs-go
12+
args:
13+
- "--config=.terraform-docs.yaml"
14+
- "--lockfile=false"
15+
- "--recursive"
16+
- "--recursive-path=examples/"
17+
- "./"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash -ex
2+
3+
## NOTE: paths may differ when running in a managed task. To ensure behavior is consistent between
4+
# managed and local tasks always use these variables for the project and project type path
5+
PROJECT_PATH=${BASE_PATH}/project
6+
PROJECT_TYPE_PATH=${BASE_PATH}/projecttype
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash -ex
2+
3+
## NOTE: paths may differ when running in a managed task. To ensure behavior is consistent between
4+
# managed and local tasks always use these variables for the project and project type path
5+
PROJECT_PATH=${BASE_PATH}/project
6+
PROJECT_TYPE_PATH=${BASE_PATH}/projecttype
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM public.ecr.aws/codebuild/amazonlinux2-x86_64-standard:4.0
2+
ENV TERRAFORM_VERSION=1.4.2
3+
ENV GO_VERSION=1.20.2
4+
RUN cd /tmp && \
5+
wget https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip && \
6+
unzip terraform_${TERRAFORM_VERSION}_linux_amd64.zip -d /usr/local/bin && chmod 755 /usr/local/bin/terraform
7+
8+
RUN curl -s https://raw.githubusercontent.com/aquasecurity/tfsec/master/scripts/install_linux.sh | bash
9+
10+
RUN cd /tmp && \
11+
wget https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz && \
12+
tar -C /usr/local/bin -xzf go${GO_VERSION}.linux-amd64.tar.gz && chmod 755 /usr/local/bin/go
13+
14+
RUN pip3 install checkov
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash -e
2+
3+
## NOTE: paths may differ when running in a managed task. To ensure behavior is consistent between
4+
# managed and local tasks always use these variables for the project and project type path
5+
PROJECT_PATH=${BASE_PATH}/project
6+
PROJECT_TYPE_PATH=${BASE_PATH}/projecttype
7+
8+
echo "Starting Functional Tests"
9+
10+
cd ${PROJECT_PATH}
11+
12+
#********** Checkov Analysis *************
13+
echo "Running Checkov Analysis"
14+
terraform init
15+
terraform plan -out tf.plan
16+
terraform show -json tf.plan > tf.json
17+
checkov
18+
19+
#********** Terratest execution **********
20+
echo "Running Terratest"
21+
cd test
22+
rm -f go.mod
23+
go mod init github.com/aws-ia/terraform-project-ephemeral
24+
go mod tidy
25+
go install github.com/gruntwork-io/terratest/modules/terraform
26+
go test -timeout 45m
27+
28+
echo "End of Functional Tests"

0 commit comments

Comments
 (0)