alicloud.vpc.GatewayRouteTableAttachment
Explore with Pulumi AI
Provides a VPC Gateway Route Table Attachment resource.
For information about VPC Gateway Route Table Attachment and how to use it, see What is Gateway Route Table Attachment.
NOTE: Available in v1.194.0+.
Example Usage
Basic Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var exampleNetwork = new AliCloud.Vpc.Network("exampleNetwork", new()
{
CidrBlock = "172.16.0.0/12",
VpcName = "terraform-example",
});
var exampleRouteTable = new AliCloud.Vpc.RouteTable("exampleRouteTable", new()
{
VpcId = exampleNetwork.Id,
RouteTableName = "terraform-example",
Description = "terraform-example",
AssociateType = "Gateway",
});
var exampleIpv4Gateway = new AliCloud.Vpc.Ipv4Gateway("exampleIpv4Gateway", new()
{
Ipv4GatewayName = "terraform-example",
VpcId = exampleNetwork.Id,
Enabled = true,
});
var exampleGatewayRouteTableAttachment = new AliCloud.Vpc.GatewayRouteTableAttachment("exampleGatewayRouteTableAttachment", new()
{
Ipv4GatewayId = exampleIpv4Gateway.Id,
RouteTableId = exampleRouteTable.Id,
});
});
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleNetwork, err := vpc.NewNetwork(ctx, "exampleNetwork", &vpc.NetworkArgs{
CidrBlock: pulumi.String("172.16.0.0/12"),
VpcName: pulumi.String("terraform-example"),
})
if err != nil {
return err
}
exampleRouteTable, err := vpc.NewRouteTable(ctx, "exampleRouteTable", &vpc.RouteTableArgs{
VpcId: exampleNetwork.ID(),
RouteTableName: pulumi.String("terraform-example"),
Description: pulumi.String("terraform-example"),
AssociateType: pulumi.String("Gateway"),
})
if err != nil {
return err
}
exampleIpv4Gateway, err := vpc.NewIpv4Gateway(ctx, "exampleIpv4Gateway", &vpc.Ipv4GatewayArgs{
Ipv4GatewayName: pulumi.String("terraform-example"),
VpcId: exampleNetwork.ID(),
Enabled: pulumi.Bool(true),
})
if err != nil {
return err
}
_, err = vpc.NewGatewayRouteTableAttachment(ctx, "exampleGatewayRouteTableAttachment", &vpc.GatewayRouteTableAttachmentArgs{
Ipv4GatewayId: exampleIpv4Gateway.ID(),
RouteTableId: exampleRouteTable.ID(),
})
if err != nil {
return err
}
return nil
})
}
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.RouteTable;
import com.pulumi.alicloud.vpc.RouteTableArgs;
import com.pulumi.alicloud.vpc.Ipv4Gateway;
import com.pulumi.alicloud.vpc.Ipv4GatewayArgs;
import com.pulumi.alicloud.vpc.GatewayRouteTableAttachment;
import com.pulumi.alicloud.vpc.GatewayRouteTableAttachmentArgs;
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 exampleNetwork = new Network("exampleNetwork", NetworkArgs.builder()
.cidrBlock("172.16.0.0/12")
.vpcName("terraform-example")
.build());
var exampleRouteTable = new RouteTable("exampleRouteTable", RouteTableArgs.builder()
.vpcId(exampleNetwork.id())
.routeTableName("terraform-example")
.description("terraform-example")
.associateType("Gateway")
.build());
var exampleIpv4Gateway = new Ipv4Gateway("exampleIpv4Gateway", Ipv4GatewayArgs.builder()
.ipv4GatewayName("terraform-example")
.vpcId(exampleNetwork.id())
.enabled("true")
.build());
var exampleGatewayRouteTableAttachment = new GatewayRouteTableAttachment("exampleGatewayRouteTableAttachment", GatewayRouteTableAttachmentArgs.builder()
.ipv4GatewayId(exampleIpv4Gateway.id())
.routeTableId(exampleRouteTable.id())
.build());
}
}
import pulumi
import pulumi_alicloud as alicloud
example_network = alicloud.vpc.Network("exampleNetwork",
cidr_block="172.16.0.0/12",
vpc_name="terraform-example")
example_route_table = alicloud.vpc.RouteTable("exampleRouteTable",
vpc_id=example_network.id,
route_table_name="terraform-example",
description="terraform-example",
associate_type="Gateway")
example_ipv4_gateway = alicloud.vpc.Ipv4Gateway("exampleIpv4Gateway",
ipv4_gateway_name="terraform-example",
vpc_id=example_network.id,
enabled=True)
example_gateway_route_table_attachment = alicloud.vpc.GatewayRouteTableAttachment("exampleGatewayRouteTableAttachment",
ipv4_gateway_id=example_ipv4_gateway.id,
route_table_id=example_route_table.id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const exampleNetwork = new alicloud.vpc.Network("exampleNetwork", {
cidrBlock: "172.16.0.0/12",
vpcName: "terraform-example",
});
const exampleRouteTable = new alicloud.vpc.RouteTable("exampleRouteTable", {
vpcId: exampleNetwork.id,
routeTableName: "terraform-example",
description: "terraform-example",
associateType: "Gateway",
});
const exampleIpv4Gateway = new alicloud.vpc.Ipv4Gateway("exampleIpv4Gateway", {
ipv4GatewayName: "terraform-example",
vpcId: exampleNetwork.id,
enabled: true,
});
const exampleGatewayRouteTableAttachment = new alicloud.vpc.GatewayRouteTableAttachment("exampleGatewayRouteTableAttachment", {
ipv4GatewayId: exampleIpv4Gateway.id,
routeTableId: exampleRouteTable.id,
});
resources:
exampleNetwork:
type: alicloud:vpc:Network
properties:
cidrBlock: 172.16.0.0/12
vpcName: terraform-example
exampleRouteTable:
type: alicloud:vpc:RouteTable
properties:
vpcId: ${exampleNetwork.id}
routeTableName: terraform-example
description: terraform-example
associateType: Gateway
exampleIpv4Gateway:
type: alicloud:vpc:Ipv4Gateway
properties:
ipv4GatewayName: terraform-example
vpcId: ${exampleNetwork.id}
enabled: 'true'
exampleGatewayRouteTableAttachment:
type: alicloud:vpc:GatewayRouteTableAttachment
properties:
ipv4GatewayId: ${exampleIpv4Gateway.id}
routeTableId: ${exampleRouteTable.id}
Create GatewayRouteTableAttachment Resource
new GatewayRouteTableAttachment(name: string, args: GatewayRouteTableAttachmentArgs, opts?: CustomResourceOptions);
@overload
def GatewayRouteTableAttachment(resource_name: str,
opts: Optional[ResourceOptions] = None,
dry_run: Optional[bool] = None,
ipv4_gateway_id: Optional[str] = None,
route_table_id: Optional[str] = None)
@overload
def GatewayRouteTableAttachment(resource_name: str,
args: GatewayRouteTableAttachmentArgs,
opts: Optional[ResourceOptions] = None)
func NewGatewayRouteTableAttachment(ctx *Context, name string, args GatewayRouteTableAttachmentArgs, opts ...ResourceOption) (*GatewayRouteTableAttachment, error)
public GatewayRouteTableAttachment(string name, GatewayRouteTableAttachmentArgs args, CustomResourceOptions? opts = null)
public GatewayRouteTableAttachment(String name, GatewayRouteTableAttachmentArgs args)
public GatewayRouteTableAttachment(String name, GatewayRouteTableAttachmentArgs args, CustomResourceOptions options)
type: alicloud:vpc:GatewayRouteTableAttachment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args GatewayRouteTableAttachmentArgs
- 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 GatewayRouteTableAttachmentArgs
- 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 GatewayRouteTableAttachmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args GatewayRouteTableAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args GatewayRouteTableAttachmentArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
GatewayRouteTableAttachment 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 GatewayRouteTableAttachment resource accepts the following input properties:
- Ipv4Gateway
Id string The ID of the IPv4 Gateway instance.
- Route
Table stringId The ID of the Gateway route table to be bound.
- Dry
Run bool Specifies whether to only precheck this request. Default value:
false
.
- Ipv4Gateway
Id string The ID of the IPv4 Gateway instance.
- Route
Table stringId The ID of the Gateway route table to be bound.
- Dry
Run bool Specifies whether to only precheck this request. Default value:
false
.
- ipv4Gateway
Id String The ID of the IPv4 Gateway instance.
- route
Table StringId The ID of the Gateway route table to be bound.
- dry
Run Boolean Specifies whether to only precheck this request. Default value:
false
.
- ipv4Gateway
Id string The ID of the IPv4 Gateway instance.
- route
Table stringId The ID of the Gateway route table to be bound.
- dry
Run boolean Specifies whether to only precheck this request. Default value:
false
.
- ipv4_
gateway_ strid The ID of the IPv4 Gateway instance.
- route_
table_ strid The ID of the Gateway route table to be bound.
- dry_
run bool Specifies whether to only precheck this request. Default value:
false
.
- ipv4Gateway
Id String The ID of the IPv4 Gateway instance.
- route
Table StringId The ID of the Gateway route table to be bound.
- dry
Run Boolean Specifies whether to only precheck this request. Default value:
false
.
Outputs
All input properties are implicitly available as output properties. Additionally, the GatewayRouteTableAttachment resource produces the following output properties:
- Create
Time string The creation time of the resource.
- Id string
The provider-assigned unique ID for this managed resource.
- Status string
The status of the IPv4 Gateway instance. Value:
- Creating: The function is being created.
- Created: Created and available.
- Modifying: is being modified.
- Deleting: Deleting.
- Deleted: Deleted.
- Activating: enabled.
- Create
Time string The creation time of the resource.
- Id string
The provider-assigned unique ID for this managed resource.
- Status string
The status of the IPv4 Gateway instance. Value:
- Creating: The function is being created.
- Created: Created and available.
- Modifying: is being modified.
- Deleting: Deleting.
- Deleted: Deleted.
- Activating: enabled.
- create
Time String The creation time of the resource.
- id String
The provider-assigned unique ID for this managed resource.
- status String
The status of the IPv4 Gateway instance. Value:
- Creating: The function is being created.
- Created: Created and available.
- Modifying: is being modified.
- Deleting: Deleting.
- Deleted: Deleted.
- Activating: enabled.
- create
Time string The creation time of the resource.
- id string
The provider-assigned unique ID for this managed resource.
- status string
The status of the IPv4 Gateway instance. Value:
- Creating: The function is being created.
- Created: Created and available.
- Modifying: is being modified.
- Deleting: Deleting.
- Deleted: Deleted.
- Activating: enabled.
- create_
time str The creation time of the resource.
- id str
The provider-assigned unique ID for this managed resource.
- status str
The status of the IPv4 Gateway instance. Value:
- Creating: The function is being created.
- Created: Created and available.
- Modifying: is being modified.
- Deleting: Deleting.
- Deleted: Deleted.
- Activating: enabled.
- create
Time String The creation time of the resource.
- id String
The provider-assigned unique ID for this managed resource.
- status String
The status of the IPv4 Gateway instance. Value:
- Creating: The function is being created.
- Created: Created and available.
- Modifying: is being modified.
- Deleting: Deleting.
- Deleted: Deleted.
- Activating: enabled.
Look up Existing GatewayRouteTableAttachment Resource
Get an existing GatewayRouteTableAttachment 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?: GatewayRouteTableAttachmentState, opts?: CustomResourceOptions): GatewayRouteTableAttachment
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
create_time: Optional[str] = None,
dry_run: Optional[bool] = None,
ipv4_gateway_id: Optional[str] = None,
route_table_id: Optional[str] = None,
status: Optional[str] = None) -> GatewayRouteTableAttachment
func GetGatewayRouteTableAttachment(ctx *Context, name string, id IDInput, state *GatewayRouteTableAttachmentState, opts ...ResourceOption) (*GatewayRouteTableAttachment, error)
public static GatewayRouteTableAttachment Get(string name, Input<string> id, GatewayRouteTableAttachmentState? state, CustomResourceOptions? opts = null)
public static GatewayRouteTableAttachment get(String name, Output<String> id, GatewayRouteTableAttachmentState 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.
- Create
Time string The creation time of the resource.
- Dry
Run bool Specifies whether to only precheck this request. Default value:
false
.- Ipv4Gateway
Id string The ID of the IPv4 Gateway instance.
- Route
Table stringId The ID of the Gateway route table to be bound.
- Status string
The status of the IPv4 Gateway instance. Value:
- Creating: The function is being created.
- Created: Created and available.
- Modifying: is being modified.
- Deleting: Deleting.
- Deleted: Deleted.
- Activating: enabled.
- Create
Time string The creation time of the resource.
- Dry
Run bool Specifies whether to only precheck this request. Default value:
false
.- Ipv4Gateway
Id string The ID of the IPv4 Gateway instance.
- Route
Table stringId The ID of the Gateway route table to be bound.
- Status string
The status of the IPv4 Gateway instance. Value:
- Creating: The function is being created.
- Created: Created and available.
- Modifying: is being modified.
- Deleting: Deleting.
- Deleted: Deleted.
- Activating: enabled.
- create
Time String The creation time of the resource.
- dry
Run Boolean Specifies whether to only precheck this request. Default value:
false
.- ipv4Gateway
Id String The ID of the IPv4 Gateway instance.
- route
Table StringId The ID of the Gateway route table to be bound.
- status String
The status of the IPv4 Gateway instance. Value:
- Creating: The function is being created.
- Created: Created and available.
- Modifying: is being modified.
- Deleting: Deleting.
- Deleted: Deleted.
- Activating: enabled.
- create
Time string The creation time of the resource.
- dry
Run boolean Specifies whether to only precheck this request. Default value:
false
.- ipv4Gateway
Id string The ID of the IPv4 Gateway instance.
- route
Table stringId The ID of the Gateway route table to be bound.
- status string
The status of the IPv4 Gateway instance. Value:
- Creating: The function is being created.
- Created: Created and available.
- Modifying: is being modified.
- Deleting: Deleting.
- Deleted: Deleted.
- Activating: enabled.
- create_
time str The creation time of the resource.
- dry_
run bool Specifies whether to only precheck this request. Default value:
false
.- ipv4_
gateway_ strid The ID of the IPv4 Gateway instance.
- route_
table_ strid The ID of the Gateway route table to be bound.
- status str
The status of the IPv4 Gateway instance. Value:
- Creating: The function is being created.
- Created: Created and available.
- Modifying: is being modified.
- Deleting: Deleting.
- Deleted: Deleted.
- Activating: enabled.
- create
Time String The creation time of the resource.
- dry
Run Boolean Specifies whether to only precheck this request. Default value:
false
.- ipv4Gateway
Id String The ID of the IPv4 Gateway instance.
- route
Table StringId The ID of the Gateway route table to be bound.
- status String
The status of the IPv4 Gateway instance. Value:
- Creating: The function is being created.
- Created: Created and available.
- Modifying: is being modified.
- Deleting: Deleting.
- Deleted: Deleted.
- Activating: enabled.
Import
VPC Gateway Route Table Attachment can be imported using the id, e.g.
$ pulumi import alicloud:vpc/gatewayRouteTableAttachment:GatewayRouteTableAttachment example <route_table_id>:<ipv4_gateway_id>
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.