-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add doc-gen script * docgen * update readme to point at docs
- Loading branch information
1 parent
fa393b3
commit 09b6416
Showing
14 changed files
with
244 additions
and
55 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 @@ | ||
work/ |
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,71 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
BINARY_DIR=./work | ||
BINARY_FILE="${BINARY_DIR}/terraform-docs" | ||
BINARY_VERSION=0.6.0 | ||
BINARY_URL_PREFIX="https://github.com/segmentio/terraform-docs/releases/download/v${BINARY_VERSION}/terraform-docs-v${BINARY_VERSION}" | ||
|
||
DOCS_CMDS="--sort-inputs-by-required --with-aggregate-type-defaults markdown table" | ||
DOCS_DIR=docs | ||
|
||
VARS_TF=variables.tf | ||
OUTS_TF=outputs.tf | ||
|
||
INS_MD=inputs.md | ||
OUTS_MD=outputs.md | ||
|
||
|
||
function setup { | ||
mkdir -p ${BINARY_DIR} | ||
if [[ ! -e "${BINARY_FILE}" ]]; then | ||
if [[ "$OSTYPE" == "linux-gnu" ]]; then | ||
BINARY_URL="${BINARY_URL_PREFIX}-linux-amd64" | ||
elif [[ "$OSTYPE" == "darwin"* ]]; then | ||
BINARY_URL="${BINARY_URL_PREFIX}-darwin-amd64" | ||
else | ||
echo "Please run this in either a Linux or Mac environment." | ||
exit 1 | ||
fi | ||
echo "Downloading ${BINARY_URL}" | ||
curl -L -o "${BINARY_FILE}" "${BINARY_URL}" | ||
chmod +x "${BINARY_FILE}" | ||
fi | ||
} | ||
|
||
function main_docs { | ||
if test ! -d "${DOCS_DIR}"; then | ||
mkdir "${DOCS_DIR}" | ||
fi | ||
|
||
echo -e "# Terraform Enterprise: Clustering\n" | tee "${DOCS_DIR}/${INS_MD}" "${DOCS_DIR}/${OUTS_MD}" &> /dev/null | ||
|
||
eval "${BINARY_FILE} ${DOCS_CMDS} ${VARS_TF}" >> "${DOCS_DIR}/${INS_MD}" | ||
eval "${BINARY_FILE} ${DOCS_CMDS} ${OUTS_TF}" >> "${DOCS_DIR}/${OUTS_MD}" | ||
|
||
} | ||
|
||
|
||
function module_docs { | ||
if test -d ./modules; then | ||
for dir in ./modules/*; do | ||
mkdir -p "${dir}/${DOCS_DIR}" | ||
|
||
echo -e "# Terraform Enterprise: Clustering\n" | tee "${dir}/${DOCS_DIR}/${INS_MD}" "${dir}/${DOCS_DIR}/${OUTS_MD}" &> /dev/null | ||
|
||
eval "${BINARY_FILE} ${DOCS_CMDS} ${dir}/${VARS_TF}" >> "${dir}/${DOCS_DIR}/${INS_MD}" | ||
eval "${BINARY_FILE} ${DOCS_CMDS} ${dir}/${OUTS_TF}" >> "${dir}/${DOCS_DIR}/${OUTS_MD}" | ||
done | ||
else | ||
echo "No modules directory, skipping." | ||
fi | ||
} | ||
|
||
|
||
setup | ||
main_docs | ||
module_docs | ||
|
||
|
||
|
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 @@ | ||
.PHONY: docs | ||
docs: | ||
.scripts/doc-gen.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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Terraform Enterprise: Clustering | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|:----:|:-----:|:-----:| | ||
| domain | Route53 Domain to manage DNS under | string | n/a | yes | | ||
| license\_file | path to license file | string | n/a | yes | | ||
| vpc\_id | AWS VPC id to install into | string | n/a | yes | | ||
| airgap\_installer\_url | URL to airgap installer package | string | `"https://s3.amazonaws.com/replicated-airgap-work/replicated__docker__kubernetes.tar.gz"` | no | | ||
| airgap\_package\_url | signed URL to download the package | string | `""` | no | | ||
| allow\_list | List of CIDRs we allow to access the infrastructure | list | `[]` | no | | ||
| ami | AMI to launch instance with; defaults to latest Ubuntu Xenial | string | `""` | no | | ||
| aws\_access\_key\_id | AWS access key id to connect to s3 with | string | `""` | no | | ||
| aws\_secret\_access\_key | AWS secret access key to connect to s3 with | string | `""` | no | | ||
| ca\_bundle\_url | URL to Custom CA bundle used for outgoing connections | string | `"none"` | no | | ||
| cert\_domain | domain to search for ACM certificate with (default is *.domain) | string | `""` | no | | ||
| cidr | cidr block for vpc | string | `"10.0.0.0/16"` | no | | ||
| distribution | Type of linux distribution to use. (ubuntu or rhel) | string | `"ubuntu"` | no | | ||
| encryption\_password | encryption password to use as root secret (default is autogenerated) | string | `""` | no | | ||
| hostname | hostname to assign to cluster under domain (default is autogenerated one) | string | `""` | no | | ||
| http\_proxy\_url | HTTP(S) Proxy URL | string | `""` | no | | ||
| iact\_subnet\_list | List of subnets to allow to access Initial Admin Creation Token (IACT) API. https://www.terraform.io/docs/enterprise/private/automating-initial-user.html | string | `""` | no | | ||
| iact\_subnet\_time\_limit | Amount of time to allow access to IACT API after initial boot | string | `""` | no | | ||
| import\_key | an ssh pub key to import to all machines | string | `""` | no | | ||
| installer\_url | URL to the cluster setup tool | string | `"https://install.terraform.io/installer/ptfe.zip"` | no | | ||
| postgresql\_address | address to connect to external postgresql database at | string | `""` | no | | ||
| postgresql\_database | database name to use in exetrnal postgresql database | string | `""` | no | | ||
| postgresql\_extra\_params | additional connection string parameters (must be url query params) | string | `""` | no | | ||
| postgresql\_password | password to connect to external postgresql database as | string | `""` | no | | ||
| postgresql\_user | user to connect to external postgresql database as | string | `""` | no | | ||
| prefix | Name prefix for resource names and tags | string | `"tfe"` | no | | ||
| primary\_count | The number of primary cluster master nodes to run, only 3 support now. | string | `"3"` | no | | ||
| primary\_instance\_type | ec2 instance type | string | `"m4.xlarge"` | no | | ||
| region | aws region where resources will be created | string | `"us-west-2"` | no | | ||
| repl\_cidr | Specify a non-standard CIDR range for the replicated services. The default is 10.96.0.0/12 | string | `""` | no | | ||
| s3\_bucket | S3 bucket to store objects into | string | `""` | no | | ||
| s3\_region | Region of the S3 bucket | string | `""` | no | | ||
| secondary\_count | The number of secondary cluster nodes to run | string | `"5"` | no | | ||
| secondary\_instance\_type | ec2 instance type (Defaults to `primary_instance_type` if not set.) | string | `""` | no | | ||
| ssh\_user | the user to connect to the instance as | string | `""` | no | | ||
| startup\_script | shell script to run when primary instance boots the first time | string | `""` | no | | ||
| subnet\_tags | tags to use to match subnets to use | map | `{}` | no | | ||
| update\_route53 | whether or not to automatically update route53 records for the cluster | string | `"true"` | no | | ||
| volume\_size | size of the root volume in gb | string | `"100"` | no | | ||
| weave\_cidr | Specify a non-standard CIDR range for weave. The default is 10.32.0.0/12 | string | `""` | no | | ||
|
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 @@ | ||
# Terraform Enterprise: Clustering | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| application\_endpoint | | | ||
| application\_health\_check | | | ||
| iam\_role | | | ||
| install\_id | | | ||
| installer\_dashboard\_password | | | ||
| installer\_dashboard\_url | | | ||
| primary\_public\_ip | | | ||
| ssh\_config\_file | | | ||
| ssh\_private\_key | | | ||
|
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,12 @@ | ||
# Terraform Enterprise: Clustering | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|:----:|:-----:|:-----:| | ||
| prefix | Prefix for resource names | string | n/a | yes | | ||
| vpc\_id | AWS VPC id to install into | string | n/a | yes | | ||
| allow\_list | list of CIDRs we allow to access the infrastructure | list | `[]` | no | | ||
| cidr | cidr block for vpc | string | `"10.0.0.0/16"` | no | | ||
| subnet\_tags | tags to use to match subnets to use | map | `{}` | no | | ||
|
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,19 @@ | ||
# Terraform Enterprise: Clustering | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| allow\_ptfe\_sg\_id | | | ||
| availability\_zones | | | ||
| collect\_diag\_file | | | ||
| install\_id | | | ||
| intra\_vpc\_and\_egress\_sg\_id | | | ||
| private\_subnets | | | ||
| private\_subnets\_cidr\_blocks | | | ||
| public\_subnets | | | ||
| public\_subnets\_cidr\_blocks | | | ||
| ssh\_key\_name | | | ||
| ssh\_priv\_key\_file | | | ||
| vpc\_id | | | ||
|
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,8 @@ | ||
# Terraform Enterprise: Clustering | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|:----:|:-----:|:-----:| | ||
| cidr | cidr block for vpc | string | `"10.0.0.0/16"` | no | | ||
|
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,21 @@ | ||
# Terraform Enterprise: Clustering | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| allow\_ptfe\_sg\_id | | | ||
| availability\_zones | | | ||
| collect\_diag\_file | | | ||
| database\_subnet\_group | | | ||
| domain | | | ||
| install\_id | | | ||
| intra\_vpc\_and\_egress\_sg\_id | | | ||
| private\_subnets | | | ||
| private\_subnets\_cidr\_blocks | | | ||
| public\_subnets | | | ||
| public\_subnets\_cidr\_blocks | | | ||
| ssh\_key\_name | | | ||
| ssh\_priv\_key\_file | | | ||
| vpc\_id | | | ||
|
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 Enterprise: Clustering | ||
|
||
|
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 Enterprise: Clustering | ||
|
||
|
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,17 @@ | ||
# Terraform Enterprise: Clustering | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|:----:|:-----:|:-----:| | ||
| domain | this is used to find an existing issued wildcard cert and route53 zone | string | n/a | yes | | ||
| install\_id | the ID of the install | string | n/a | yes | | ||
| prefix | Prefix for resources | string | n/a | yes | | ||
| private\_subnets\_cidr\_blocks | list of CIDRs for the private subnets | list | n/a | yes | | ||
| public\_subnets | list of public subnets | list | n/a | yes | | ||
| public\_subnets\_cidr\_blocks | list of CIDRs for the public subnets | list | n/a | yes | | ||
| vpc\_id | the ID of the VPC | string | n/a | yes | | ||
| cert\_domain | domain to search for ACM certificate with (default is *.domain) | string | `""` | no | | ||
| hostname | hostname to assign to cluster under domain (default is autogenerated one) | string | `""` | no | | ||
| update\_route53 | indicate if route53 should be updated automatically | string | `"true"` | no | | ||
|
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,13 @@ | ||
# Terraform Enterprise: Clustering | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| admin\_group | | | ||
| endpoint | | | ||
| https\_group | | | ||
| lb\_endpoint | | | ||
| lb\_id | | | ||
| sg\_lb\_to\_instance | | | ||
|