Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion tencentcloud/basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,17 @@ const (
defaultDayuBgpIp = "bgpip-00000294"
defaultDayuNet = "net-0000007e"

defaultGaapProxyId = "link-4yb9g6tb"
defaultGaapProxyId = "link-ljb08m2l"
defaultGaapProxyId2 = "link-8lpyo88p"
defaultGaapSecurityPolicyId = "sp-05t5q92x"
defaultGaapRealserverDomainId1 = "rs-qs0h6wxp"
defaultGaapRealserverDomain1 = "github.com"
defaultGaapRealserverDomainId2 = "rs-qcygnwpd"
defaultGaapRealserverDomain2 = "www.github.com"
defaultGaapRealserverIpId1 = "rs-24e1ol23"
defaultGaapRealserverIp1 = "119.29.29.35"
defaultGaapRealserverIpId2 = "rs-70qzt26p"
defaultGaapRealserverIp2 = "1.1.1.5"

defaultSecurityGroup = "sg-ijato2x1"
defaultSecurityGroup2 = "sg-51rgzop1"
Expand Down
14 changes: 7 additions & 7 deletions tencentcloud/resource_tc_gaap_domain_error_page_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ const testAccGaapDomainErrorPageListenerAndDomain = `
resource tencentcloud_gaap_layer7_listener "foo" {
protocol = "HTTP"
name = "ci-test-gaap-l7-listener"
port = 80
port = "%s"
proxy_id = "%s"
}

Expand All @@ -238,7 +238,7 @@ resource tencentcloud_gaap_domain_error_page "foo" {
error_codes = [404, 503]
body = "bad request"
}
`, defaultGaapProxyId)
`, "81", defaultGaapProxyId)

var testAccGaapDomainErrorPageSingleErrorCode = fmt.Sprintf(testAccGaapDomainErrorPageListenerAndDomain+`
resource tencentcloud_gaap_domain_error_page "foo" {
Expand All @@ -247,7 +247,7 @@ resource tencentcloud_gaap_domain_error_page "foo" {
error_codes = [400]
body = "bad request"
}
`, defaultGaapProxyId)
`, "82", defaultGaapProxyId)

var testAccGaapDomainErrorPageNewErrorCode = fmt.Sprintf(testAccGaapDomainErrorPageListenerAndDomain+`
resource tencentcloud_gaap_domain_error_page "foo" {
Expand All @@ -257,7 +257,7 @@ resource tencentcloud_gaap_domain_error_page "foo" {
body = "bad request"
new_error_code = 501
}
`, defaultGaapProxyId)
`, "83", defaultGaapProxyId)

var testAccGaapDomainErrorPageClearHeaders = fmt.Sprintf(testAccGaapDomainErrorPageListenerAndDomain+`
resource tencentcloud_gaap_domain_error_page "foo" {
Expand All @@ -267,7 +267,7 @@ resource tencentcloud_gaap_domain_error_page "foo" {
body = "bad request"
clear_headers = ["Content-Length", "X-TEST"]
}
`, defaultGaapProxyId)
`, "84", defaultGaapProxyId)

