diff --git a/.changelog/3041.txt b/.changelog/3041.txt new file mode 100644 index 0000000000..4e4c361a81 --- /dev/null +++ b/.changelog/3041.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/tencentcloud_vpn_gateway: support `bgp_asn` +``` diff --git a/go.mod b/go.mod index 4f439ef40c..e035f8def7 100644 --- a/go.mod +++ b/go.mod @@ -46,7 +46,7 @@ require ( github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.1034 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit v1.0.1033 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.1046 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1066 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1068 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.1053 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cwp v1.0.762 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cynosdb v1.0.1058 @@ -96,7 +96,7 @@ require ( github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tse v1.0.857 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tsf v1.0.674 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vod v1.0.860 - github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.1060 + github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.1068 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/waf v1.0.1037 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata v1.0.792 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wss v1.0.199 diff --git a/go.sum b/go.sum index 64b76e0b73..28a671daa1 100644 --- a/go.sum +++ b/go.sum @@ -941,6 +941,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1065 h1:krc github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1065/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1066 h1:D55KWjZcHJrrZC92ObBJBeo+ZGwzdVWTduIqiD2RACo= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1066/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1068 h1:mI0xoreGp9GkDJWkdzqgZcPsfoWXciahPAvEcaGSA6g= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1068/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/controlcenter v1.0.993 h1:WlPgXldQCxt7qi5Xrc6j6zTrsXWzN5BcOGs7Irq7fwQ= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/controlcenter v1.0.993/go.mod h1:Z9U8zNtyuyKhjS0698wqsrG/kLx1TQ5CEixXBwVe7xY= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/csip v1.0.860 h1:F3esKBIT3HW9+7Gt8cVgf8X06VdGIczpgLBUECzSEzU= @@ -1067,6 +1069,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.1045 h1:7+rfyx github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.1045/go.mod h1:yn4I7fSwpiM6ltjqksS1JtZZAHkZ35ywN+kLm6AJPzc= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.1060 h1:hPEbNpABdOT1YA2B8aibfSQfxd91Ux2Xz8J7GqNHswE= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.1060/go.mod h1:owVatMEAkXaooNfoH99tMFY+AAiSnsf9m+Rb/HY+oc0= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.1068 h1:oHot9DQppI0bAZmUXZfP6SbYz7m48GBuQpUG2DnHwFU= +github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.1068/go.mod h1:eY2rMPyFp9RQKaZAD6EvJda4+X9XljtqxZ5jkM5h7EQ= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/waf v1.0.1037 h1:sgHOHqVFcO266dnoh0KJ0CoxrRglRZYKW78iBh41Giw= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/waf v1.0.1037/go.mod h1:QM5m6aZ65kaxaES0D44BNKmemn+9WBf5vr3HDDPrh8U= github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/wedata v1.0.792 h1:NLgKNOIHWa38AmW7dyfI9Jlcp2Kr9VRD94f48pPNmxM= diff --git a/tencentcloud/services/vpn/resource_tc_vpn_gateway.go b/tencentcloud/services/vpn/resource_tc_vpn_gateway.go index c37ea91168..31a4104f5a 100644 --- a/tencentcloud/services/vpn/resource_tc_vpn_gateway.go +++ b/tencentcloud/services/vpn/resource_tc_vpn_gateway.go @@ -134,6 +134,12 @@ func ResourceTencentCloudVpnGateway() *schema.Resource { Optional: true, Description: "A list of tags used to associate different resources.", }, + "bgp_asn": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + Description: "BGP ASN. Value range: 1 - 4294967295. Using BGP requires configuring ASN.", + }, "create_time": { Type: schema.TypeString, Computed: true, @@ -196,6 +202,10 @@ func resourceTencentCloudVpnGatewayCreate(d *schema.ResourceData, meta interface request.MaxConnection = helper.IntUint64(v.(int)) } + if v, ok := d.GetOkExists("bgp_asn"); ok { + request.BgpAsn = helper.IntUint64(v.(int)) + } + var response *vpc.CreateVpnGatewayResponse err := resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError { result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseVpcClient().CreateVpnGateway(request) @@ -204,17 +214,24 @@ func resourceTencentCloudVpnGatewayCreate(d *schema.ResourceData, meta interface logId, request.GetAction(), request.ToJsonString(), e.Error()) return tccommon.RetryError(e) } + + if result == nil || result.Response == nil || result.Response.VpnGateway == nil { + return resource.NonRetryableError(fmt.Errorf("create VPN gateway failed, Response is nil.")) + } + response = result return nil }) + if err != nil { log.Printf("[CRITAL]%s create VPN gateway failed, reason:%s\n", logId, err.Error()) return err } - if response.Response.VpnGateway == nil { + if response.Response.VpnGateway.VpnGatewayId == nil { return fmt.Errorf("VPN gateway id is nil") } + gatewayId := *response.Response.VpnGateway.VpnGatewayId d.SetId(gatewayId) @@ -229,14 +246,18 @@ func resourceTencentCloudVpnGatewayCreate(d *schema.ResourceData, meta interface return tccommon.RetryError(e) } else { //if not, quit - if len(result.Response.VpnGatewaySet) != 1 { - return resource.NonRetryableError(fmt.Errorf("creating error")) - } else { - if *result.Response.VpnGatewaySet[0].State == svcvpc.VPN_STATE_AVAILABLE { - return nil + if result != nil && result.Response != nil && result.Response.VpnGatewaySet != nil { + if len(result.Response.VpnGatewaySet) != 1 { + return resource.NonRetryableError(fmt.Errorf("creating error")) } else { - return resource.RetryableError(fmt.Errorf("State is not available: %s, wait for state to be AVAILABLE.", *result.Response.VpnGatewaySet[0].State)) + if *result.Response.VpnGatewaySet[0].State == svcvpc.VPN_STATE_AVAILABLE { + return nil + } else { + return resource.RetryableError(fmt.Errorf("State is not available: %s, wait for state to be AVAILABLE.", *result.Response.VpnGatewaySet[0].State)) + } } + } else { + return resource.NonRetryableError(fmt.Errorf("Describe Vpn Gateways failed, Response is nil.")) } } }) @@ -300,6 +321,10 @@ func resourceTencentCloudVpnGatewayRead(d *schema.ResourceData, meta interface{} _ = d.Set("zone", gateway.Zone) _ = d.Set("cdc_id", gateway.CdcId) _ = d.Set("max_connection", gateway.MaxConnection) + if gateway.BgpAsn != nil { + _ = d.Set("bgp_asn", gateway.BgpAsn) + } + //tags tagService := svctag.NewTagService(meta.(tccommon.ProviderMeta).GetAPIV3Conn()) region := meta.(tccommon.ProviderMeta).GetAPIV3Conn().Region @@ -386,7 +411,7 @@ func resourceTencentCloudVpnGatewayUpdate(d *schema.ResourceData, meta interface } } - if d.HasChange("name") || d.HasChange("charge_type") { + if d.HasChange("name") || d.HasChange("charge_type") || d.HasChange("bgp_asn") { //check that the charge type change is valid //only pre-paid --> post-paid is valid oldInterface, newInterface := d.GetChange("charge_type") @@ -395,6 +420,9 @@ func resourceTencentCloudVpnGatewayUpdate(d *schema.ResourceData, meta interface request := vpc.NewModifyVpnGatewayAttributeRequest() request.VpnGatewayId = &gatewayId request.VpnGatewayName = helper.String(d.Get("name").(string)) + if v, ok := d.GetOkExists("bgp_asn"); ok { + request.BgpAsn = helper.IntUint64(v.(int)) + } if oldChargeType == svcvpc.VPN_CHARGE_TYPE_PREPAID && newChargeType == svcvpc.VPN_CHARGE_TYPE_POSTPAID_BY_HOUR { request.InstanceChargeType = &newChargeType } else if oldChargeType == svcvpc.VPN_CHARGE_TYPE_POSTPAID_BY_HOUR && newChargeType == svcvpc.VPN_CHARGE_TYPE_PREPAID { @@ -479,26 +507,30 @@ func resourceTencentCloudVpnGatewayDelete(d *schema.ResourceData, meta interface if e != nil { return tccommon.RetryError(e) } else { - //if deleted, quit - if len(result.Response.VpnGatewaySet) == 0 { - return nil - } - if result.Response.VpnGatewaySet[0].ExpiredTime != nil && *result.Response.VpnGatewaySet[0].InstanceChargeType == svcvpc.VPN_CHARGE_TYPE_PREPAID { - expiredTime := *result.Response.VpnGatewaySet[0].ExpiredTime - if expiredTime != "0000-00-00 00:00:00" { - t, err := time.Parse("2006-01-02 15:04:05", expiredTime) - if err != nil { - return resource.NonRetryableError(fmt.Errorf("Error format expired time.%x %s", expiredTime, err)) - } - if time.Until(t) > 0 { - return resource.NonRetryableError(fmt.Errorf("Delete operation is unsupport when VPN gateway is not expired.")) + if result != nil && result.Response != nil && result.Response.VpnGatewaySet != nil { + //if deleted, quit + if len(result.Response.VpnGatewaySet) == 0 { + return nil + } + if result.Response.VpnGatewaySet[0].ExpiredTime != nil && *result.Response.VpnGatewaySet[0].InstanceChargeType == svcvpc.VPN_CHARGE_TYPE_PREPAID { + expiredTime := *result.Response.VpnGatewaySet[0].ExpiredTime + if expiredTime != "0000-00-00 00:00:00" { + t, err := time.Parse("2006-01-02 15:04:05", expiredTime) + if err != nil { + return resource.NonRetryableError(fmt.Errorf("Error format expired time.%x %s", expiredTime, err)) + } + if time.Until(t) > 0 { + return resource.NonRetryableError(fmt.Errorf("Delete operation is unsupport when VPN gateway is not expired.")) + } } } + if *result.Response.VpnGatewaySet[0].Type == svcvpc.GATE_WAY_TYPE_CCN && *result.Response.VpnGatewaySet[0].NetworkInstanceId != "" { + return resource.NonRetryableError(fmt.Errorf("Delete operation is unsupported when VPN gateway is attached to CCN instance.")) + } + return nil + } else { + return resource.NonRetryableError(fmt.Errorf("Describe Vpn Gateways failed, Response is nil.")) } - if *result.Response.VpnGatewaySet[0].Type == svcvpc.GATE_WAY_TYPE_CCN && *result.Response.VpnGatewaySet[0].NetworkInstanceId != "" { - return resource.NonRetryableError(fmt.Errorf("Delete operation is unsupported when VPN gateway is attached to CCN instance.")) - } - return nil } }) if vpngwErr != nil { @@ -534,10 +566,14 @@ func resourceTencentCloudVpnGatewayDelete(d *schema.ResourceData, meta interface logId, tRequest.GetAction(), tRequest.ToJsonString(), e.Error()) return tccommon.RetryError(e) } else { - if len(result.Response.VpnConnectionSet) == 0 { - return nil + if result != nil && result.Response != nil && result.Response.VpnConnectionSet != nil { + if len(result.Response.VpnConnectionSet) == 0 { + return nil + } else { + return resource.NonRetryableError(fmt.Errorf("There is associated tunnel exists, please delete associated tunnels first.")) + } } else { - return resource.NonRetryableError(fmt.Errorf("There is associated tunnel exists, please delete associated tunnels first.")) + return resource.NonRetryableError(fmt.Errorf("Describe Vpn Connections failed, Response is nil.")) } } }) @@ -582,12 +618,16 @@ func resourceTencentCloudVpnGatewayDelete(d *schema.ResourceData, meta interface return tccommon.RetryError(e) } } else { - //if not, quit - if len(result.Response.VpnGatewaySet) == 0 { - return nil + if result != nil && result.Response != nil && result.Response.VpnGatewaySet != nil { + //if not, quit + if len(result.Response.VpnGatewaySet) == 0 { + return nil + } + //else consider delete fail + return resource.RetryableError(fmt.Errorf("deleting retry")) + } else { + return resource.NonRetryableError(fmt.Errorf("Describe Vpn Gateways failed, Response is nil.")) } - //else consider delete fail - return resource.RetryableError(fmt.Errorf("deleting retry")) } }) if err != nil { diff --git a/tencentcloud/services/vpn/resource_tc_vpn_gateway.md b/tencentcloud/services/vpn/resource_tc_vpn_gateway.md index 08d037e39d..486e1222d0 100644 --- a/tencentcloud/services/vpn/resource_tc_vpn_gateway.md +++ b/tencentcloud/services/vpn/resource_tc_vpn_gateway.md @@ -5,66 +5,86 @@ Provides a resource to create a VPN gateway. Example Usage VPC SSL VPN gateway + ```hcl -resource "tencentcloud_vpn_gateway" "my_cgw" { - name = "test" +resource "tencentcloud_vpn_gateway" "example" { + name = "tf-example" bandwidth = 5 zone = "ap-guangzhou-3" type = "SSL" vpc_id = "vpc-86v957zb" tags = { - test = "test" + createBy = "terraform" } } ``` CCN IPSEC VPN gateway + ```hcl -resource "tencentcloud_vpn_gateway" "my_cgw" { - name = "test" +resource "tencentcloud_vpn_gateway" "example" { + name = "tf-example" bandwidth = 5 zone = "ap-guangzhou-3" type = "IPSEC" - tags = { - test = "test" + tags = { + createBy = "terraform" } } ``` CCN SSL VPN gateway + ```hcl -resource "tencentcloud_vpn_gateway" "my_cgw" { - name = "test" +resource "tencentcloud_vpn_gateway" "example" { + name = "tf-example" bandwidth = 5 zone = "ap-guangzhou-3" type = "SSL_CCN" - tags = { - test = "test" + tags = { + createBy = "terraform" + } +} +``` + +CCN VPN gateway + +```hcl +resource "tencentcloud_vpn_gateway" "example" { + name = "tf-example" + bandwidth = 200 + type = "CCN" + bgp_asn = 9000 + + tags = { + createBy = "terraform" } } ``` POSTPAID_BY_HOUR VPN gateway + ```hcl -resource "tencentcloud_vpn_gateway" "my_cgw" { - name = "test" +resource "tencentcloud_vpn_gateway" "example" { + name = "tf-example" vpc_id = "vpc-dk8zmwuf" bandwidth = 5 zone = "ap-guangzhou-3" tags = { - test = "test" + createBy = "terraform" } } ``` PREPAID VPN gateway + ```hcl -resource "tencentcloud_vpn_gateway" "my_cgw" { - name = "test" +resource "tencentcloud_vpn_gateway" "example" { + name = "tf-example" vpc_id = "vpc-dk8zmwuf" bandwidth = 5 zone = "ap-guangzhou-3" @@ -72,7 +92,7 @@ resource "tencentcloud_vpn_gateway" "my_cgw" { prepaid_period = 1 tags = { - test = "test" + createBy = "terraform" } } ``` @@ -82,5 +102,5 @@ Import VPN gateway can be imported using the id, e.g. ``` -$ terraform import tencentcloud_vpn_gateway.foo vpngw-8ccsnclt +$ terraform import tencentcloud_vpn_gateway.example vpngw-8ccsnclt ``` \ No newline at end of file diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go index a0706fd4f3..2be7be3613 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http/request.go @@ -265,7 +265,7 @@ func CompleteCommonParams(request Request, region string, requestClient string) params["Action"] = request.GetAction() params["Timestamp"] = strconv.FormatInt(time.Now().Unix(), 10) params["Nonce"] = strconv.Itoa(rand.Int()) - params["RequestClient"] = "SDK_GO_1.0.1066" + params["RequestClient"] = "SDK_GO_1.0.1068" if requestClient != "" { params["RequestClient"] += ": " + requestClient } diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312/client.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312/client.go index 089b067b3c..d61ddc1f1d 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312/client.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312/client.go @@ -2922,6 +2922,7 @@ func NewCreateCcnResponse() (response *CreateCcnResponse) { // * 每个账号能创建的云联网实例个数是有限的,详请参考产品文档。如果需要扩充请联系在线客服。 // // 可能返回的错误码: +// FAILEDOPERATION_CREATECCNFAILED = "FailedOperation.CreateCcnFailed" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETERVALUE = "InvalidParameterValue" // INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" @@ -2950,7 +2951,11 @@ func NewCreateCcnResponse() (response *CreateCcnResponse) { // MISSINGPARAMETER = "MissingParameter" // UNAUTHORIZEDOPERATION_NOREALNAMEAUTHENTICATION = "UnauthorizedOperation.NoRealNameAuthentication" // UNSUPPORTEDOPERATION = "UnsupportedOperation" +// UNSUPPORTEDOPERATION_COPPERCCNNOTSUPPORTEDCREATE = "UnsupportedOperation.CopperCcnNotSupportedCreate" +// UNSUPPORTEDOPERATION_COPPERCCNSUPPORTEDPREPAID = "UnsupportedOperation.CopperCcnSupportedPrepaid" // UNSUPPORTEDOPERATION_INSUFFICIENTFUNDS = "UnsupportedOperation.InsufficientFunds" +// UNSUPPORTEDOPERATION_NOTSUPPORTEDCREATETRAFFICMETERINGTYPECCN = "UnsupportedOperation.NotSupportedCreateTrafficMeteringTypeCcn" +// UNSUPPORTEDOPERATION_PREPAIDCCNONLYSUPPORTBANDWIDTHMETERING = "UnsupportedOperation.PrepaidCcnOnlySupportBandwidthMetering" // UNSUPPORTEDOPERATION_PREPAIDCCNONLYSUPPORTINTERREGIONLIMIT = "UnsupportedOperation.PrepaidCcnOnlySupportInterRegionLimit" // UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" // UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" @@ -2969,6 +2974,7 @@ func (c *Client) CreateCcn(request *CreateCcnRequest) (response *CreateCcnRespon // * 每个账号能创建的云联网实例个数是有限的,详请参考产品文档。如果需要扩充请联系在线客服。 // // 可能返回的错误码: +// FAILEDOPERATION_CREATECCNFAILED = "FailedOperation.CreateCcnFailed" // INVALIDPARAMETER = "InvalidParameter" // INVALIDPARAMETERVALUE = "InvalidParameterValue" // INVALIDPARAMETERVALUE_LIMITEXCEEDED = "InvalidParameterValue.LimitExceeded" @@ -2997,7 +3003,11 @@ func (c *Client) CreateCcn(request *CreateCcnRequest) (response *CreateCcnRespon // MISSINGPARAMETER = "MissingParameter" // UNAUTHORIZEDOPERATION_NOREALNAMEAUTHENTICATION = "UnauthorizedOperation.NoRealNameAuthentication" // UNSUPPORTEDOPERATION = "UnsupportedOperation" +// UNSUPPORTEDOPERATION_COPPERCCNNOTSUPPORTEDCREATE = "UnsupportedOperation.CopperCcnNotSupportedCreate" +// UNSUPPORTEDOPERATION_COPPERCCNSUPPORTEDPREPAID = "UnsupportedOperation.CopperCcnSupportedPrepaid" // UNSUPPORTEDOPERATION_INSUFFICIENTFUNDS = "UnsupportedOperation.InsufficientFunds" +// UNSUPPORTEDOPERATION_NOTSUPPORTEDCREATETRAFFICMETERINGTYPECCN = "UnsupportedOperation.NotSupportedCreateTrafficMeteringTypeCcn" +// UNSUPPORTEDOPERATION_PREPAIDCCNONLYSUPPORTBANDWIDTHMETERING = "UnsupportedOperation.PrepaidCcnOnlySupportBandwidthMetering" // UNSUPPORTEDOPERATION_PREPAIDCCNONLYSUPPORTINTERREGIONLIMIT = "UnsupportedOperation.PrepaidCcnOnlySupportInterRegionLimit" // UNSUPPORTEDOPERATION_TAGALLOCATE = "UnsupportedOperation.TagAllocate" // UNSUPPORTEDOPERATION_TAGFREE = "UnsupportedOperation.TagFree" diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312/errors.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312/errors.go index 98eea10a20..b12483a15e 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312/errors.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312/errors.go @@ -32,6 +32,9 @@ const ( // 账户余额不足。 FAILEDOPERATION_BALANCEINSUFFICIENT = "FailedOperation.BalanceInsufficient" + // 创建云联网失败. 请重试你的请求,如果问题仍然存在,请联系腾讯云客服。 + FAILEDOPERATION_CREATECCNFAILED = "FailedOperation.CreateCcnFailed" + // 不支持的地域。 FAILEDOPERATION_INVALIDREGION = "FailedOperation.InvalidRegion" @@ -815,6 +818,12 @@ const ( // 与该VPC下的TKE容器的网段重叠。 UNSUPPORTEDOPERATION_CONFLICTWITHDOCKERROUTE = "UnsupportedOperation.ConflictWithDockerRoute" + // 当前账号不允许创建服务质量:铜云联网。 + UNSUPPORTEDOPERATION_COPPERCCNNOTSUPPORTEDCREATE = "UnsupportedOperation.CopperCcnNotSupportedCreate" + + // 服务质量:铜云联网仅支持创建预付费模式。 + UNSUPPORTEDOPERATION_COPPERCCNSUPPORTEDPREPAID = "UnsupportedOperation.CopperCcnSupportedPrepaid" + // 当前账号非联通账号。 UNSUPPORTEDOPERATION_CURRENTACCOUNTISNOTUNICOMACCOUNT = "UnsupportedOperation.CurrentAccountIsNotUnicomAccount" @@ -1028,6 +1037,9 @@ const ( // 该地址类型不支持释放操作。 UNSUPPORTEDOPERATION_NOTSUPPORTEDADDRESSIPSCHARGETYPE = "UnsupportedOperation.NotSupportedAddressIpsChargeType" + // 不支持创建后付费流量计费类型云联网 + UNSUPPORTEDOPERATION_NOTSUPPORTEDCREATETRAFFICMETERINGTYPECCN = "UnsupportedOperation.NotSupportedCreateTrafficMeteringTypeCcn" + // 此地域没有上线出口二资源,请到北京/广州/南京购买。 UNSUPPORTEDOPERATION_NOTSUPPORTEDPURCHASECENTEREGRESSRESOURCE = "UnsupportedOperation.NotSupportedPurchaseCenterEgressResource" @@ -1043,6 +1055,9 @@ const ( // 仅支持专业版Ckafka。 UNSUPPORTEDOPERATION_ONLYSUPPORTPROFESSIONKAFKA = "UnsupportedOperation.OnlySupportProfessionKafka" + // 预付费云联网只支持带宽计量类型 + UNSUPPORTEDOPERATION_PREPAIDCCNONLYSUPPORTBANDWIDTHMETERING = "UnsupportedOperation.PrepaidCcnOnlySupportBandwidthMetering" + // 预付费云联网只支持地域间限速。 UNSUPPORTEDOPERATION_PREPAIDCCNONLYSUPPORTINTERREGIONLIMIT = "UnsupportedOperation.PrepaidCcnOnlySupportInterRegionLimit" diff --git a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312/models.go b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312/models.go index f33351a1c3..bdb778cdfa 100644 --- a/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312/models.go +++ b/vendor/github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312/models.go @@ -695,6 +695,13 @@ type AllocateAddressesRequestParams struct { // CDC唯一ID DedicatedClusterId *string `json:"DedicatedClusterId,omitnil,omitempty" name:"DedicatedClusterId"` + // 是否使用独占资源池,默认值:True + // - True:表示使用独占资源池 + // - False:表示使用共享资源池 + // + // 说明:如需使用独占资源池,请 提交工单(https://console.cloud.tencent.com/workorder/category) 咨询,具体费用请咨询商务经理。 + IsDedicatedAddressPool *bool `json:"IsDedicatedAddressPool,omitnil,omitempty" name:"IsDedicatedAddressPool"` + // 网络出口,当前仅支持精品BGP、静态单线,这2种IP 地址类型的指定出口传入,默认值:center_egress1,其它可选值:center_egress2、center_egress3 Egress *string `json:"Egress,omitnil,omitempty" name:"Egress"` @@ -767,6 +774,13 @@ type AllocateAddressesRequest struct { // CDC唯一ID DedicatedClusterId *string `json:"DedicatedClusterId,omitnil,omitempty" name:"DedicatedClusterId"` + // 是否使用独占资源池,默认值:True + // - True:表示使用独占资源池 + // - False:表示使用共享资源池 + // + // 说明:如需使用独占资源池,请 提交工单(https://console.cloud.tencent.com/workorder/category) 咨询,具体费用请咨询商务经理。 + IsDedicatedAddressPool *bool `json:"IsDedicatedAddressPool,omitnil,omitempty" name:"IsDedicatedAddressPool"` + // 网络出口,当前仅支持精品BGP、静态单线,这2种IP 地址类型的指定出口传入,默认值:center_egress1,其它可选值:center_egress2、center_egress3 Egress *string `json:"Egress,omitnil,omitempty" name:"Egress"` @@ -802,6 +816,7 @@ func (r *AllocateAddressesRequest) FromJsonString(s string) error { delete(f, "BandwidthPackageId") delete(f, "AddressName") delete(f, "DedicatedClusterId") + delete(f, "IsDedicatedAddressPool") delete(f, "Egress") delete(f, "AntiDDoSPackageId") delete(f, "ClientToken") @@ -2438,11 +2453,9 @@ type CCN struct { QosLevel *string `json:"QosLevel,omitnil,omitempty" name:"QosLevel"` // 付费类型,PREPAID为预付费,POSTPAID为后付费。 - // 注意:此字段可能返回 null,表示取不到有效值。 InstanceChargeType *string `json:"InstanceChargeType,omitnil,omitempty" name:"InstanceChargeType"` // 限速类型,`INTER_REGION_LIMIT` 为地域间限速;`OUTER_REGION_LIMIT` 为地域出口限速。 - // 注意:此字段可能返回 null,表示取不到有效值。 BandwidthLimitType *string `json:"BandwidthLimitType,omitnil,omitempty" name:"BandwidthLimitType"` // 标签键值对。 @@ -2452,51 +2465,39 @@ type CCN struct { RoutePriorityFlag *bool `json:"RoutePriorityFlag,omitnil,omitempty" name:"RoutePriorityFlag"` // 实例关联的路由表个数。 - // 注意:此字段可能返回 null,表示取不到有效值。 RouteTableCount *uint64 `json:"RouteTableCount,omitnil,omitempty" name:"RouteTableCount"` // 是否开启云联网多路由表特性。`False`:未开启,`True`:开启。 - // 注意:此字段可能返回 null,表示取不到有效值。 RouteTableFlag *bool `json:"RouteTableFlag,omitnil,omitempty" name:"RouteTableFlag"` // `true`:实例已被封禁,流量不通,`false`:解封禁。 - // 注意:此字段可能返回 null,表示取不到有效值。 IsSecurityLock *bool `json:"IsSecurityLock,omitnil,omitempty" name:"IsSecurityLock"` // 是否开启云联网路由传播策略。`False` 未开启,`True` 开启。 - // 注意:此字段可能返回 null,表示取不到有效值。 RouteBroadcastPolicyFlag *bool `json:"RouteBroadcastPolicyFlag,omitnil,omitempty" name:"RouteBroadcastPolicyFlag"` // 是否开启等价路由功能。`False` 未开启,`True` 开启。 - // 注意:此字段可能返回 null,表示取不到有效值。 RouteECMPFlag *bool `json:"RouteECMPFlag,omitnil,omitempty" name:"RouteECMPFlag"` // 是否开启路由重叠功能。`False` 未开启,`True` 开启。 - // 注意:此字段可能返回 null,表示取不到有效值。 RouteOverlapFlag *bool `json:"RouteOverlapFlag,omitnil,omitempty" name:"RouteOverlapFlag"` // 是否开启QOS。 - // 注意:此字段可能返回 null,表示取不到有效值。 TrafficMarkingPolicyFlag *bool `json:"TrafficMarkingPolicyFlag,omitnil,omitempty" name:"TrafficMarkingPolicyFlag"` // 是否开启路由表选择策略。 - // 注意:此字段可能返回 null,表示取不到有效值。 RouteSelectPolicyFlag *bool `json:"RouteSelectPolicyFlag,omitnil,omitempty" name:"RouteSelectPolicyFlag"` // 是否开启二层云联网通道。 - // 注意:此字段可能返回 null,表示取不到有效值。 DirectConnectAccelerateChannelFlag *bool `json:"DirectConnectAccelerateChannelFlag,omitnil,omitempty" name:"DirectConnectAccelerateChannelFlag"` // 是否支持ipv6路由表 - // 注意:此字段可能返回 null,表示取不到有效值。 Ipv6Flag *bool `json:"Ipv6Flag,omitnil,omitempty" name:"Ipv6Flag"` // 是否支持路由表聚合策略 - // 注意:此字段可能返回 null,表示取不到有效值。 MrtbAggregatePolicyFlag *bool `json:"MrtbAggregatePolicyFlag,omitnil,omitempty" name:"MrtbAggregatePolicyFlag"` // 是否支持策略值 - // 注意:此字段可能返回 null,表示取不到有效值。 MrtbPolicyValueFlag *bool `json:"MrtbPolicyValueFlag,omitnil,omitempty" name:"MrtbPolicyValueFlag"` } @@ -7773,6 +7774,9 @@ type CreateVpnGatewayRequestParams struct { // SSL VPN连接数设置,可选规格:5, 10, 20, 50, 100, 200, 500, 1000;单位:个。仅 SSL / SSL_CCN 类型需要选这个参数。 MaxConnection *uint64 `json:"MaxConnection,omitnil,omitempty" name:"MaxConnection"` + + // BGP ASN。 + BgpAsn *uint64 `json:"BgpAsn,omitnil,omitempty" name:"BgpAsn"` } type CreateVpnGatewayRequest struct { @@ -7807,6 +7811,9 @@ type CreateVpnGatewayRequest struct { // SSL VPN连接数设置,可选规格:5, 10, 20, 50, 100, 200, 500, 1000;单位:个。仅 SSL / SSL_CCN 类型需要选这个参数。 MaxConnection *uint64 `json:"MaxConnection,omitnil,omitempty" name:"MaxConnection"` + + // BGP ASN。 + BgpAsn *uint64 `json:"BgpAsn,omitnil,omitempty" name:"BgpAsn"` } func (r *CreateVpnGatewayRequest) ToJsonString() string { @@ -7831,6 +7838,7 @@ func (r *CreateVpnGatewayRequest) FromJsonString(s string) error { delete(f, "Tags") delete(f, "CdcId") delete(f, "MaxConnection") + delete(f, "BgpAsn") if len(f) > 0 { return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "CreateVpnGatewayRequest has unknown keys!", "") } @@ -32570,6 +32578,9 @@ type VpnGateway struct { // SSL-VPN 客户端连接数。 MaxConnection *uint64 `json:"MaxConnection,omitnil,omitempty" name:"MaxConnection"` + + // Bgp ASN + BgpAsn *uint64 `json:"BgpAsn,omitnil,omitempty" name:"BgpAsn"` } type VpnGatewayQuota struct { diff --git a/vendor/modules.txt b/vendor/modules.txt index 0f61524288..10786f5606 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1163,7 +1163,7 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit/v20190319 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.1046 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls/v20201016 -# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1066 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1068 ## explicit; go 1.11 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors @@ -1340,7 +1340,7 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tsf/v20180326 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vod v1.0.860 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vod/v20180717 -# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.1060 +# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc v1.0.1068 ## explicit; go 1.14 github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/vpc/v20170312 # github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/waf v1.0.1037 diff --git a/website/docs/r/vpn_gateway.html.markdown b/website/docs/r/vpn_gateway.html.markdown index 456a6a8268..044c3c0746 100644 --- a/website/docs/r/vpn_gateway.html.markdown +++ b/website/docs/r/vpn_gateway.html.markdown @@ -18,15 +18,15 @@ Provides a resource to create a VPN gateway. ### VPC SSL VPN gateway ```hcl -resource "tencentcloud_vpn_gateway" "my_cgw" { - name = "test" +resource "tencentcloud_vpn_gateway" "example" { + name = "tf-example" bandwidth = 5 zone = "ap-guangzhou-3" type = "SSL" vpc_id = "vpc-86v957zb" tags = { - test = "test" + createBy = "terraform" } } ``` @@ -34,14 +34,14 @@ resource "tencentcloud_vpn_gateway" "my_cgw" { ### CCN IPSEC VPN gateway ```hcl -resource "tencentcloud_vpn_gateway" "my_cgw" { - name = "test" +resource "tencentcloud_vpn_gateway" "example" { + name = "tf-example" bandwidth = 5 zone = "ap-guangzhou-3" type = "IPSEC" tags = { - test = "test" + createBy = "terraform" } } ``` @@ -49,14 +49,29 @@ resource "tencentcloud_vpn_gateway" "my_cgw" { ### CCN SSL VPN gateway ```hcl -resource "tencentcloud_vpn_gateway" "my_cgw" { - name = "test" +resource "tencentcloud_vpn_gateway" "example" { + name = "tf-example" bandwidth = 5 zone = "ap-guangzhou-3" type = "SSL_CCN" tags = { - test = "test" + createBy = "terraform" + } +} +``` + +### CCN VPN gateway + +```hcl +resource "tencentcloud_vpn_gateway" "example" { + name = "tf-example" + bandwidth = 200 + type = "CCN" + bgp_asn = 9000 + + tags = { + createBy = "terraform" } } ``` @@ -64,14 +79,14 @@ resource "tencentcloud_vpn_gateway" "my_cgw" { ### POSTPAID_BY_HOUR VPN gateway ```hcl -resource "tencentcloud_vpn_gateway" "my_cgw" { - name = "test" +resource "tencentcloud_vpn_gateway" "example" { + name = "tf-example" vpc_id = "vpc-dk8zmwuf" bandwidth = 5 zone = "ap-guangzhou-3" tags = { - test = "test" + createBy = "terraform" } } ``` @@ -79,8 +94,8 @@ resource "tencentcloud_vpn_gateway" "my_cgw" { ### PREPAID VPN gateway ```hcl -resource "tencentcloud_vpn_gateway" "my_cgw" { - name = "test" +resource "tencentcloud_vpn_gateway" "example" { + name = "tf-example" vpc_id = "vpc-dk8zmwuf" bandwidth = 5 zone = "ap-guangzhou-3" @@ -88,7 +103,7 @@ resource "tencentcloud_vpn_gateway" "my_cgw" { prepaid_period = 1 tags = { - test = "test" + createBy = "terraform" } } ``` @@ -99,6 +114,7 @@ The following arguments are supported: * `name` - (Required, String) Name of the VPN gateway. The length of character is limited to 1-60. * `bandwidth` - (Optional, Int) The maximum public network output bandwidth of VPN gateway (unit: Mbps), the available values include: 5,10,20,50,100,200,500,1000. Default is 5. When charge type is `PREPAID`, bandwidth degradation operation is unsupported. +* `bgp_asn` - (Optional, Int) BGP ASN. Value range: 1 - 4294967295. Using BGP requires configuring ASN. * `cdc_id` - (Optional, String) CDC instance ID. * `charge_type` - (Optional, String) Charge Type of the VPN gateway. Valid value: `PREPAID`, `POSTPAID_BY_HOUR`. The default is `POSTPAID_BY_HOUR`. * `max_connection` - (Optional, Int) Maximum number of connected clients allowed for the SSL VPN gateway. Valid values: [5, 10, 20, 50, 100]. This parameter is only required for SSL VPN gateways. @@ -128,6 +144,6 @@ In addition to all arguments above, the following attributes are exported: VPN gateway can be imported using the id, e.g. ``` -$ terraform import tencentcloud_vpn_gateway.foo vpngw-8ccsnclt +$ terraform import tencentcloud_vpn_gateway.example vpngw-8ccsnclt ```