From 040e3270385d4c1a03ac4245d4f4ea73568b5bf1 Mon Sep 17 00:00:00 2001 From: Kassian Houben Date: Fri, 28 Jan 2022 13:17:52 +1300 Subject: [PATCH] docs: update outputs --- README.md | 64 ++++++++++++++++++++++++------------------------ README.tfdoc.hcl | 49 ++++++++++++++++++------------------ 2 files changed, 57 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index c9f263c..ce322fb 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ See [variables.tf] and [examples/] for details and use-cases. Default is `true`. -- [**`module_depends_on`**](#var-module_depends_on): *(Optional `list(dependencies)`)* +- [**`module_depends_on`**](#var-module_depends_on): *(Optional `list(dependency)`)* A list of dependencies. Any object can be _assigned_ to this list to define a hidden external dependency. @@ -124,7 +124,7 @@ See [variables.tf] and [examples/] for details and use-cases. BGP information specific to this router. - Each `bgp` object can have the following fields: + Each `bgp` object can have the following fields: Example: @@ -141,37 +141,37 @@ See [variables.tf] and [examples/] for details and use-cases. } ``` - The object accepts the following attributes: + The `bgp` object accepts the following attributes: - - [**`asn`**](#attr-asn-bgp): *(**Required** `string`)* + - [**`asn`**](#attr-bgp-asn): *(**Required** `string`)* Local BGP Autonomous System Number `(ASN)`. Must be an RFC6996 private ASN, either `16-bit` or `32-bit`. The value will be fixed for this router resource. All VPN tunnels that link to this router will have the same local ASN. - - [**`advertise_mode`**](#attr-advertise_mode-bgp): *(Optional `string`)* + - [**`advertise_mode`**](#attr-bgp-advertise_mode): *(Optional `string`)* User-specified flag to indicate which mode to use for advertisement. Possible values are `DEFAULT` and `CUSTOM`. Default is `"DEFAULT"`. - - [**`advertised_groups`**](#attr-advertised_groups-bgp): *(Optional `list(string)`)* + - [**`advertised_groups`**](#attr-bgp-advertised_groups): *(Optional `list(string)`)* User-specified list of prefix groups to advertise in custom mode. This field can only be populated if advertiseMode is `CUSTOM` and is advertised to all peers of the router. These groups will be advertised in addition to any specified prefixes. Leave this field blank to advertise no custom groups. This enum field has the one valid value: `ALL_SUBNETS` Default is `[]`. - - [**`advertised_ip_ranges`**](#attr-advertised_ip_ranges-bgp): *(Optional `list(advertised_ip_ranges)`)* + - [**`advertised_ip_ranges`**](#attr-bgp-advertised_ip_ranges): *(Optional `list(advertised_ip_range)`)* User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertiseMode is `CUSTOM` and is advertised to all peers of the router. These IP ranges will be advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges. Default is `[]`. - The object accepts the following attributes: + Each `advertised_ip_range` object in the list accepts the following attributes: - - [**`range`**](#attr-range-advertised_ip_ranges-bgp): *(**Required** `string`)* + - [**`range`**](#attr-bgp-advertised_ip_ranges-range): *(**Required** `string`)* The IP range to advertise. The value must be a CIDR-formatted string. - - [**`description`**](#attr-description-advertised_ip_ranges-bgp): *(Optional `string`)* + - [**`description`**](#attr-bgp-advertised_ip_ranges-description): *(Optional `string`)* User-specified description for the IP range. @@ -185,93 +185,93 @@ See [variables.tf] and [examples/] for details and use-cases. Default is `[]`. - The object accepts the following attributes: + Each `nat` object in the list accepts the following attributes: - - [**`name`**](#attr-name-nats): *(**Required** `string`)* + - [**`name`**](#attr-nats-name): *(**Required** `string`)* Name of the NAT. - - [**`nat_ip_allocate_option`**](#attr-nat_ip_allocate_option-nats): *(Optional `string`)* + - [**`nat_ip_allocate_option`**](#attr-nats-nat_ip_allocate_option): *(Optional `string`)* How external IPs should be allocated for this NAT. Default is `"AUTO_ONLY"`. - - [**`source_subnetwork_ip_ranges_to_nat`**](#attr-source_subnetwork_ip_ranges_to_nat-nats): *(Optional `string`)* + - [**`source_subnetwork_ip_ranges_to_nat`**](#attr-nats-source_subnetwork_ip_ranges_to_nat): *(Optional `string`)* How NAT should be configured per Subnetwork. Default is `"ALL_SUBNETWORKS_ALL_IP_RANGES"`. - - [**`nat_ips`**](#attr-nat_ips-nats): *(Optional `list(number)`)* + - [**`nat_ips`**](#attr-nats-nat_ips): *(Optional `list(number)`)* Self-links of NAT IPs. Only valid if `natIpAllocateOption` is set to MANUAL_ONLY. - - [**`min_ports_per_vm`**](#attr-min_ports_per_vm-nats): *(Optional `number`)* + - [**`min_ports_per_vm`**](#attr-nats-min_ports_per_vm): *(Optional `number`)* Minimum number of ports allocated to a VM from this NAT. - - [**`udp_idle_timeout_sec`**](#attr-udp_idle_timeout_sec-nats): *(Optional `number`)* + - [**`udp_idle_timeout_sec`**](#attr-nats-udp_idle_timeout_sec): *(Optional `number`)* Timeout (in seconds) for UDP connections. Default is `30`. - - [**`icmp_idle_timeout_sec`**](#attr-icmp_idle_timeout_sec-nats): *(Optional `number`)* + - [**`icmp_idle_timeout_sec`**](#attr-nats-icmp_idle_timeout_sec): *(Optional `number`)* Timeout (in seconds) for ICMP connections. Default is `30`. - - [**`tcp_established_idle_timeout_sec`**](#attr-tcp_established_idle_timeout_sec-nats): *(Optional `number`)* + - [**`tcp_established_idle_timeout_sec`**](#attr-nats-tcp_established_idle_timeout_sec): *(Optional `number`)* Timeout (in seconds) for TCP established connections. Default is `1200`. - - [**`tcp_transitory_idle_timeout_sec`**](#attr-tcp_transitory_idle_timeout_sec-nats): *(Optional `number`)* + - [**`tcp_transitory_idle_timeout_sec`**](#attr-nats-tcp_transitory_idle_timeout_sec): *(Optional `number`)* Timeout (in seconds) for TCP transitory connections. Default is `30`. - - [**`log_config`**](#attr-log_config-nats): *(Optional `object`)* + - [**`log_config`**](#attr-nats-log_config): *(Optional `object(log_config)`)* Configuration for logging on NAT. Default is `[]`. - The object accepts the following attributes: + The `log_config` object accepts the following attributes: - - [**`enabled`**](#attr-enabled-log_config-nats): *(**Required** `bool`)* + - [**`enabled`**](#attr-nats-log_config-enabled): *(**Required** `bool`)* Indicates whether or not to export logs. Default is `true`. - - [**`filter`**](#attr-filter-log_config-nats): *(**Required** `string`)* + - [**`filter`**](#attr-nats-log_config-filter): *(**Required** `string`)* Specifies the desired filtering of logs on this NAT. Default is `"ALL"`. - - [**`subnetworks`**](#attr-subnetworks-nats): *(Optional `list(subnetwork)`)* + - [**`subnetworks`**](#attr-nats-subnetworks): *(Optional `list(subnetwork)`)* Configuration for logging on NAT. Default is `[]`. - The object accepts the following attributes: + Each `subnetwork` object in the list accepts the following attributes: - - [**`name`**](#attr-name-subnetworks-nats): *(**Required** `string`)* + - [**`name`**](#attr-nats-subnetworks-name): *(**Required** `string`)* Self-link of subnetwork to NAT. - - [**`source_ip_ranges_to_nat`**](#attr-source_ip_ranges_to_nat-subnetworks-nats): *(**Required** `string`)* + - [**`source_ip_ranges_to_nat`**](#attr-nats-subnetworks-source_ip_ranges_to_nat): *(**Required** `string`)* List of options for which source IPs in the subnetwork should have NAT enabled. - - [**`secondary_ip_range_names`**](#attr-secondary_ip_range_names-subnetworks-nats): *(Optional `string`)* + - [**`secondary_ip_range_names`**](#attr-nats-subnetworks-secondary_ip_range_names): *(Optional `string`)* List of the secondary ranges of the subnetwork that are allowed to use NAT. @@ -281,15 +281,15 @@ See [variables.tf] and [examples/] for details and use-cases. The following attributes are exported in the outputs of the module: -- **`module_enabled`** +- [**`module_enabled`**](#output-module_enabled): *(`bool`)* Whether this module is enabled. -- **`router`** +- [**`router`**](#output-router): *(`object(router)`)* The outputs of the created Cloud Router. -- **`nats`** +- [**`nats`**](#output-nats): *(`list(nat)`)* The outputs of the create Cloud NATs. diff --git a/README.tfdoc.hcl b/README.tfdoc.hcl index c87cfc4..00ec5a9 100644 --- a/README.tfdoc.hcl +++ b/README.tfdoc.hcl @@ -110,8 +110,7 @@ section { } variable "module_depends_on" { - type = any - readme_type = "list(dependencies)" + type = list(dependency) description = <<-END A list of dependencies. Any object can be _assigned_ to this list to define a hidden external dependency. END @@ -158,8 +157,7 @@ section { } variable "bgp" { - type = any - readme_type = "object(bgp)" + type = object(bgp) description = <<-END BGP information specific to this router. @@ -203,8 +201,7 @@ section { } attribute "advertised_ip_ranges" { - type = any - readme_type = "list(advertised_ip_ranges)" + type = list(advertised_ip_range) default = [] description = <<-END User-specified list of individual IP ranges to advertise in custom mode. This field can only be populated if advertiseMode is `CUSTOM` and is advertised to all peers of the router. These IP ranges will be advertised in addition to any specified groups. Leave this field blank to advertise no custom IP ranges. @@ -235,8 +232,7 @@ section { title = "Terraform google cloud router nat" variable "nats" { - type = any - readme_type = "list(nat)" + type = list(nat) default = [] description = <<-END NATs to deploy on this router. @@ -313,8 +309,7 @@ section { } attribute "log_config" { - type = any - readme_type = "object" + type = object(log_config) default = [] description = <<-END Configuration for logging on NAT. @@ -340,8 +335,7 @@ section { } attribute "subnetworks" { - type = any - readme_type = "list(subnetwork)" + type = list(subnetwork) default = [] description = <<-END Configuration for logging on NAT. @@ -381,35 +375,42 @@ section { title = "Module Outputs" content = <<-END The following attributes are exported in the outputs of the module: + END - - **`module_enabled`** - + output "module_enabled" { + type = bool + description = <<-END Whether this module is enabled. + END + } - - **`router`** - + output "router" { + type = object(router) + description = <<-END The outputs of the created Cloud Router. + END + } - - **`nats`** - + output "nats" { + type = list(nat) + description = <<-END The outputs of the create Cloud NATs. - END + END + } } section { - title = "External Documentation" + title = "External Documentation" section { - title = "Google Documentation" - + title = "Google Documentation" content = <<-END - Router: END } section { - title = "Terraform Google Provider Documentation" - + title = "Terraform Google Provider Documentation" content = <<-END - -