|
| 1 | +package privatedns_test |
| 2 | + |
| 3 | +import ( |
| 4 | + "testing" |
| 5 | + |
| 6 | + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" |
| 7 | + |
| 8 | + tcacctest "github.com/tencentcloudstack/terraform-provider-tencentcloud/tencentcloud/acctest" |
| 9 | +) |
| 10 | + |
| 11 | +// go test -i; go test -test.run TestAccTencentCloudNeedFixPrivateDnsExtendEndPointResource_basic -v |
| 12 | +func TestAccTencentCloudNeedFixPrivateDnsExtendEndPointResource_basic(t *testing.T) { |
| 13 | + t.Parallel() |
| 14 | + resource.Test(t, resource.TestCase{ |
| 15 | + PreCheck: func() { |
| 16 | + tcacctest.AccPreCheck(t) |
| 17 | + }, |
| 18 | + Providers: tcacctest.AccProviders, |
| 19 | + Steps: []resource.TestStep{ |
| 20 | + { |
| 21 | + Config: testAccPrivateDnsExtendEndPoint, |
| 22 | + Check: resource.ComposeTestCheckFunc( |
| 23 | + resource.TestCheckResourceAttrSet("tencentcloud_private_dns_extend_end_point.example", "id"), |
| 24 | + resource.TestCheckResourceAttrSet("tencentcloud_private_dns_extend_end_point.example", "end_point_name"), |
| 25 | + resource.TestCheckResourceAttrSet("tencentcloud_private_dns_extend_end_point.example", "end_point_region"), |
| 26 | + resource.TestCheckResourceAttrSet("tencentcloud_private_dns_extend_end_point.example", "forward_ip.#"), |
| 27 | + ), |
| 28 | + }, |
| 29 | + { |
| 30 | + ResourceName: "tencentcloud_private_dns_extend_end_point.example", |
| 31 | + ImportState: true, |
| 32 | + ImportStateVerify: true, |
| 33 | + }, |
| 34 | + }, |
| 35 | + }) |
| 36 | +} |
| 37 | + |
| 38 | +const testAccPrivateDnsExtendEndPoint = ` |
| 39 | +resource "tencentcloud_private_dns_extend_end_point" "example" { |
| 40 | + end_point_name = "tf-example" |
| 41 | + end_point_region = "ap-jakarta" |
| 42 | + forward_ip { |
| 43 | + access_type = "CCN" |
| 44 | + host = "1.1.1.1" |
| 45 | + port = 8080 |
| 46 | + vpc_id = "vpc-2qjckjg2" |
| 47 | + access_gateway_id = "ccn-eo13f8ub" |
| 48 | + } |
| 49 | +} |
| 50 | +` |
0 commit comments