1. Packages
  2. Alicloud Provider
  3. API Docs
  4. vpc
  5. GatewayEndpointRouteTableAttachment
Alibaba Cloud v3.63.0 published on Monday, Sep 30, 2024 by Pulumi

alicloud.vpc.GatewayEndpointRouteTableAttachment

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.63.0 published on Monday, Sep 30, 2024 by Pulumi

    Provides a VPC Gateway Endpoint Route Table Attachment resource. VPC gateway node association route.

    For information about VPC Gateway Endpoint Route Table Attachment and how to use it, see What is Gateway Endpoint Route Table Attachment.

    NOTE: Available since v1.208.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const defaulteVpc = new alicloud.vpc.Network("defaulteVpc", {description: "test"});
    const defaultGE = new alicloud.vpc.GatewayEndpoint("defaultGE", {
        serviceName: "com.aliyun.cn-hangzhou.oss",
        policyDocument: `        {
              "Version": "1",
              "Statement": [{
                "Effect": "Allow",
                "Resource": ["*"],
                "Action": ["*"],
                "Principal": ["*"]
              }]
            }
    `,
        vpcId: defaulteVpc.id,
        gatewayEndpointDescrption: "test-gateway-endpoint",
        gatewayEndpointName: `${name}1`,
    });
    const defaultRT = new alicloud.vpc.RouteTable("defaultRT", {
        vpcId: defaulteVpc.id,
        routeTableName: `${name}2`,
    });
    const _default = new alicloud.vpc.GatewayEndpointRouteTableAttachment("default", {
        gatewayEndpointId: defaultGE.id,
        routeTableId: defaultRT.id,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    defaulte_vpc = alicloud.vpc.Network("defaulteVpc", description="test")
    default_ge = alicloud.vpc.GatewayEndpoint("defaultGE",
        service_name="com.aliyun.cn-hangzhou.oss",
        policy_document="""        {
              "Version": "1",
              "Statement": [{
                "Effect": "Allow",
                "Resource": ["*"],
                "Action": ["*"],
                "Principal": ["*"]
              }]
            }
    """,
        vpc_id=defaulte_vpc.id,
        gateway_endpoint_descrption="test-gateway-endpoint",
        gateway_endpoint_name=f"{name}1")
    default_rt = alicloud.vpc.RouteTable("defaultRT",
        vpc_id=defaulte_vpc.id,
        route_table_name=f"{name}2")
    default = alicloud.vpc.GatewayEndpointRouteTableAttachment("default",
        gateway_endpoint_id=default_ge.id,
        route_table_id=default_rt.id)
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		defaulteVpc, err := vpc.NewNetwork(ctx, "defaulteVpc", &vpc.NetworkArgs{
    			Description: pulumi.String("test"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultGE, err := vpc.NewGatewayEndpoint(ctx, "defaultGE", &vpc.GatewayEndpointArgs{
    			ServiceName: pulumi.String("com.aliyun.cn-hangzhou.oss"),
    			PolicyDocument: pulumi.String(`        {
              "Version": "1",
              "Statement": [{
                "Effect": "Allow",
                "Resource": ["*"],
                "Action": ["*"],
                "Principal": ["*"]
              }]
            }
    `),
    			VpcId:                     defaulteVpc.ID(),
    			GatewayEndpointDescrption: pulumi.String("test-gateway-endpoint"),
    			GatewayEndpointName:       pulumi.Sprintf("%v1", name),
    		})
    		if err != nil {
    			return err
    		}
    		defaultRT, err := vpc.NewRouteTable(ctx, "defaultRT", &vpc.RouteTableArgs{
    			VpcId:          defaulteVpc.ID(),
    			RouteTableName: pulumi.Sprintf("%v2", name),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = vpc.NewGatewayEndpointRouteTableAttachment(ctx, "default", &vpc.GatewayEndpointRouteTableAttachmentArgs{
    			GatewayEndpointId: defaultGE.ID(),
    			RouteTableId:      defaultRT.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var defaulteVpc = new AliCloud.Vpc.Network("defaulteVpc", new()
        {
            Description = "test",
        });
    
        var defaultGE = new AliCloud.Vpc.GatewayEndpoint("defaultGE", new()
        {
            ServiceName = "com.aliyun.cn-hangzhou.oss",
            PolicyDocument = @"        {
              ""Version"": ""1"",
              ""Statement"": [{
                ""Effect"": ""Allow"",
                ""Resource"": [""*""],
                ""Action"": [""*""],
                ""Principal"": [""*""]
              }]
            }
    ",
            VpcId = defaulteVpc.Id,
            GatewayEndpointDescrption = "test-gateway-endpoint",
            GatewayEndpointName = $"{name}1",
        });
    
        var defaultRT = new AliCloud.Vpc.RouteTable("defaultRT", new()
        {
            VpcId = defaulteVpc.Id,
            RouteTableName = $"{name}2",
        });
    
        var @default = new AliCloud.Vpc.GatewayEndpointRouteTableAttachment("default", new()
        {
            GatewayEndpointId = defaultGE.Id,
            RouteTableId = defaultRT.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.vpc.Network;
    import com.pulumi.alicloud.vpc.NetworkArgs;
    import com.pulumi.alicloud.vpc.GatewayEndpoint;
    import com.pulumi.alicloud.vpc.GatewayEndpointArgs;
    import com.pulumi.alicloud.vpc.RouteTable;
    import com.pulumi.alicloud.vpc.RouteTableArgs;
    import com.pulumi.alicloud.vpc.GatewayEndpointRouteTableAttachment;
    import com.pulumi.alicloud.vpc.GatewayEndpointRouteTableAttachmentArgs;
    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) {
            final var config = ctx.config();
            final var name = config.get("name").orElse("terraform-example");
            var defaulteVpc = new Network("defaulteVpc", NetworkArgs.builder()
                .description("test")
                .build());
    
            var defaultGE = new GatewayEndpoint("defaultGE", GatewayEndpointArgs.builder()
                .serviceName("com.aliyun.cn-hangzhou.oss")
                .policyDocument("""
            {
              "Version": "1",
              "Statement": [{
                "Effect": "Allow",
                "Resource": ["*"],
                "Action": ["*"],
                "Principal": ["*"]
              }]
            }
                """)
                .vpcId(defaulteVpc.id())
                .gatewayEndpointDescrption("test-gateway-endpoint")
                .gatewayEndpointName(String.format("%s1", name))
                .build());
    
            var defaultRT = new RouteTable("defaultRT", RouteTableArgs.builder()
                .vpcId(defaulteVpc.id())
                .routeTableName(String.format("%s2", name))
                .build());
    
            var default_ = new GatewayEndpointRouteTableAttachment("default", GatewayEndpointRouteTableAttachmentArgs.builder()
                .gatewayEndpointId(defaultGE.id())
                .routeTableId(defaultRT.id())
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      defaulteVpc:
        type: alicloud:vpc:Network
        properties:
          description: test
      defaultGE:
        type: alicloud:vpc:GatewayEndpoint
        properties:
          serviceName: com.aliyun.cn-hangzhou.oss
          policyDocument: |2
                    {
                      "Version": "1",
                      "Statement": [{
                        "Effect": "Allow",
                        "Resource": ["*"],
                        "Action": ["*"],
                        "Principal": ["*"]
                      }]
                    }
          vpcId: ${defaulteVpc.id}
          gatewayEndpointDescrption: test-gateway-endpoint
          gatewayEndpointName: ${name}1
      defaultRT:
        type: alicloud:vpc:RouteTable
        properties:
          vpcId: ${defaulteVpc.id}
          routeTableName: ${name}2
      default:
        type: alicloud:vpc:GatewayEndpointRouteTableAttachment
        properties:
          gatewayEndpointId: ${defaultGE.id}
          routeTableId: ${defaultRT.id}
    

    Create GatewayEndpointRouteTableAttachment Resource

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

    Constructor syntax

    new GatewayEndpointRouteTableAttachment(name: string, args: GatewayEndpointRouteTableAttachmentArgs, opts?: CustomResourceOptions);
    @overload
    def GatewayEndpointRouteTableAttachment(resource_name: str,
                                            args: GatewayEndpointRouteTableAttachmentArgs,
                                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def GatewayEndpointRouteTableAttachment(resource_name: str,
                                            opts: Optional[ResourceOptions] = None,
                                            gateway_endpoint_id: Optional[str] = None,
                                            route_table_id: Optional[str] = None)
    func NewGatewayEndpointRouteTableAttachment(ctx *Context, name string, args GatewayEndpointRouteTableAttachmentArgs, opts ...ResourceOption) (*GatewayEndpointRouteTableAttachment, error)
    public GatewayEndpointRouteTableAttachment(string name, GatewayEndpointRouteTableAttachmentArgs args, CustomResourceOptions? opts = null)
    public GatewayEndpointRouteTableAttachment(String name, GatewayEndpointRouteTableAttachmentArgs args)
    public GatewayEndpointRouteTableAttachment(String name, GatewayEndpointRouteTableAttachmentArgs args, CustomResourceOptions options)
    
    type: alicloud:vpc:GatewayEndpointRouteTableAttachment
    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 GatewayEndpointRouteTableAttachmentArgs
    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 GatewayEndpointRouteTableAttachmentArgs
    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 GatewayEndpointRouteTableAttachmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GatewayEndpointRouteTableAttachmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GatewayEndpointRouteTableAttachmentArgs
    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 gatewayEndpointRouteTableAttachmentResource = new AliCloud.Vpc.GatewayEndpointRouteTableAttachment("gatewayEndpointRouteTableAttachmentResource", new()
    {
        GatewayEndpointId = "string",
        RouteTableId = "string",
    });
    
    example, err := vpc.NewGatewayEndpointRouteTableAttachment(ctx, "gatewayEndpointRouteTableAttachmentResource", &vpc.GatewayEndpointRouteTableAttachmentArgs{
    	GatewayEndpointId: pulumi.String("string"),
    	RouteTableId:      pulumi.String("string"),
    })
    
    var gatewayEndpointRouteTableAttachmentResource = new GatewayEndpointRouteTableAttachment("gatewayEndpointRouteTableAttachmentResource", GatewayEndpointRouteTableAttachmentArgs.builder()
        .gatewayEndpointId("string")
        .routeTableId("string")
        .build());
    
    gateway_endpoint_route_table_attachment_resource = alicloud.vpc.GatewayEndpointRouteTableAttachment("gatewayEndpointRouteTableAttachmentResource",
        gateway_endpoint_id="string",
        route_table_id="string")
    
    const gatewayEndpointRouteTableAttachmentResource = new alicloud.vpc.GatewayEndpointRouteTableAttachment("gatewayEndpointRouteTableAttachmentResource", {
        gatewayEndpointId: "string",
        routeTableId: "string",
    });
    
    type: alicloud:vpc:GatewayEndpointRouteTableAttachment
    properties:
        gatewayEndpointId: string
        routeTableId: string
    

    GatewayEndpointRouteTableAttachment Resource Properties

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

    Inputs

    The GatewayEndpointRouteTableAttachment resource accepts the following input properties:

    GatewayEndpointId string
    The ID of the gateway endpoint instance to which you want to associate the route table.
    RouteTableId string
    Routing table ID.
    GatewayEndpointId string
    The ID of the gateway endpoint instance to which you want to associate the route table.
    RouteTableId string
    Routing table ID.
    gatewayEndpointId String
    The ID of the gateway endpoint instance to which you want to associate the route table.
    routeTableId String
    Routing table ID.
    gatewayEndpointId string
    The ID of the gateway endpoint instance to which you want to associate the route table.
    routeTableId string
    Routing table ID.
    gateway_endpoint_id str
    The ID of the gateway endpoint instance to which you want to associate the route table.
    route_table_id str
    Routing table ID.
    gatewayEndpointId String
    The ID of the gateway endpoint instance to which you want to associate the route table.
    routeTableId String
    Routing table ID.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    Status of the gateway endpoint.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    Status of the gateway endpoint.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    Status of the gateway endpoint.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    Status of the gateway endpoint.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    Status of the gateway endpoint.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    Status of the gateway endpoint.

    Look up Existing GatewayEndpointRouteTableAttachment Resource

    Get an existing GatewayEndpointRouteTableAttachment 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?: GatewayEndpointRouteTableAttachmentState, opts?: CustomResourceOptions): GatewayEndpointRouteTableAttachment
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            gateway_endpoint_id: Optional[str] = None,
            route_table_id: Optional[str] = None,
            status: Optional[str] = None) -> GatewayEndpointRouteTableAttachment
    func GetGatewayEndpointRouteTableAttachment(ctx *Context, name string, id IDInput, state *GatewayEndpointRouteTableAttachmentState, opts ...ResourceOption) (*GatewayEndpointRouteTableAttachment, error)
    public static GatewayEndpointRouteTableAttachment Get(string name, Input<string> id, GatewayEndpointRouteTableAttachmentState? state, CustomResourceOptions? opts = null)
    public static GatewayEndpointRouteTableAttachment get(String name, Output<String> id, GatewayEndpointRouteTableAttachmentState 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:
    GatewayEndpointId string
    The ID of the gateway endpoint instance to which you want to associate the route table.
    RouteTableId string
    Routing table ID.
    Status string
    Status of the gateway endpoint.
    GatewayEndpointId string
    The ID of the gateway endpoint instance to which you want to associate the route table.
    RouteTableId string
    Routing table ID.
    Status string
    Status of the gateway endpoint.
    gatewayEndpointId String
    The ID of the gateway endpoint instance to which you want to associate the route table.
    routeTableId String
    Routing table ID.
    status String
    Status of the gateway endpoint.
    gatewayEndpointId string
    The ID of the gateway endpoint instance to which you want to associate the route table.
    routeTableId string
    Routing table ID.
    status string
    Status of the gateway endpoint.
    gateway_endpoint_id str
    The ID of the gateway endpoint instance to which you want to associate the route table.
    route_table_id str
    Routing table ID.
    status str
    Status of the gateway endpoint.
    gatewayEndpointId String
    The ID of the gateway endpoint instance to which you want to associate the route table.
    routeTableId String
    Routing table ID.
    status String
    Status of the gateway endpoint.

    Import

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

    $ pulumi import alicloud:vpc/gatewayEndpointRouteTableAttachment:GatewayEndpointRouteTableAttachment example <gateway_endpoint_id>:<route_table_id>
    

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

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.63.0 published on Monday, Sep 30, 2024 by Pulumi