1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Core
  5. RouteTableAttachment
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

oci.Core.RouteTableAttachment

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

    This resource provides the ability to associate a route table for a subnet in Oracle Cloud Infrastructure Core service.

    Attaches the specified route table to the specified subnet.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testRouteTableAttachment = new oci.core.RouteTableAttachment("test_route_table_attachment", {
        subnetId: testSubnet.id,
        routeTableId: testRouteTable.id,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_route_table_attachment = oci.core.RouteTableAttachment("test_route_table_attachment",
        subnet_id=test_subnet["id"],
        route_table_id=test_route_table["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/Core"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := Core.NewRouteTableAttachment(ctx, "test_route_table_attachment", &Core.RouteTableAttachmentArgs{
    			SubnetId:     pulumi.Any(testSubnet.Id),
    			RouteTableId: pulumi.Any(testRouteTable.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testRouteTableAttachment = new Oci.Core.RouteTableAttachment("test_route_table_attachment", new()
        {
            SubnetId = testSubnet.Id,
            RouteTableId = testRouteTable.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.Core.RouteTableAttachment;
    import com.pulumi.oci.Core.RouteTableAttachmentArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var testRouteTableAttachment = new RouteTableAttachment("testRouteTableAttachment", RouteTableAttachmentArgs.builder()
                .subnetId(testSubnet.id())
                .routeTableId(testRouteTable.id())
                .build());
    
        }
    }
    
    resources:
      testRouteTableAttachment:
        type: oci:Core:RouteTableAttachment
        name: test_route_table_attachment
        properties:
          subnetId: ${testSubnet.id}
          routeTableId: ${testRouteTable.id}
    

    Create RouteTableAttachment Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new RouteTableAttachment(name: string, args: RouteTableAttachmentArgs, opts?: CustomResourceOptions);
    @overload
    def RouteTableAttachment(resource_name: str,
                             args: RouteTableAttachmentArgs,
                             opts: Optional[ResourceOptions] = None)
    
    @overload
    def RouteTableAttachment(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             route_table_id: Optional[str] = None,
                             subnet_id: Optional[str] = None)
    func NewRouteTableAttachment(ctx *Context, name string, args RouteTableAttachmentArgs, opts ...ResourceOption) (*RouteTableAttachment, error)
    public RouteTableAttachment(string name, RouteTableAttachmentArgs args, CustomResourceOptions? opts = null)
    public RouteTableAttachment(String name, RouteTableAttachmentArgs args)
    public RouteTableAttachment(String name, RouteTableAttachmentArgs args, CustomResourceOptions options)
    
    type: oci:Core:RouteTableAttachment
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args RouteTableAttachmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args RouteTableAttachmentArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args RouteTableAttachmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RouteTableAttachmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RouteTableAttachmentArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var routeTableAttachmentResource = new Oci.Core.RouteTableAttachment("routeTableAttachmentResource", new()
    {
        RouteTableId = "string",
        SubnetId = "string",
    });
    
    example, err := Core.NewRouteTableAttachment(ctx, "routeTableAttachmentResource", &Core.RouteTableAttachmentArgs{
    	RouteTableId: pulumi.String("string"),
    	SubnetId:     pulumi.String("string"),
    })
    
    var routeTableAttachmentResource = new RouteTableAttachment("routeTableAttachmentResource", RouteTableAttachmentArgs.builder()
        .routeTableId("string")
        .subnetId("string")
        .build());
    
    route_table_attachment_resource = oci.core.RouteTableAttachment("routeTableAttachmentResource",
        route_table_id="string",
        subnet_id="string")
    
    const routeTableAttachmentResource = new oci.core.RouteTableAttachment("routeTableAttachmentResource", {
        routeTableId: "string",
        subnetId: "string",
    });
    
    type: oci:Core:RouteTableAttachment
    properties:
        routeTableId: string
        subnetId: string
    

    RouteTableAttachment Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The RouteTableAttachment resource accepts the following input properties:

    RouteTableId string
    The OCID of the route table.
    SubnetId string
    The OCID of the subnet.
    RouteTableId string
    The OCID of the route table.
    SubnetId string
    The OCID of the subnet.
    routeTableId String
    The OCID of the route table.
    subnetId String
    The OCID of the subnet.
    routeTableId string
    The OCID of the route table.
    subnetId string
    The OCID of the subnet.
    route_table_id str
    The OCID of the route table.
    subnet_id str
    The OCID of the subnet.
    routeTableId String
    The OCID of the route table.
    subnetId String
    The OCID of the subnet.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the RouteTableAttachment resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing RouteTableAttachment Resource

    Get an existing RouteTableAttachment resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: RouteTableAttachmentState, opts?: CustomResourceOptions): RouteTableAttachment
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            route_table_id: Optional[str] = None,
            subnet_id: Optional[str] = None) -> RouteTableAttachment
    func GetRouteTableAttachment(ctx *Context, name string, id IDInput, state *RouteTableAttachmentState, opts ...ResourceOption) (*RouteTableAttachment, error)
    public static RouteTableAttachment Get(string name, Input<string> id, RouteTableAttachmentState? state, CustomResourceOptions? opts = null)
    public static RouteTableAttachment get(String name, Output<String> id, RouteTableAttachmentState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    RouteTableId string
    The OCID of the route table.
    SubnetId string
    The OCID of the subnet.
    RouteTableId string
    The OCID of the route table.
    SubnetId string
    The OCID of the subnet.
    routeTableId String
    The OCID of the route table.
    subnetId String
    The OCID of the subnet.
    routeTableId string
    The OCID of the route table.
    subnetId string
    The OCID of the subnet.
    route_table_id str
    The OCID of the route table.
    subnet_id str
    The OCID of the subnet.
    routeTableId String
    The OCID of the route table.
    subnetId String
    The OCID of the subnet.

    Import

    Route Table Attachment can be imported using the id, e.g.

    $ pulumi import oci:Core/routeTableAttachment:RouteTableAttachment test_route_table_attachment "{subnetId}/{routeTableId}"
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi