> **Experimental**
>
> `@aws-cdk/aws-ec2-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# AttachVpcOptions

Options for creating an Attachment via the attachVpc() method.

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/transit-gateway-vpc-attachment.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0-alpha.0/packages/@aws-cdk/aws-ec2-alpha/lib/transit-gateway-vpc-attachment.ts#L106)

## Example

```ts
const transitGateway = new TransitGateway(this, 'MyTransitGateway');
const routeTable = transitGateway.addRouteTable('CustomRouteTable');

const myVpc = new VpcV2(this, 'Vpc');
const subnet = new SubnetV2(this, 'Subnet', {
  vpc: myVpc,
  availabilityZone: 'eu-west-2a',
  ipv4CidrBlock: new IpCidr('10.0.0.0/24'),
  subnetType: SubnetType.PUBLIC
});

const attachment = transitGateway.attachVpc('VpcAttachment', {
  vpc: myVpc,
  subnets: [subnet]
});

// Add a static route to direct traffic
routeTable.addRoute('StaticRoute', attachment, '10.0.0.0/16');

// Block unwanted traffic with a blackhole route
routeTable.addBlackholeRoute('BlackholeRoute', '172.16.0.0/16');
```

## Properties

- `associationRouteTable`: [ITransitGatewayRouteTable](/cdk/api/v2/docs/@aws-cdk_aws-ec2-alpha.ITransitGatewayRouteTable.html) — An optional route table to associate with this VPC attachment.

  **Default:** No associations will be created unless it is for the default route table and automatic association is enabled.

- `propagationRouteTables`: [ITransitGatewayRouteTable](/cdk/api/v2/docs/@aws-cdk_aws-ec2-alpha.ITransitGatewayRouteTable.html)[] — A list of optional route tables to propagate routes to.

  **Default:** No propagations will be created unless it is for the default route table and automatic propagation is enabled.

- `subnets`: [ISubnet](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.ISubnet.html)[] (required) — A list of one or more subnets to place the attachment in.

  It is recommended to specify more subnets for better availability.

- `transitGatewayAttachmentName`: string — Physical name of this Transit Gateway VPC Attachment.

  **Default:** Assigned by CloudFormation.

- `vpc`: [IVpc](/cdk/api/v2/docs/aws-cdk-lib.aws_ec2.IVpc.html) (required) — A VPC attachment(s) will get assigned to.

- `vpcAttachmentOptions`: [ITransitGatewayVpcAttachmentOptions](/cdk/api/v2/docs/@aws-cdk_aws-ec2-alpha.ITransitGatewayVpcAttachmentOptions.html) — The VPC attachment options.

  **Default:** All options are disabled.
