-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from fac/first-release
First Release
- Loading branch information
Showing
12 changed files
with
239 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Config - https://github.com/terraform-docs/terraform-docs/blob/master/docs/user-guide/configuration.md | ||
formatter: markdown table | ||
|
||
header-from: INFO.md | ||
|
||
sections: | ||
hide: [providers] | ||
show: [] | ||
|
||
sort: | ||
enabled: true | ||
by: required | ||
|
||
settings: | ||
anchor: true | ||
color: true | ||
default: true | ||
description: false | ||
escape: true | ||
html: true | ||
indent: 2 | ||
lockfile: true | ||
required: true | ||
sensitive: true | ||
type: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM quay.io/terraform-docs/terraform-docs:latest | ||
|
||
COPY entrypoint.sh /code/entrypoint.sh | ||
COPY .terraform-docs.yml /code/.terraform-docs.yml | ||
|
||
RUN chmod +x /code/entrypoint.sh | ||
|
||
WORKDIR /code/modules | ||
|
||
ENTRYPOINT ["sh","/code/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,15 @@ | ||
# See: https://docs.github.com/en/actions/creating-actions | ||
name: TODO:Action Name | ||
name: Terraform AutoDocs Action | ||
author: FreeAgent | ||
description: TODO:Description | ||
# inputs: | ||
# foo: | ||
# description: Foo level | ||
# required: true | ||
# default: 23 | ||
# outputs: | ||
# bar: | ||
# description: Bar output | ||
description: Auto generates documentation for terraform modules. | ||
inputs: | ||
directories: | ||
description: List of directories containing terraform files. | ||
required: true | ||
options: | ||
description: Optional configuration arguments. | ||
required: false | ||
|
||
runs: | ||
# Pick one of the 3 possible types of action: | ||
|
||
#using: 'composite' | ||
#steps: | ||
# - name: Step One | ||
# shell: bash | ||
# run: | | ||
# echo TODO: Step One | ||
|
||
#using: 'node12' | ||
#main: main.js | ||
|
||
#using: 'docker' | ||
#image: 'Dockerfile' | ||
using: 'docker' | ||
image: 'Dockerfile' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
echo "----------------------------------" | ||
echo "Generating Terraform Documentation" | ||
echo "----------------------------------" | ||
|
||
echo "Directories to be processed:" | ||
echo $directories | ||
echo " " | ||
|
||
for directory in $directories | ||
do | ||
echo "Processing ${directory}" | ||
if test -f "${directory}/INFO.md"; then | ||
echo "INFO.md exists auto creating docs in README.md" | ||
terraform-docs -c /code/.terraform-docs.yml $options $directory > ${directory}/README.md | ||
echo "Done" | ||
else | ||
echo "No INFO.md file exists. Skipping ${directory}" | ||
fi | ||
echo " " | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Terraform AWS S3 Bucket Module | ||
|
||
This Terraform Module creates an [S3 Bucket](https://docs.aws.amazon.com/AmazonS3/latest/gsg/GetStartedWithS3.html). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Terraform AWS S3 Bucket Module | ||
|
||
This Terraform Module creates an [S3 Bucket](https://docs.aws.amazon.com/AmazonS3/latest/gsg/GetStartedWithS3.html). | ||
|
||
## Requirements | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.26 | | ||
|
||
## Modules | ||
|
||
No modules. | ||
|
||
## Resources | ||
|
||
| Name | Type | | ||
|------|------| | ||
| [aws_s3_bucket.bucket](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource | | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| <a name="input_bucket_name"></a> [bucket\_name](#input\_bucket\_name) | Name of the S3 bucket to create. | `string` | n/a | yes | | ||
| <a name="input_bucket_acl"></a> [bucket\_acl](#input\_bucket\_acl) | The type of ACL to apply. Valid values are private, public-read, public-read-write, aws-exec-read, authenticated-read, and log-delivery-write. | `string` | `"private"` | no | | ||
| <a name="input_environment"></a> [environment](#input\_environment) | Name of the environment that the bucket is deployed to. | `string` | `"dev"` | no | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| <a name="output_bucket_arn"></a> [bucket\_arn](#output\_bucket\_arn) | The ARN of the bucket. Will be of format arn:aws:s3:::bucketname. | | ||
| <a name="output_bucket_id"></a> [bucket\_id](#output\_bucket\_id) | The name of the bucket. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
# ADD AN AMAZON S3 BUCKET | ||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
# --------------------------------------------------------------------------------------------------------------------- | ||
# CREATE S3 Bucket | ||
# --------------------------------------------------------------------------------------------------------------------- | ||
resource "aws_s3_bucket" "bucket" { | ||
bucket = var.bucket_name | ||
acl = var.bucket_acl | ||
|
||
tags = { | ||
Name = var.bucket_name | ||
Environment = var.environment | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
output "bucket_id" { | ||
value = aws_s3_bucket.bucket.id | ||
description = "The name of the bucket." | ||
} | ||
|
||
output "bucket_arn" { | ||
value = aws_s3_bucket.bucket.arn | ||
description = "The ARN of the bucket. Will be of format arn:aws:s3:::bucketname." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# --------------------------------------------------------------------------------------------------------------------- | ||
# MODULE PARAMETERS | ||
# These variables are expected to be passed in by the operator when calling this terraform module | ||
# --------------------------------------------------------------------------------------------------------------------- | ||
variable "bucket_name" { | ||
description = "Name of the S3 bucket to create." | ||
type = string | ||
} | ||
|
||
|
||
# --------------------------------------------------------------------------------------------------------------------- | ||
# OPTIONAL PARAMETERS | ||
# These variables are optional | ||
# --------------------------------------------------------------------------------------------------------------------- | ||
variable "environment" { | ||
description = "Name of the environment that the bucket is deployed to." | ||
type = string | ||
default = "dev" | ||
} | ||
variable "bucket_acl" { | ||
description = "The type of ACL to apply. Valid values are private, public-read, public-read-write, aws-exec-read, authenticated-read, and log-delivery-write." | ||
type = string | ||
default = "private" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
terraform { | ||
required_version = ">= 0.12.26" | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
} | ||
} | ||
} | ||
|