diff --git a/tencentcloud/resource_tc_vpn_gateway.go b/tencentcloud/resource_tc_vpn_gateway.go index 542c7f8d88..7495cdcaff 100644 --- a/tencentcloud/resource_tc_vpn_gateway.go +++ b/tencentcloud/resource_tc_vpn_gateway.go @@ -128,6 +128,18 @@ func resourceTencentCloudVpnGateway() *schema.Resource { Default: VPN_CHARGE_TYPE_POSTPAID_BY_HOUR, Description: "Charge Type of the VPN gateway. Valid value: `PREPAID`, `POSTPAID_BY_HOUR`. The default is `POSTPAID_BY_HOUR`.", }, + "cdc_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + Description: "CDC instance ID.", + }, + "max_connection": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + Description: "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.", + }, "expired_time": { Type: schema.TypeString, Computed: true, @@ -208,6 +220,15 @@ func resourceTencentCloudVpnGatewayCreate(d *schema.ResourceData, meta interface } request.VpcId = helper.String(d.Get("vpc_id").(string)) } + + if v, ok := d.GetOk("cdc_id"); ok { + request.CdcId = helper.String(v.(string)) + } + + if v, ok := d.GetOk("max_connection"); ok { + request.MaxConnection = helper.IntUint64(v.(int)) + } + var response *vpc.CreateVpnGatewayResponse err := resource.Retry(readRetryTimeout, func() *resource.RetryError { result, e := meta.(*TencentCloudClient).apiV3Conn.UseVpcClient().CreateVpnGateway(request) @@ -306,6 +327,8 @@ func resourceTencentCloudVpnGatewayRead(d *schema.ResourceData, meta interface{} _ = d.Set("new_purchase_plan", gateway.NewPurchasePlan) _ = d.Set("restrict_state", gateway.RestrictState) _ = d.Set("zone", gateway.Zone) + _ = d.Set("cdc_id", gateway.CdcId) + _ = d.Set("max_connection", gateway.MaxConnection) //tags tagService := TagService{client: meta.(*TencentCloudClient).apiV3Conn} region := meta.(*TencentCloudClient).apiV3Conn.Region @@ -412,6 +435,10 @@ func resourceTencentCloudVpnGatewayUpdate(d *schema.ResourceData, meta interface d.SetPartial("tags") } + if d.HasChange("cdc_id") || d.HasChange("max_connection") { + return fmt.Errorf("cdc_id and max_connection do not support change now.") + } + d.Partial(false) return resourceTencentCloudVpnGatewayRead(d, meta) diff --git a/website/docs/r/vpn_gateway.html.markdown b/website/docs/r/vpn_gateway.html.markdown index 3fd584ddba..1a8e283d7f 100644 --- a/website/docs/r/vpn_gateway.html.markdown +++ b/website/docs/r/vpn_gateway.html.markdown @@ -54,7 +54,9 @@ The following arguments are supported: * `name` - (Required) Name of the VPN gateway. The length of character is limited to 1-60. * `zone` - (Required, ForceNew) Zone of the VPN gateway. * `bandwidth` - (Optional) 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. +* `cdc_id` - (Optional) CDC instance ID. * `charge_type` - (Optional) Charge Type of the VPN gateway. Valid value: `PREPAID`, `POSTPAID_BY_HOUR`. The default is `POSTPAID_BY_HOUR`. +* `max_connection` - (Optional) 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. * `prepaid_period` - (Optional) Period of instance to be prepaid. Valid value: `1`, `2`, `3`, `4`, `6`, `7`, `8`, `9`, `12`, `24`, `36`. The unit is month. Caution: when this para and renew_flag para are valid, the request means to renew several months more pre-paid period. This para can only be set to take effect in create operation. * `prepaid_renew_flag` - (Optional) Flag indicates whether to renew or not. Valid value: `NOTIFY_AND_RENEW`, `NOTIFY_AND_AUTO_RENEW`, `NOT_NOTIFY_AND_NOT_RENEW`. This para can only be set to take effect in create operation. * `tags` - (Optional) A list of tags used to associate different resources.