Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Add possibility to create infrastructure summary docs in README #720

Open
KostLinux opened this issue Nov 9, 2023 · 0 comments

Comments

@KostLinux
Copy link

What problem are you facing?

Creating terraform docs via terraform-docs adds only modules and requirements in README. For example:

## Requirements

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

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_insurance_vpc"></a> [insurance\_vpc](#module\_insurance\_vpc) | terraform-aws-modules/vpc/aws | ~> 5.1.2 |
| <a name="module_runners_security_group"></a> [runners\_security\_group](#module\_runners\_security\_group) | terraform-aws-modules/security-group/aws | ~> 5.1.0 |

# Docs

This README is created via [terraform-docs](https://terraform-docs.io)

But i want to have everything i'am using in terraform files right in README.
For example:

This code:

module "vpc" {
  source = "terraform-aws-modules/vpc/aws"
  version = "~> 5.1.2"

  name = "vpc"
  cidr = "some_ip_pool"

  azs             = ["eu-west-1a", "eu-west-1b", "eu-west-1c"]
  private_subnets = ["subnet1", "subnet2", "subnet3"]
  public_subnets  = ["subnet1", "subnet2", "subnet3"]

  enable_nat_gateway = true
  enable_vpn_gateway = false
  one_nat_gateway_per_az = true

  enable_network_address_usage_metrics = false
  manage_default_network_acl = true

  manage_default_security_group = true
  }

Will create README like this (basically same as modules / providers / resources):

| Name | Value |
| --- | --- |
| source | terraform-aws-modules/vpc/aws |
| version | ~> 5.1.2 |
| name | vpc |
| cidr | some_ip_pool |
| azs | ["eu-west-1a", "eu-west-1b", "eu-west-1c"] |
| private_subnets | ["subnet1", "subnet2", "subnet3"] |
| public_subnets | ["subnet1", "subnet2", "subnet3"] |
| enable_nat_gateway | true |
| enable_vpn_gateway | false |
| one_nat_gateway_per_az | true |
| enable_network_address_usage_metrics | false |
| manage_default_network_acl | true |
| manage_default_security_group | true |
| default_network_acl_ingress | [{"protocol":"-1","rule_no":100,"action":"allow","cidr_block":"0.0.0.0/0","from_port":0,"to_port":0},{"protocol":"-1","rule_no":101,"action":"deny","ipv6_cidr_block":"::/0","from_port":0,"to_port":0}] |
| default_network_acl_egress | [{"protocol":"-1","rule_no":102,"action":"allow","cidr_block":"0.0.0.0/0","from_port":0,"to_port":0},{"protocol":"-1","rule_no":103,"action":"allow","ipv6_cidr_block":"::/0","from_port":0,"to_port":0}] |
| default_security_group_name | some_security_group |
| tags | {"Terraform":"true","Name":"Insurance Infrastructure VPC","Environment":"dev","Type":"Multi-AZ"} |

How could terraform-docs help solve your problem?

It will create summary infrastructure documentation that's easier to read for those, who don't really know terraform but needs information about infrastructure (for example devs, analytics etc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant