AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::EC2::GatewayRouteTableAssociation

CfnGatewayRouteTableAssociation

Associates a virtual private gateway or internet gateway with a route table. The gateway and route table must be in the same VPC. This association causes the incoming traffic to the gateway to be routed according to the routes in the route table.

Import

import { CfnGatewayRouteTableAssociation } from 'aws-cdk-lib/aws-ec2';

Or use the module namespace:

import * as ec2 from 'aws-cdk-lib/aws-ec2';
// ec2.CfnGatewayRouteTableAssociation

Properties

Configuration passed to the constructor as CfnGatewayRouteTableAssociationProps.

gatewayIdRequired
string | IInternetGatewayRef | IVPNGatewayRef

The ID of the gateway.

routeTableIdRequired
string | IRouteTableRef

The ID of the route table.

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Get the Amazon EC2 Cheat Sheet

Everything you need to know about Amazon EC2 on one page. HD quality, print-friendly.

Download Free Infographic