Skip to content

Commit 68f4e31

Browse files
committed
docs: adds README files for modules
1 parent 9cc0033 commit 68f4e31

File tree

8 files changed

+90
-123
lines changed

8 files changed

+90
-123
lines changed

.header.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
# Main
2-
3-
asdfadsfas

.terraform-docs.yml

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
formatter: "" # this is required
2-
3-
version: ""
1+
formatter: "markdown table"
42

53
header-from: .header.md
64
footer-from: ""
@@ -10,25 +8,11 @@ recursive:
108
path: modules
119
include-main: true
1210

13-
sections:
14-
hide: []
15-
show: []
16-
17-
hide-all: false # deprecated in v0.13.0, removed in v0.15.0
18-
show-all: true # deprecated in v0.13.0, removed in v0.15.0
19-
20-
content: ""
21-
2211
output:
23-
file: ""
24-
mode: inject
12+
file: "README.md"
13+
mode: replace
2514
template: |-
2615
{{ .Content }}
27-
\n
28-
29-
output-values:
30-
enabled: false
31-
from: ""
3216
3317
sort:
3418
enabled: true

README.md

Lines changed: 25 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,113 +1,38 @@
1-
# Terraform Module Template
21

3-
This repository serves as a template for creating Terraform modules. It provides a structured approach to organizing and maintaining Terraform code, along with examples and best practices.
42

5-
## Table of Contents
3+
## Requirements
64

