aliyun / terraform-provider-alicloud

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

[MNS] resource alicloud_mns_queue not support proxy connections #2921

Open supertom25 opened 4 years ago

supertom25 commented 4 years ago

When i try to run the resource alicloud_mns_topic or alicloud_mns_queue, they are works well if i running in public internet. but in my company , the internet access is restricted and all access have to via Internal proxy.

We hit a problem to receive below error when we running the terraform script with resource for mns:

Error: [ERROR] terraform-provider-alicloud/alicloud/resource_alicloud_mns_topic.go:68: [ERROR] terraform-provider-alicloud/alicloud/service_alicloud_mns.go:75: Resource ccp-inbound-warranty-quality GetTopicAttributes Failed!!! [SDK ali_mns ERROR]: send request failed, dialing to the given TCP address timed out

after checking in connectivity part due to the different in public and internal environment, we found the API access for these resources are trying to reach below public IP directly but not via the proxy. 139.196.65.96 with 443 ports. Please see the screen capture: image these made we are blocked to deploy MNS services via terraform, could you please take a look and see if it is able to resolve?

thanks,

tom

xiaozhu36 commented 3 years ago

HI @supertom25 I am sorry for this issue. What is your terraform provider vesion? I think this issue has been fixed by https://github.com/aliyun/terraform-provider-alicloud/pull/2581/files and it has been published in the version 1.88.0. Please have a check and let me know the result.

supertom25 commented 3 years ago

Hello, actually the provider version i use is much later than 1.88.0, but i am not sure exactly the version. not important because i just did again with the latest version in 1.124.3 but i got the same issue still. please see my code / error screen and network trace in attached. problem is not resolve yet, the mns creation works in PUBLIC internet without PROXY, but not work if internally when we have "PROXY" in use. thanks,

Code:

################

Topic

################ resource "alicloud_mns_topic" "topic_1" { name = "topic_1 maximum_message_size = 65536 logging_enabled = true }

###############

Queue

###############

resource "alicloud_mns_queue" "queue_1" { name = "queue_1" delay_seconds = 0 maximum_message_size = 65536 message_retention_period = 345600 visibility_timeout = 30 polling_wait_seconds = 0 }

Error

2021-06-21_10-44-18 " Network Connections (try to reach directly the endpoint with not go to proxy)

2021-06-21_10-44-03

sdenel commented 3 years ago

Hello @xiaozhu36, Exact same problem here, with provider in version v1.131.0 (latest): [ERROR] terraform-provider-alicloud/alicloud/resource_alicloud_mns_queue.go:85: Resource alicloud_mns_queue CreateQueue Failed!!! [SDK ali_mns ERROR]: send request failed, dialing to the given TCP address timed out

So the error is coming from this line: https://github.com/aliyun/terraform-provider-alicloud/blob/v1.131.0/alicloud/resource_alicloud_mns_queue.go#L85

Which makes me think that fasthttp, probably around this line: https://github.com/aliyun/terraform-provider-alicloud/blob/94d4bd3fc3d6b9385775ac4bc15e6105e78ded8f/vendor/github.com/aliyun/aliyun-mns-go-sdk/client.go#L256 is not using the HTTP proxy.