Carina

Resource

aws.ec2.SubnetRouteTableAssociation

Describes an association between a route table and a subnet or gateway.

Example

let vpc = aws.ec2.Vpc {
  cidr_block = '10.0.0.0/16'

  tags = {
    Environment = 'example'
  }
}

let subnet = aws.ec2.Subnet {
  vpc_id            = vpc.vpc_id
  cidr_block        = '10.0.1.0/24'
  availability_zone = aws.AvailabilityZone.ZoneName.ap_northeast_1a

  tags = {
    Environment = 'example'
  }
}

let route_table = aws.ec2.RouteTable {
  vpc_id = vpc.vpc_id

  tags = {
    Environment = 'example'
  }
}

aws.ec2.SubnetRouteTableAssociation {
  subnet_id      = subnet.subnet_id
  route_table_id = route_table.route_table_id
}

Argument Reference

route_table_id

The ID of the route table.

subnet_id

The ID of the subnet.