Skip to content

Commit

Permalink
Feature - transit_gateway_connect_peer - set `transit_gateway_address…
Browse files Browse the repository at this point in the history
…` as optional (#66)

* set `transit_gateway_address` as optional

* Continuous Integration - terraform fmt and terraform-docs

* updated readme with new example for cidr_blocks

---------

Co-authored-by: zachreborn <[email protected]>
  • Loading branch information
zachreborn and zachreborn authored Oct 31, 2024
1 parent aaeefa6 commit df468f8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
16 changes: 15 additions & 1 deletion modules/aws/transit_gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@

<!-- USAGE EXAMPLES -->
## Usage

### Simple Example
Simple example of how to use the module. This creates a transit gateway with the name "sdwan_tgw".
```
module "transit_gateway" {
source = "github.com/zachreborn/terraform-modules//modules/aws/transit_gateway"
Expand All @@ -71,6 +72,19 @@ module "transit_gateway" {
}
```

### Example with CIDR blocks
This example creates a transit gateway with the name "sdwan_tgw" and CIDR blocks of `10.100.0.0/24`
```
module "transit_gateway" {
source = "github.com/zachreborn/terraform-modules//modules/aws/transit_gateway"
name = "sdwan_tgw"
transit_gateway_cidr_blocks = [
"10.100.0.0/24"
]
}
```

_For more examples, please refer to the [Documentation](https://github.com/zachreborn/terraform-modules)_

<p align="right">(<a href="#readme-top">back to top</a>)</p>
Expand Down
2 changes: 1 addition & 1 deletion modules/aws/transit_gateway_connect_peer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ No modules.
| <a name="input_name"></a> [name](#input\_name) | (Required) The name of the transit gateway | `string` | n/a | yes |
| <a name="input_peer_address"></a> [peer\_address](#input\_peer\_address) | (Required) The IP addressed assigned to customer device, which will be used as tunnel endpoint. It can be IPv4 or IPv6 address, but must be the same address family as transit\_gateway\_address | `string` | n/a | yes |
| <a name="input_tags"></a> [tags](#input\_tags) | (Optional) Key-value tags for the EC2 Transit Gateway Connect. If configured with a provider default\_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level. | `map(any)` | <pre>{<br/> "environment": "prod",<br/> "project": "core_infrastructure",<br/> "terraform": "true"<br/>}</pre> | no |
| <a name="input_transit_gateway_address"></a> [transit\_gateway\_address](#input\_transit\_gateway\_address) | (Required) The IP address assigned to Transit Gateway, which will be used as tunnel endpoint. This address must be from associated Transit Gateway CIDR block. The address must be from the same address family as peer\_address. If not set explicitly, it will be selected from associated Transit Gateway CIDR blocks | `string` | n/a | yes |
| <a name="input_transit_gateway_address"></a> [transit\_gateway\_address](#input\_transit\_gateway\_address) | (Optional) The IP address assigned to Transit Gateway, which will be used as tunnel endpoint. This address must be from associated Transit Gateway CIDR block. The address must be from the same address family as peer\_address. If not set explicitly, it will be selected from associated Transit Gateway CIDR blocks | `string` | `null` | no |
| <a name="input_transit_gateway_attachment_id"></a> [transit\_gateway\_attachment\_id](#input\_transit\_gateway\_attachment\_id) | (Required) The Transit Gateway Connect | `string` | n/a | yes |

## Outputs
Expand Down
5 changes: 3 additions & 2 deletions modules/aws/transit_gateway_connect_peer/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ variable "inside_cidr_blocks" {
}

variable "name" {
description = "(Required) The name of the transit gateway"
type = string
description = "(Required) The name of the transit gateway"
}

variable "peer_address" {
Expand All @@ -31,7 +31,8 @@ variable "tags" {

variable "transit_gateway_address" {
type = string
description = "(Required) The IP address assigned to Transit Gateway, which will be used as tunnel endpoint. This address must be from associated Transit Gateway CIDR block. The address must be from the same address family as peer_address. If not set explicitly, it will be selected from associated Transit Gateway CIDR blocks"
description = "(Optional) The IP address assigned to Transit Gateway, which will be used as tunnel endpoint. This address must be from associated Transit Gateway CIDR block. The address must be from the same address family as peer_address. If not set explicitly, it will be selected from associated Transit Gateway CIDR blocks"
default = null
}

variable "transit_gateway_attachment_id" {
Expand Down

0 comments on commit df468f8

Please sign in to comment.