Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Global Internet Gateway] Cant add a route for Global Internet Gateway in Route Table #6024

Open
atiframzan89 opened this issue Dec 13, 2024 · 0 comments

Comments

@atiframzan89
Copy link

atiframzan89 commented Dec 13, 2024

Hi there,

Not able to add the route in route table for Global Internet Gateway, although we can add manually from Huawei Cloud Console. Below is the code.

resource "huaweicloud_vpc_route_table" "public-rt" {
    # count               = length(var.vpc.private_subnet)
    name                = "${var.customer}-public-rt-${var.environment}"
    vpc_id              = huaweicloud_vpc.vpc.id
    # subnets             = [ element(var.vpc.private_subnet, count.index) ]
    subnets             = [ huaweicloud_vpc_subnet.public-subnet[0].id ]
    
    route {
      destination       = "0.0.0.0/0"
      type              = "nat"
      nexthop           = huaweicloud_vpc_internet_gateway.internet-gateway.id
    }
    
}

I know the type is not correct but this is just an example, the route is working for nat gateway but there is no information in the document to add the Global Internet Gateway. For documentation please find here

Terraform Version

Terraform v1.7.4
on windows_amd64
+ provider registry.terraform.io/huaweicloud/huaweicloud v1.71.1

Your version of Terraform is out of date! The latest version
is 1.10.2. You can update by downloading from https://www.terraform.io/downloads.html

Terraform Configuration Files

Terraform provider

terraform {
  required_providers {
    huaweicloud = {
      source = "huaweicloud/huaweicloud"
      version = ">= 1.21.0"
   }
}

Debug Output

│ Error: error updating VPC route table: Resource not found: [PUT https://vpc.ap-southeast-1.myhuaweicloud.com/v1/09aa6bd416c84c018a086ec8469397ad/routetables/9b4d08f6-d80b-416c-a6ae-04c476dec8d3], request_id: 29bfbf28edb26634730b3abcef0b0bde, error message: {"code":"VPC.2901","message":"{\"requestId\":\"807794b4b7d438ba6d38ff9969d74613\",\"error_msg\":\"DcRouteGateway f0ac0f08-dc76-44c5-b406-e2bc17a0c557 Not Found.\",\"error_code\":\"DC.2407\"}"}
│
│   with module.vpc.huaweicloud_vpc_route_table.public-rt,
│   on modules\vpc\main.tf line 72, in resource "huaweicloud_vpc_route_table" "public-rt":
│   72: resource "huaweicloud_vpc_route_table" "public-rt" {

Expected Behavior

This needs to execute successfully as and add the route in route table for Global Internet Gateway.

Actual Behavior

There is no information available for Global Internet Gateway route addition in Huawei Terraform documentation. Although we can add it through the huawei cloud console (UI).

Steps to Reproduce

Run the above code using terraform init and apply commands.

  1. terraform init
  2. terraform apply
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant