Skip to content

Commit

Permalink
📝 use terraform-docs to generate module IO docs
Browse files Browse the repository at this point in the history
  • Loading branch information
builtinnya committed Jan 31, 2019
1 parent 70baedc commit 37b9280
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 1 deletion.
23 changes: 23 additions & 0 deletions Dockerfile.golang
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM golang:1.11

###
# Set up the working directory
#
ENV CODES_DIR /codes
RUN mkdir -p "${CODES_DIR}"
WORKDIR "${CODES_DIR}"

###
# Install utilities
#
RUN go get github.com/segmentio/terraform-docs

###
# Install codes
#
COPY . .

###
# What we need is.. bash!
#
CMD [ "bash" ]
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,22 @@ resource "aws_cloudfront_distribution" "your_distribution" {
}
```

## License
## Arguments and Outputs

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| basic\_auth\_credentials | Credentials for Basic Authentication. Pass a map composed of 'user' and 'password'. | map | n/a | yes |
| function\_name | Lambda function name | string | `"basicAuth"` | no |

## Outputs

| Name | Description |
|------|-------------|
| lambda\_arn | Lambda function ARN with version |

# License

Copyright © 2019 Naoto Yokoyama

Expand Down
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ set -o xtrace

__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

docker-compose build dev
docker-compose run --rm dev npm run build
1 change: 1 addition & 0 deletions clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ set -o xtrace

__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

docker-compose build dev
docker-compose run --rm dev npm run clean
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@ services:
volumes:
- .:/codes/
- /codes/node_modules
docs:
build:
context: .
dockerfile: Dockerfile.golang
command: terraform-docs markdown table ./module
volumes:
- .:/codes/
17 changes: 17 additions & 0 deletions docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
#
# Generates the module markdown documents by terraform-docs.
#
# Usage:
# ./docs.sh
#

set -o errexit
set -o nounset
set -o pipefail
#set -o xtrace

__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

docker-compose build docs 2>/dev/null 1>/dev/null
docker-compose run --rm docs

0 comments on commit 37b9280

Please sign in to comment.