Skip to content

Commit

Permalink
updated tf readme with tf-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
chefgs committed Oct 30, 2023
1 parent d5e7beb commit 8076195
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 7 deletions.
25 changes: 18 additions & 7 deletions tfcloud_samples/amazon_ec2/TF_README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
## Terraform Cloud Sample

### How this works
- Terraform cloud runs the `terraform apply` run in Terraform Cloud workspace, since we have declared the terraform cloud as a remote backend in the code.
- We need to configure Terraform source code path in the `Settings > General` page for the given workspace in Terraform Cloud
- Change the Terraform Working Directory setting to specify the path of the config, relative to the relevant root directory - in this case: `tfcloud_samples/amazon_ec2`
- In case of variable override, add the variables into `variables` section in Teraform cloud workspace. Otherwise declare `*.auto.tfvars` file.

<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.14.9 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.0 |
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 3.27 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | 3.75.1 |
| <a name="provider_aws"></a> [aws](#provider\_aws) | 3.76.1 |

## Modules

No modules.
| Name | Source | Version |
|------|--------|---------|
| <a name="module_ec2_instances"></a> [ec2\_instances](#module\_ec2\_instances) | ../modules/aws_two_tier | n/a |

## Resources

Expand All @@ -26,11 +36,12 @@ No modules.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_instance_count"></a> [instance\_count](#input\_instance\_count) | n/a | `number` | `2` | no |
| <a name="input_instance_count_needed"></a> [instance\_count\_needed](#input\_instance\_count\_needed) | n/a | `string` | `"true"` | no |
| <a name="input_region"></a> [region](#input\_region) | n/a | `string` | `"us-west-2"` | no |
| <a name="input_region"></a> [region](#input\_region) | Variables Block Common values used across the terraform code can be added as variables We can override the values using .tfvars files while running terraform plan/apply | `string` | `"us-west-2"` | no |

## Outputs

No outputs.
| Name | Description |
|------|-------------|
| <a name="output_instance_id"></a> [instance\_id](#output\_instance\_id) | ID of the EC2 instance(s) |
| <a name="output_instance_state"></a> [instance\_state](#output\_instance\_state) | State of the EC2 instance(s) |
<!-- END_TF_DOCS -->
45 changes: 45 additions & 0 deletions tfcloud_samples/modules/aws_two_tier/TF_README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 3.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | ~> 3.0 |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [aws_instance.web](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance) | resource |
| [aws_internet_gateway.igw](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/internet_gateway) | resource |
| [aws_route_table.public_rt](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route_table) | resource |
| [aws_route_table_association.public_rt_asso](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route_table_association) | resource |
| [aws_security_group.sg](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group) | resource |
| [aws_subnet.public_subnet](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/subnet) | resource |
| [aws_vpc.app_vpc](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpc) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_instance_type"></a> [instance\_type](#input\_instance\_type) | n/a | `string` | `"t2.micro"` | no |
| <a name="input_profile_name"></a> [profile\_name](#input\_profile\_name) | n/a | `string` | `"default"` | no |
| <a name="input_public_subnet_cidr"></a> [public\_subnet\_cidr](#input\_public\_subnet\_cidr) | n/a | `string` | `"178.0.10.0/24"` | no |
| <a name="input_region"></a> [region](#input\_region) | n/a | `string` | `"us-west-2"` | no |
| <a name="input_vpc_cidr"></a> [vpc\_cidr](#input\_vpc\_cidr) | variable "instance\_key" { default = "saravanan-ec2-key" } | `string` | `"178.0.0.0/16"` | no |

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_web_instance_ip"></a> [web\_instance\_ip](#output\_web\_instance\_ip) | n/a |
<!-- END_TF_DOCS -->

0 comments on commit 8076195

Please sign in to comment.