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

alicloud_vpn_gateway is not identifying the vswitch_id #6908

Open
sukumardandu opened this issue Jan 27, 2024 · 0 comments
Open

alicloud_vpn_gateway is not identifying the vswitch_id #6908

sukumardandu opened this issue Jan 27, 2024 · 0 comments

Comments

@sukumardandu
Copy link

sukumardandu commented Jan 27, 2024

Hi

I am facing issue when creating a VPN Gateway, the resouce is not able to identify the vswitch_id

Terraform Version

terraform --version
Terraform v1.2.9
on darwin_amd64

Affected Resource(s)

  • alicloud_vpn_gateway

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

# Resource creation with hardcoded values
   resource "alicloud_vpn_gateway" "vpn_gateway" {
       bandwidth            = 1000
       enable_ipsec         = true
       enable_ssl           = false
       instance_charge_type = "PostPaid"
       name                 = "cn-shanghai_vpn_gateway"
       vpc_id               = "vpc-uf68082xxxxx"
       vswitch_id           = "vsw-uf6qk4xxxxx"
    }

---
# resource creation with variable reference
    resource "alicloud_vpn_gateway" "vpn_gateway" {
      name                 = "cn-shanghai_vpn_gateway"
      vpc_id               = alicloud_vpc.vpc.id
      bandwidth            = "1000"
      enable_ipsec         = true
      enable_ssl           = false
      vswitch_id           = "${alicloud_vswitch.private_vswitches.*.id[1]}"
      instance_charge_type = "PostPaid"
    }
    
    

Debug Output

│ Error: [ERROR] terraform-provider-alicloud/alicloud/resource_alicloud_vpn_gateway.go:217: Resource alicloud_vpn_gateway CreateVpnGateway Failed!!! [SDK alibaba-cloud-sdk-go ERROR]:
│ SDKError:
│ StatusCode: 400
│ Code: InvalidVSwitchId.NotFound
│ Message: code: 400, The specified vswitchId is not found. request id: 2160112E-2356-5BA2-98A6-678BEFAF01C6
│ Data: {"Code":"InvalidVSwitchId.NotFound","HostId":"vpc.cn-shanghai.aliyuncs.com","Message":"The specified vswitchId is not found."

Panic Output

If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.

Expected Behavior

VPN Gateway should be created

Actual Behavior

Error in creating resource, showing Message: code: 400, The specified vswitchId is not found.
Irrespective of referring variables or passing the hardcoded value for vswitch_id, its constantly showing that it can't find the vswitch_id, even if I comment the vswitch_id in resource its throwing same error

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Important Factoids

Trying to create this resource in cn-shanghai region
I am using the latest version of aliyun/alicloud provider

References

No references

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