var testAccGaapDomainErrorPageSetHeaders = fmt.Sprintf(testAccGaapDomainErrorPageListenerAndDomain+`
resource tencentcloud_gaap_domain_error_page "foo" {
Expand All @@ -280,7 +280,7 @@ resource tencentcloud_gaap_domain_error_page "foo" {
"X-TEST" = "test"
}
}
`, defaultGaapProxyId)
`, "85", defaultGaapProxyId)

var testAccGaapDomainErrorPageFull = fmt.Sprintf(testAccGaapDomainErrorPageListenerAndDomain+`
resource tencentcloud_gaap_domain_error_page "foo" {
Expand All @@ -295,4 +295,4 @@ resource tencentcloud_gaap_domain_error_page "foo" {
"X-TEST" = "test"
}
}
`, defaultGaapProxyId)
`, "86", defaultGaapProxyId)
68 changes: 56 additions & 12 deletions tencentcloud/resource_tc_gaap_http_domain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func TestAccTencentCloudGaapHttpDomain_httpsRealserverCertificateIds(t *testing.
CheckDestroy: testAccCheckGaapHttpDomainDestroy(id),
Steps: []resource.TestStep{
{
Config: testAccGaapHttpDomainHttpsRsIds,
Config: testAccGaapHttpDomainHttpsRsIds2,
Check: resource.ComposeTestCheckFunc(
testAccCheckGaapHttpDomainExists("tencentcloud_gaap_http_domain.foo", id),
resource.TestCheckResourceAttrSet("tencentcloud_gaap_http_domain.foo", "listener_id"),
Expand Down Expand Up @@ -335,7 +335,7 @@ var testAccGaapHttpDomainBasic = fmt.Sprintf(`
resource tencentcloud_gaap_layer7_listener "foo" {
protocol = "HTTP"
name = "ci-test-gaap-l7-listener"
port = 80
port = 7170
proxy_id = "%s"
}

Expand All @@ -355,7 +355,7 @@ resource tencentcloud_gaap_certificate "foo" {
resource tencentcloud_gaap_layer7_listener "foo" {
protocol = "HTTPS"
name = "ci-test-gaap-l7-listener"
port = 80
port = 7171
proxy_id = "%s"
certificate_id = tencentcloud_gaap_certificate.foo.id
forward_protocol = "HTTP"
Expand Down Expand Up @@ -385,7 +385,7 @@ resource tencentcloud_gaap_certificate "bar" {
resource tencentcloud_gaap_layer7_listener "foo" {
protocol = "HTTPS"
name = "ci-test-gaap-l7-listener"
port = 80
port = 7172
proxy_id = "%s"
certificate_id = tencentcloud_gaap_certificate.foo.id
client_certificate_id = tencentcloud_gaap_certificate.bar.id
Expand Down Expand Up @@ -446,7 +446,7 @@ resource tencentcloud_gaap_certificate "gaap" {
resource tencentcloud_gaap_layer7_listener "foo" {
protocol = "HTTPS"
name = "ci-test-gaap-l7-listener"
port = 80
port = 7172
proxy_id = "%s"
certificate_id = tencentcloud_gaap_certificate.foo.id
client_certificate_id = tencentcloud_gaap_certificate.bar.id
Expand Down Expand Up @@ -503,7 +503,7 @@ resource tencentcloud_gaap_certificate "client1" {
resource tencentcloud_gaap_layer7_listener "foo" {
protocol = "HTTPS"
name = "ci-test-gaap-l7-listener"
port = 80
port = 7173
proxy_id = "%s"
certificate_id = tencentcloud_gaap_certificate.foo.id
client_certificate_ids = [tencentcloud_gaap_certificate.bar.id]
Expand Down Expand Up @@ -550,7 +550,7 @@ resource tencentcloud_gaap_certificate "client3" {
resource tencentcloud_gaap_layer7_listener "foo" {
protocol = "HTTPS"
name = "ci-test-gaap-l7-listener"
port = 80
port = 7173
proxy_id = "%s"
certificate_id = tencentcloud_gaap_certificate.foo.id
client_certificate_ids = [tencentcloud_gaap_certificate.bar.id]
Expand Down Expand Up @@ -592,7 +592,7 @@ resource tencentcloud_gaap_certificate "client1" {
resource tencentcloud_gaap_layer7_listener "foo" {
protocol = "HTTPS"
name = "ci-test-gaap-l7-listener"
port = 80
port = 7174
proxy_id = "%s"
certificate_id = tencentcloud_gaap_certificate.foo.id
client_certificate_ids = [tencentcloud_gaap_certificate.bar.id]
Expand Down Expand Up @@ -633,7 +633,7 @@ resource tencentcloud_gaap_certificate "client1" {
resource tencentcloud_gaap_layer7_listener "foo" {
protocol = "HTTPS"
name = "ci-test-gaap-l7-listener"
port = 80
port = 7174
proxy_id = "%s"
certificate_id = tencentcloud_gaap_certificate.foo.id
client_certificate_ids = [tencentcloud_gaap_certificate.bar.id]
Expand Down Expand Up @@ -674,7 +674,7 @@ resource tencentcloud_gaap_certificate "realserver1" {
resource tencentcloud_gaap_layer7_listener "foo" {
protocol = "HTTPS"
name = "ci-test-gaap-l7-listener"
port = 80
port = 7176
proxy_id = "%s"
certificate_id = tencentcloud_gaap_certificate.foo.id
client_certificate_id = tencentcloud_gaap_certificate.bar.id
Expand All @@ -696,6 +696,50 @@ resource tencentcloud_gaap_http_domain "foo" {
defaultGaapProxyId,
)

var testAccGaapHttpDomainHttpsRsIds2 = fmt.Sprintf(`
resource tencentcloud_gaap_certificate "foo" {
type = "SERVER"
content = %s
key = %s
}

resource tencentcloud_gaap_certificate "bar" {
type = "CLIENT"
content = %s
key = %s
}

resource tencentcloud_gaap_certificate "realserver1" {
type = "REALSERVER"
content = %s
key = %s
}

resource tencentcloud_gaap_layer7_listener "foo" {
protocol = "HTTPS"
name = "ci-test-gaap-l7-listener"
port = 7177
proxy_id = "%s"
certificate_id = tencentcloud_gaap_certificate.foo.id
client_certificate_id = tencentcloud_gaap_certificate.bar.id
forward_protocol = "HTTPS"
auth_type = 1
}

resource tencentcloud_gaap_http_domain "foo" {
listener_id = tencentcloud_gaap_layer7_listener.foo.id
domain = "www.qq.com"

realserver_auth = true
realserver_certificate_ids = [tencentcloud_gaap_certificate.realserver1.id]
realserver_certificate_domain = "qq.com"
}
`, "<<EOF"+testAccGaapCertificateServerCert+"EOF", "<<EOF"+testAccGaapCertificateServerKey+"EOF",
"<<EOF"+testAccGaapCertificateClientCA+"EOF", "<<EOF"+testAccGaapCertificateClientCAKey+"EOF",
"<<EOF"+testAccGaapCertificateClientCA+"EOF", "<<EOF"+testAccGaapCertificateClientCAKey+"EOF",
defaultGaapProxyId,
)

var testAccGaapHttpDomainHttpsRsIds = fmt.Sprintf(`
resource tencentcloud_gaap_certificate "foo" {
type = "SERVER"
Expand All @@ -718,7 +762,7 @@ resource tencentcloud_gaap_certificate "realserver1" {
resource tencentcloud_gaap_layer7_listener "foo" {
protocol = "HTTPS"
name = "ci-test-gaap-l7-listener"
port = 80
port = 7176
proxy_id = "%s"
certificate_id = tencentcloud_gaap_certificate.foo.id
client_certificate_id = tencentcloud_gaap_certificate.bar.id
Expand Down Expand Up @@ -768,7 +812,7 @@ resource tencentcloud_gaap_certificate "realserver2" {
resource tencentcloud_gaap_layer7_listener "foo" {
protocol = "HTTPS"
name = "ci-test-gaap-l7-listener"
port = 80
port = 7177
proxy_id = "%s"
certificate_id = tencentcloud_gaap_certificate.foo.id
client_certificate_id = tencentcloud_gaap_certificate.bar.id
Expand Down
Loading