pulumi_wasm_providers_aws_mini::ec2

Module route_table_association

source
Expand description

Provides a resource to create an association between a route table and a subnet or a route table and an internet gateway or virtual private gateway.

§Example Usage

use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
    let a = route_table_association::create(
        "a",
        RouteTableAssociationArgs::builder()
            .route_table_id("${bar.id}")
            .subnet_id("${foo.id}")
            .build_struct(),
    );
}
use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
    let b = route_table_association::create(
        "b",
        RouteTableAssociationArgs::builder()
            .gateway_id("${foo.id}")
            .route_table_id("${bar.id}")
            .build_struct(),
    );
}

§Import

With EC2 Internet Gateways:

Using pulumi import to import EC2 Route Table Associations using the associated resource ID and Route Table ID separated by a forward slash (/). For example:

With EC2 Subnets:

$ pulumi import aws:ec2/routeTableAssociation:RouteTableAssociation assoc subnet-6777656e646f6c796e/rtb-656c65616e6f72

With EC2 Internet Gateways:

$ pulumi import aws:ec2/routeTableAssociation:RouteTableAssociation assoc igw-01b3a60780f8d034a/rtb-656c65616e6f72

Structs§

Functions§

  • Registers a new resource with the given unique name and arguments