1.1.0 • Published 3 years ago

tfmdcli v1.1.0

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

tfmdcli

Terraform Markdown CLI is a tool to convert your terraform variables or outputs into a markdown table, or to create markdown formatted example module blocks.

Usage

tfmdcli <file_path> <flags>

Flags

FlagDescriptionExample
-o | --output-onlyOutput only the given fields in the table. A comma separated list must be passedtfmdcli <file_path> -o name,default
-b | --breaksAdd line breaks to the 'default' field of a variable filetfmdcli <file_path> -b
-a | --add-columnsAdd additional empty columns to the table. A comma separated list must be passed.tfmdcli <file_path> -a name,default
-m | --moduleThe module name to use when creating an example module from a variables file. A string is required. This must be used with the --source tag. This cannot be used with any tags other than -s.tfmdcli <file_path> -m example -s ./module/example
-s | --sourceThe file path to use when creating an example module from a variables file. A string is required. This must be used with the --module tag.This cannot be used with any tags other than -m.tfmdcli <file_path> -m example -s ./module/example
-t | --tfvarsCreate a tfvars from a variables file. This cannot be used with any tags other than -itfmdcli <file_path> -t
-i | --ignore-defaultsIgnore defaults when creating a tfvars file. This will create an empty tfvar variable for each of variables in the file. Can only be used with -ttfmdcli <file_path> -t -i

Examples

Example Variable Table

This is an example table from an example variable file using tfmdcli example.tf -b

NameTypeDescriptionSensitiveDefault
api_keystringThe API key needed to deploy resourcestrue
security_group_rulesMap of security group rules to be added to default security group{allow_all_inbound = {source = "0.0.0.0/0"direction = "inbound"}}
disable_public_service_endpointboolDisable public service endpoint for clusterfalse
spoke_vpc_cidr_blocksobject({ zone-1 = list(string) zone-2 = list(string) zone-3 = list(string) })An object containing lists of CIDR blocks. Each CIDR block will be used to create a subnet{zone-1 = "10.10.10.0/24",zone-2 = "10.40.10.0/24",zone-3 = "10.70.10.0/24"}
tagslist(string)A list of tags to add to the cluster"tag-1","tag-2"

Example Module

This is an example table from an example variable file using tfmdcli example.tf -m=example -s=example/

module example {
  source                          = "example/"
  api_key                         = var.api_key
  security_group_rules            = var.security_group_rules
  disable_public_service_endpoint = var.disable_public_service_endpoint
  spoke_vpc_cidr_blocks           = var.spoke_vpc_cidr_blocks
  tags                            = var.tags
}

Example Tfvars

This is an example table from an example variable file using tfmdcli example.tf -t -i

api_key=""
security_group_rules=""
disable_public_service_endpoint=true
spoke_vpc_cidr_blocks={
    zone-1=[""]
    zone-2=[""]
    zone-3=[""]
}
tags=[]
1.1.0

3 years ago

1.0.0

4 years ago