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
9 changes: 7 additions & 2 deletions tencentcloud/resource_tc_eip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package tencentcloud
import (
"context"
"fmt"
"os"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
Expand Down Expand Up @@ -72,6 +73,10 @@ func TestAccTencentCloudEip_basic(t *testing.T) {

func TestAccTencentCloudEip_anycast(t *testing.T) {
t.Parallel()
defer func() {
os.Setenv(PROVIDER_REGION, "")
}()
os.Setenv(PROVIDER_REGION, "ap-hongkong")
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
Expand Down Expand Up @@ -234,14 +239,14 @@ const testAccEipAnycast = `
resource "tencentcloud_eip" "foo" {
name = "eip_anycast"
type = "AnycastEIP"
anycast_zone = "ANYCAST_ZONE_GLOBAL"
anycast_zone = "ANYCAST_ZONE_OVERSEAS"
}
`

const testAccEipProvider = `
resource "tencentcloud_eip" "foo" {
name = "eip_provider"
internet_service_provider = "CMCC"
internet_service_provider = "CUCC"
}
`

Expand Down
2 changes: 1 addition & 1 deletion tencentcloud/resource_tc_vpn_ssl_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func resourceTencentCloudVpnSslClientCreate(d *schema.ResourceData, meta interfa
return fmt.Errorf("get instance list error: %s", err.Error())
}
if len(newIns) != 1 {
return fmt.Errorf("create ssl client error")
return fmt.Errorf("create ssl client error")
}

sslClient := newIns[0]
Expand Down
2 changes: 1 addition & 1 deletion tencentcloud/service_tencentcloud_vpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2128,7 +2128,7 @@ func (me *VpcService) UnattachEip(ctx context.Context, eipId string) error {
}

// DisassociateAddress Doesn't support Disassociate NAT Address
if strings.HasPrefix(*eip.InstanceId, "nat-") {
if eip.InstanceId != nil && strings.HasPrefix(*eip.InstanceId, "nat-") {
request := vpc.NewDisassociateNatGatewayAddressRequest()
request.NatGatewayId = eip.InstanceId
request.PublicIpAddresses = []*string{eip.AddressIp}
Expand Down