From fe7c9a4da77f8716930488119fac5c98a7ab47af Mon Sep 17 00:00:00 2001 From: Jason Haugen Date: Fri, 9 Apr 2021 13:15:56 -0500 Subject: [PATCH] fix sqs url for china --- upup/pkg/fi/cloudup/template_functions.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/upup/pkg/fi/cloudup/template_functions.go b/upup/pkg/fi/cloudup/template_functions.go index e76ec74560d92..e180a5b983317 100644 --- a/upup/pkg/fi/cloudup/template_functions.go +++ b/upup/pkg/fi/cloudup/template_functions.go @@ -220,7 +220,11 @@ func (tf *TemplateFunctions) AddTo(dest template.FuncMap, secretStore fi.SecretS if cluster.Spec.NodeTerminationHandler != nil { dest["DefaultQueueName"] = func() string { s := strings.Replace(tf.ClusterName(), ".", "-", -1) - url := "https://sqs." + tf.Region + ".amazonaws.com/" + tf.AWSAccountID + "/" + s + "-nth" + domain := ".amazonaws.com/" + if strings.Contains(tf.Region, "cn-") { + domain = ".amazonaws.com.cn/" + } + url := "https://sqs." + tf.Region + domain + tf.AWSAccountID + "/" + s + "-nth" return url } }