aliyun / terraform-provider-alicloud

Terraform AliCloud provider
https://www.terraform.io/docs/providers/alicloud/
Mozilla Public License 2.0
582 stars 548 forks source link

SLB listener is not created #6622

Open mshiekh opened 10 months ago

mshiekh commented 10 months ago

I am facing this issue where the frontend listener is not created and keep failing with error message: "ErrorCode: ResourceNotAvailible.HttpListener"

Terraform Version

Run terraform -v to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.

Terraform v1.6.2 on windows_amd64

Affected Resource(s)

Please list the resources as a list, for example:

Terraform Configuration Files

variable "slb_type" {
  default = "slb.s2.small"
}

resource "alicloud_slb" "demo_slb" {
  load_balancer_name = "demo_slb"
  load_balancer_spec = var.slb_type
  address_type  = "internet"
  vswitch_id    = alicloud_vswitch.lb_vs.id
  payment_type = "PayAsYouGo"
  tags = {
    tag_a = 1
    tag_b = 2
  }
}

resource "alicloud_slb_listener" "default" {
  load_balancer_id          = alicloud_slb.demo_slb.id
  backend_port              = 80
  frontend_port             = 80
  protocol                  = "http"
  bandwidth                 = 1
  sticky_session            = "on"
  sticky_session_type       = "insert"
  cookie_timeout            = 86400
  health_check              = "on"
  health_check_timeout      = 8
  health_check_interval     = 5
  health_check_http_code    = "http_2xx,http_3xx"
 x_forwarded_for {
    retrive_slb_ip = true
    retrive_slb_id = true
  }
 request_timeout = 80
 idle_timeout    = 30
}

resource "alicloud_slb_backend_server" "default" {
  load_balancer_id = alicloud_slb.demo_slb.id

  backend_servers {
    server_id = alicloud_instance.web-server[0].id
    weight    = 100
  }
  backend_servers {
    server_id = alicloud_instance.web-server[1].id
    weight    = 100
  }
}

Debug Output

https://gist.github.com/mshiekh/ce0d8229e60955b9628a1eade603ae59.js

Expected Behavior

What should have happened?

Apply Complete! Resources: 14 added, 0 changed, 0 destroyed

Actual Behavior

an Error message appear and the listener is not created

Steps to Reproduce

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

  1. terraform apply --auto-approve
  2. running in 'me-central-1' region
  3. using provider alicloud v1.211.2
MrWolong commented 3 months ago

I tested your code locally and there were no errors. Please provide complete error information.