alicloud_vpc_gateway_endpoint_route_table_attachment

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.

Example Usage

Basic Usage

provider "alicloud" {
  region = "cn-hangzhou"
}

variable "name" {
  default = "terraform-example"
}

resource "alicloud_vpc" "defaulteVpc" {
  description = "test"
}

resource "alicloud_vpc_gateway_endpoint" "defaultGE" {
  service_name                = "com.aliyun.cn-hangzhou.oss"
  policy_document             = <<EOF
        {
          "Version": "1",
          "Statement": [{
            "Effect": "Allow",
            "Resource": ["*"],
            "Action": ["*"],
            "Principal": ["*"]
          }]
        }
        EOF
  vpc_id                      = alicloud_vpc.defaulteVpc.id
  gateway_endpoint_descrption = "test-gateway-endpoint"
  gateway_endpoint_name       = "${var.name}1"
}

resource "alicloud_route_table" "defaultRT" {
  vpc_id           = alicloud_vpc.defaulteVpc.id
  route_table_name = "${var.name}2"
}


resource "alicloud_vpc_gateway_endpoint_route_table_attachment" "default" {
  gateway_endpoint_id = alicloud_vpc_gateway_endpoint.defaultGE.id
  route_table_id      = alicloud_route_table.defaultRT.id
}
        {
          "Version": "1",
          "Statement": [{
            "Effect": "Allow",
            "Resource": ["*"],
            "Action": ["*"],
            "Principal": ["*"]
          }]
        }
        EOF
  vpc_id                      = alicloud_vpc.defaulteVpc.id
  gateway_endpoint_descrption = "test-gateway-endpoint"
  gateway_endpoint_name       = "${var.name}1"
}

resource "alicloud_route_table" "defaultRT" {
  vpc_id           = alicloud_vpc.defaulteVpc.id
  route_table_name = "${var.name}2"
}


resource "alicloud_vpc_gateway_endpoint_route_table_attachment" "default" {
  gateway_endpoint_id = alicloud_vpc_gateway_endpoint.defaultGE.id
  route_table_id      = alicloud_route_table.defaultRT.id
}

Argument Reference

The following arguments are supported:

Attributes Reference

The following attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

Import

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

$ terraform import alicloud_vpc_gateway_endpoint_route_table_attachment.example <gateway_endpoint_id>:<route_table_id>