Skip to content

Commit cf3f40b

Browse files
authored
Merge pull request #45 from aws-ia/ephemeral_project-updates
Updates from project type
2 parents 126b842 + 7610417 commit cf3f40b

File tree

7 files changed

+67
-13
lines changed

7 files changed

+67
-13
lines changed

.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.1
3-
_src_path: /task/fcc9ea5c-e927-11ed-bba8-5e3d76a82673/projecttype
2+
_commit: v0.0.6
3+
_src_path: /task/85181ca7-edb8-11ed-83ce-460647dd8021/projecttype
44
starting_version: v0.0.0
55
version_file: VERSION
66

.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+
- "./"

.project_automation/publication/entrypoint.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ else
1818
echo "creating new version"
1919
gh release create ${VERSION} --target ${BRANCH} --generate-notes
2020
fi
21+
22+

.project_automation/static_tests/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ RUN gem install mdl
2424

2525
ENV TERRAFORM_DOCS_VERSION=v0.16.0
2626
RUN wget https://github.com/terraform-docs/terraform-docs/releases/download/${TERRAFORM_DOCS_VERSION}/terraform-docs-${TERRAFORM_DOCS_VERSION}-linux-amd64.tar.gz && \
27-
tar -C /usr/local/bin -xzf terraform-docs-${TERRAFORM_DOCS_VERSION}-linux-amd64.tar.gz && chmod +x /usr/local/bin/terraform-docs
27+
tar -C /usr/local/bin -xzf terraform-docs-${TERRAFORM_DOCS_VERSION}-linux-amd64.tar.gz && chmod +x /usr/local/bin/terraform-docs
Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash -ex
1+
#!/bin/bash -e
22

33
## NOTE: paths may differ when running in a managed task. To ensure behavior is consistent between
44
# managed and local tasks always use these variables for the project and project type path
@@ -11,13 +11,45 @@ cd ${PROJECT_PATH}
1111
terraform init
1212
terraform validate
1313

14+
#********** tflint ********************
15+
echo 'Starting tflint'
1416
tflint --init
15-
tflint
16-
17+
MYLINT=$(tflint --force)
18+
if [ -z "$MYLINT" ]
19+
then
20+
echo "Success - tflint found no linting issues!"
21+
else
22+
echo "Failure - tflint found linting issues!"
23+
echo "$MYLINT"
24+
exit 1
25+
fi
26+
#********** tfsec *********************
27+
# tfsec will report to the console with success or Failure
28+
# therefore there is no need to provide such conditional stetements
29+
echo 'Starting tfsec'
1730
tfsec .
18-
19-
mdl .header.md
20-
21-
terraform-docs --lockfile=false ./
22-
31+
#********** Markdown Lint **************
32+
echo 'Starting markdown lint'
33+
MYMDL=$(mdl .header.md || true)
34+
if [ -z "$MYMDL" ]
35+
then
36+
echo "Success - markdown lint found no linting issues!"
37+
else
38+
echo "Failure - markdown lint found linting issues!"
39+
echo "$MYMDL"
40+
exit 1
41+
fi
42+
#********** Terraform Docs *************
43+
echo 'Starting terraform-docs'
44+
TDOCS="$(terraform-docs --lockfile=false ./)"
45+
git add -N README.md
46+
GDIFF="$(git diff --compact-summary)"
47+
if [ -z "$GDIFF" ]
48+
then
49+
echo "Success - Terraform Docs creation verified!"
50+
else
51+
echo "Failure - Terraform Docs creation failed, ensure you have precommit installed and running before submitting the Pull Request"
52+
exit 1
53+
fi
54+
#***************************************
2355
echo "End of Static Tests"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ resource "aws_iam_policy" "policy" {
165165
| <a name="input_aws_region"></a> [aws\_region](#input\_aws\_region) | The region from which this module will be executed. | `string` | n/a | yes |
166166
| <a name="input_tfc_org"></a> [tfc\_org](#input\_tfc\_org) | Terraform Organization name | `string` | n/a | yes |
167167
| <a name="input_cloudwatch_log_group_name"></a> [cloudwatch\_log\_group\_name](#input\_cloudwatch\_log\_group\_name) | RunTask CloudWatch log group name | `string` | `"/hashicorp/terraform/runtask/iam-access-analyzer/"` | no |
168-
| <a name="input_cloudwatch_log_group_retention"></a> [cloudwatch\_log\_group\_retention](#input\_cloudwatch\_log\_group\_retention) | Lambda CloudWatch log group retention period | `string` | `"30"` | no |
168+
| <a name="input_cloudwatch_log_group_retention"></a> [cloudwatch\_log\_group\_retention](#input\_cloudwatch\_log\_group\_retention) | Lambda CloudWatch log group retention period | `string` | `"365"` | no |
169169
| <a name="input_deploy_waf"></a> [deploy\_waf](#input\_deploy\_waf) | Set to true to deploy CloudFront and WAF in front of the Lambda function URL | `string` | `false` | no |
170170
| <a name="input_event_bus_name"></a> [event\_bus\_name](#input\_event\_bus\_name) | EventBridge event bus name | `string` | `"default"` | no |
171171
| <a name="input_event_source"></a> [event\_source](#input\_event\_source) | EventBridge source name | `string` | `"app.terraform.io"` | no |

examples/module_workspace/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ First step is to deploy the module into dedicated Terraform Cloud workspace. The
7878

7979
## Inputs
8080

81-
No inputs.
81+
| Name | Description | Type | Default | Required |
82+
|------|-------------|------|---------|:--------:|
83+
| <a name="input_tfc_org"></a> [tfc\_org](#input\_tfc\_org) | n/a | `string` | n/a | yes |
84+
| <a name="input_workspace_prefix"></a> [workspace\_prefix](#input\_workspace\_prefix) | n/a | `string` | n/a | yes |
8285

8386
## Outputs
8487

0 commit comments

Comments
 (0)