7-
- [Prerequisites](#prerequisites)
8-
- [Usage](#usage)
9-
- [Examples](#examples)
10-
- [Module Structure](#module-structure)
5+
| Name | Version |
6+
|------|---------|
7+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.4.6 |
8+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.65.0 |
119

12-
## Prerequisites
10+
## Providers
1311

14-
Before you begin, ensure you have met the following requirements:
12+
No providers.
1513

16-
1. [install terraform](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli)
17-
2. [install pre-commit](https://pre-commit.com/#install)
18-
3. configure pre-commit: `pre-commit install`
19-
4. install required tools
20-
- [tflint](https://github.com/terraform-linters/tflint)
21-
- [terraform-docs](https://github.com/terraform-docs/terraform-docs)
14+
## Modules
2215

23-
## Usage
16+
| Name | Source | Version |
17+
|------|--------|---------|
18+
| <a name="module_dynamodb_tf_state_lock"></a> [dynamodb\_tf\_state\_lock](#module\_dynamodb\_tf\_state\_lock) | ./modules/dynamodb_table | n/a |
19+
| <a name="module_tf_state_s3_bucket"></a> [tf\_state\_s3\_bucket](#module\_tf\_state\_s3\_bucket) | ./modules/s3 | n/a |
2420

25-
To use this template, clone the repository and customize it according to your module's requirements. Below is a quick start guide:
21+
## Resources
2622

27-
1. **Clone the repository:**
23+
No resources.
2824

29-
```sh
30-
git clone https://github.com/your-username/terraform-module-template.git
31-
cd terraform-module-template
32-
```
33-
2. **Customize the module:**
25+
## Inputs
3426

35-
- Update `main.tf`, `variables.tf`, `outputs.tf`, and `versions.tf` files as needed.
36-
- Add your own resources and logic.
37-
3. **Run Terraform commands:**
27+
| Name | Description | Type | Default | Required |
28+
|------|-------------|------|---------|:--------:|
29+
| <a name="input_dynamodb_read_capacity"></a> [dynamodb\_read\_capacity](#input\_dynamodb\_read\_capacity) | (Optional) Number of read units for this table. | `number` | `20` | no |
30+
| <a name="input_dynamodb_table_name"></a> [dynamodb\_table\_name](#input\_dynamodb\_table\_name) | (Required) Unique Table name within a region name of the table | `string` | n/a | yes |
31+
| <a name="input_dynamodb_table_tags"></a> [dynamodb\_table\_tags](#input\_dynamodb\_table\_tags) | (Optional) A map of tags to populate on the created table. | `map(string)` | `{}` | no |
32+
| <a name="input_dynamodb_write_capacity"></a> [dynamodb\_write\_capacity](#input\_dynamodb\_write\_capacity) | (Optional) Number of write units for this table. | `number` | `20` | no |
33+
| <a name="input_s3_bucket_name"></a> [s3\_bucket\_name](#input\_s3\_bucket\_name) | Name of the bucket. If omitted, Terraform will assign a random, unique name. | `string` | n/a | yes |
34+
| <a name="input_s3_bucket_tags"></a> [s3\_bucket\_tags](#input\_s3\_bucket\_tags) | (Optional) Map of tags to assign to the bucket. | `map(string)` | `{}` | no |
3835

39-
```sh
40-
terraform init
41-
terraform plan
42-
terraform apply
43-
```
36+
## Outputs
4437

45-
## Examples
46-
47-
This repository includes example configurations to help you understand how to use the module:
48-
49-
- **Complete Example:** Located in `examples/complete`
50-
51-
- Demonstrates a full-featured usage of the module.
52-
53-
```sh
54-
cd examples/complete
55-
terraform init
56-
terraform apply
57-
```
58-
- **Minimal Example:** Located in `examples/minimal`
59-
60-
- Shows a minimal configuration for using the module.
61-
62-
```sh
63-
cd examples/minimal
64-
terraform init
65-
terraform apply
66-
```
67-
68-
## Module Structure
69-
70-
The repository is organized as follows:
71-
72-
```plaintext
73-
.
74-
├── .editorconfig
75-
├── examples
76-
│ ├── complete
77-
│ │ ├── main.tf
78-
│ │ ├── outputs.tf
79-
│ │ ├── provider.tf
80-
│ │ ├── README.md
81-
│ │ ├── variables.tf
82-
│ │ └── versions.tf
83-
│ └── minimal
84-
│ ├── main.tf
85-
│ ├── outputs.tf
86-
│ ├── provider.tf
87-
│ ├── README.md
88-
│ ├── variables.tf
89-
│ └── versions.tf
90-
├── .github
91-
│ └── workflows
92-
│ ├── documentation.yaml
93-
│ ├── pre-commit.yaml
94-
│ └── pr-title.yaml
95-
├── .gitignore
96-
├── main.tf
97-
├── modules
98-
│ └── sample-resource
99-
│ ├── main.tf
100-
│ ├── outputs.tf
101-
│ ├── variables.tf
102-
│ └── version.tf
103-
├── outputs.tf
104-
├── .pre-commit-config.yaml
105-
├── README.md
106-
├── .terraform-docs.yml
107-
├── tests
108-
│ ├── examples_minimal.tftest.hcl
109-
│ └── unit_tests.tftest.hcl
110-
├── .tflint.hcl
111-
├── variables.tf
112-
└── versions.tf
113-
```
38+
No outputs.

modules/dynamodb_table/.header.md

Whitespace-only changes.

modules/dynamodb_table/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
## Requirements
2+
3+
No requirements.
4+
5+
## Providers
6+
7+
| Name | Version |
8+
|------|---------|
9+
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a |
10+
11+
## Modules
12+
13+
No modules.
14+
15+
## Resources
16+
17+
| Name | Type |
18+
|------|------|
19+
| [aws_dynamodb_table.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/dynamodb_table) | resource |
20+
21+
## Inputs
22+
23+
| Name | Description | Type | Default | Required |
24+
|------|-------------|------|---------|:--------:|
25+
| <a name="input_name"></a> [name](#input\_name) | (Required) Unique Table name within a region name of the table | `string` | n/a | yes |
26+
| <a name="input_read_capacity"></a> [read\_capacity](#input\_read\_capacity) | (Optional) Number of read units for this table. | `number` | `20` | no |
27+
| <a name="input_tags"></a> [tags](#input\_tags) | (Optional) A map of tags to populate on the created table. | `map(string)` | `{}` | no |
28+
| <a name="input_write_capacity"></a> [write\_capacity](#input\_write\_capacity) | (Optional) Number of write units for this table. | `number` | `20` | no |
29+
30+
## Outputs
31+
32+
No outputs.

modules/dynamodb_table/variables.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,3 @@ variable "tags" {
2121
type = map(string)
2222
default = {}
2323
}
24-

modules/s3/.header.md

Whitespace-only changes.

modules/s3/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## Requirements
2+
3+
No requirements.
4+
5+
## Providers
6+
7+
| Name | Version |
8+
|------|---------|
9+
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.57.0 |
10+
11+
## Modules
12+
13+
No modules.
14+
15+
## Resources
16+
17+
| Name | Type |
18+
|------|------|
19+
| [aws_s3_bucket.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/s3_bucket) | resource |
20+
21+
## Inputs
22+
23+
| Name | Description | Type | Default | Required |
24+
|------|-------------|------|---------|:--------:|
25+
| <a name="input_name"></a> [name](#input\_name) | Name of the bucket. If omitted, Terraform will assign a random, unique name. | `string` | n/a | yes |
26+
| <a name="input_tags"></a> [tags](#input\_tags) | (Optional) Map of tags to assign to the bucket. | `map(string)` | `{}` | no |
27+
28+
## Outputs
29+
30+
No outputs.

0 commit comments

Comments
 (0)