# transit-gateway-vpc-attachment

## Overview

Manages the accepter side of a cross-account transit gateway VPC attachment and the routing for that attachment.

## Usage

The VPC attachment must first be created in the requester account (i.e. the account containing the VPC to be attached).

This will create an attachment in the accepter account in a state of pending acceptance. The ID of that attachment
should be provided as the value of the `transit_gateway_attachmend_id` variable.

The `vpc_name` variable is used to tag the VPC attachment and should be unique.

### Routing

The module will manage a dedicated route table for the VPC attachment.

The routes for this route table can be provided using one or both of the `routes` and `managed_prefix_list_references`
variables.

### Example

```
module "transit_gateway_attachment" {
  source = "git@github.com:theorchard/terraform-transit-gateway.git//modules/transit-gateway-vpc-attachment?ref=X.X.X"

  transit_gateway_attachment_id = "tgw-attach-01234567890abcdef"
  environment                   = "networking"
  vpc_name                      = "some-vpc"

  routes = {
    "10.0.0.0/16" = "tgw-attach-00000000000000000"
    "10.1.0.0/16" = "tgw-attach-11111111111111111"
  }

  managed_prefix_list_references = {
    "pl-00000000000000000" = "tgw-attach-22222222222222222"
    "pl-11111111111111111" = "tgw-attach-33333333333333333"
  }
}
```
