diff --git a/.changelog/3157.txt b/.changelog/3157.txt new file mode 100644 index 0000000000..3ca75546a5 --- /dev/null +++ b/.changelog/3157.txt @@ -0,0 +1,19 @@ +```release-note:enhancement +resource/tencentcloud_eip_association: update doc +``` + +```release-note:enhancement +resource/tencentcloud_eip_public_address_adjust: update doc +``` + +```release-note:enhancement +resource/tencentcloud_instance: update doc +``` + +```release-note:enhancement +resource/tencentcloud_instance_set: Added a new field `private_ip_addresses` to support specifying multiple IPs to create instances +``` + +```release-note:enhancement +data-source/tencentcloud_eips: Abandon `public_ip` and add `address_ip` +``` \ No newline at end of file diff --git a/tencentcloud/services/cfs/resource_tc_cfs_user_quota.md b/tencentcloud/services/cfs/resource_tc_cfs_user_quota.md index 1ff839c573..1e04be7d22 100644 --- a/tencentcloud/services/cfs/resource_tc_cfs_user_quota.md +++ b/tencentcloud/services/cfs/resource_tc_cfs_user_quota.md @@ -1,5 +1,7 @@ Provides a resource to create a cfs user_quota +~> **NOTE:** Only some Turbo instances can be used. If you need to call it, please submit a ticket to contact us. + Example Usage ```hcl diff --git a/tencentcloud/services/cvm/data_source_tc_eips.go b/tencentcloud/services/cvm/data_source_tc_eips.go index 58057f6c3d..34ab885b2d 100644 --- a/tencentcloud/services/cvm/data_source_tc_eips.go +++ b/tencentcloud/services/cvm/data_source_tc_eips.go @@ -34,6 +34,12 @@ func DataSourceTencentCloudEips() *schema.Resource { Type: schema.TypeString, Optional: true, Description: "The elastic ip address.", + Deprecated: "Use 'address_ip' instead.", + }, + "address_ip": { + Type: schema.TypeString, + Optional: true, + Description: "The elastic ip address.", }, "tags": { Type: schema.TypeMap, @@ -77,6 +83,11 @@ func DataSourceTencentCloudEips() *schema.Resource { Computed: true, Description: "The elastic ip address.", }, + "address_ip": { + Type: schema.TypeString, + Computed: true, + Description: "The elastic ip address.", + }, "instance_id": { Type: schema.TypeString, Computed: true, @@ -124,6 +135,9 @@ func dataSourceTencentCloudEipsRead(d *schema.ResourceData, meta interface{}) er if v, ok := d.GetOk("public_ip"); ok { filter["public-ip"] = []string{v.(string)} } + if v, ok := d.GetOk("address_ip"); ok { + filter["address-ip"] = []string{v.(string)} + } tags := helper.GetTags(d, "tags") @@ -163,6 +177,7 @@ EIP_LOOP: "eip_type": eip.AddressType, "status": eip.AddressStatus, "public_ip": eip.AddressIp, + "address_ip": eip.AddressIp, "instance_id": eip.InstanceId, "eni_id": eip.NetworkInterfaceId, "create_time": eip.CreatedTime, diff --git a/tencentcloud/services/cvm/resource_tc_eip_association.go b/tencentcloud/services/cvm/resource_tc_eip_association.go index 0f981692ae..c4862eab54 100644 --- a/tencentcloud/services/cvm/resource_tc_eip_association.go +++ b/tencentcloud/services/cvm/resource_tc_eip_association.go @@ -64,7 +64,7 @@ func ResourceTencentCloudEipAssociation() *schema.Resource { ConflictsWith: []string{ "instance_id", }, - Description: "Indicates an IP belongs to the `network_interface_id`. This field is conflict with `instance_id`.", + Description: "The private IP to bind to. If `network_interface_id` is specified, `private_ip` must also be specified. It cannot be specified at the same time as `instance_id`.Also make sure the specified `private_ip` is a private IP on the specified `network_interface_id`.", }, }, } diff --git a/tencentcloud/services/cvm/resource_tc_eip_public_address_adjust.md b/tencentcloud/services/cvm/resource_tc_eip_public_address_adjust.md index 7ed182846f..1860929b71 100644 --- a/tencentcloud/services/cvm/resource_tc_eip_public_address_adjust.md +++ b/tencentcloud/services/cvm/resource_tc_eip_public_address_adjust.md @@ -1,4 +1,4 @@ -Provides a resource to create a eip public_address_adjust +Provides a resource to create a eip public_address_adjust. Used to change the IP address. It supports changing the common public IP of the CVM instance and the EIP with monthly bandwidth. `address_id` and `instance_id` cannot exist at the same time. When `address_id` is passed, only the EIP with monthly bandwidth is supported. Example Usage diff --git a/tencentcloud/services/cvm/resource_tc_instance.go b/tencentcloud/services/cvm/resource_tc_instance.go index 333179d9fd..b66b323659 100644 --- a/tencentcloud/services/cvm/resource_tc_instance.go +++ b/tencentcloud/services/cvm/resource_tc_instance.go @@ -60,7 +60,7 @@ func ResourceTencentCloudInstance() *schema.Resource { "instance_count": { Type: schema.TypeInt, Optional: true, - Deprecated: "It has been deprecated from version 1.59.18. Use built-in `count` instead.", + Deprecated: "It has been deprecated from version 1.59.18. Use built-in `count` instead. https://developer.hashicorp.com/terraform/language/meta-arguments/count.", ValidateFunc: tccommon.ValidateIntegerInRange(1, 100), Description: "The number of instances to be purchased. Value range:[1,100]; default value: 1.", }, @@ -98,7 +98,7 @@ func ResourceTencentCloudInstance() *schema.Resource { "stopped_mode": { Type: schema.TypeString, Optional: true, - Description: "Billing method of a pay-as-you-go instance after shutdown. Available values: `KEEP_CHARGING`,`STOP_CHARGING`. Default `KEEP_CHARGING`.", + Description: "Billing method of a pay-as-you-go instance after shutdown. Available values: `KEEP_CHARGING`,`STOP_CHARGING`. Default `KEEP_CHARGING`.Need to be used with the running_flag field set to `false`.", ValidateFunc: tccommon.ValidateAllowedStringValue([]string{ CVM_STOP_MODE_KEEP_CHARGING, CVM_STOP_MODE_STOP_CHARGING, @@ -245,7 +245,7 @@ func ResourceTencentCloudInstance() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - Description: "System disk snapshot ID used to initialize the system disk. When system disk type is `LOCAL_BASIC` and `LOCAL_SSD`, disk id is not supported.", + Description: "System disk snapshot ID used to initialize the system disk. When system disk type is `LOCAL_BASIC` and `LOCAL_SSD`, disk id is not supported. Invalid value passed in when creating.", }, "system_disk_name": { Type: schema.TypeString, @@ -293,7 +293,7 @@ func ResourceTencentCloudInstance() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, - Description: "Data disk ID used to initialize the data disk. When data disk type is `LOCAL_BASIC` and `LOCAL_SSD`, disk id is not supported.", + Description: "Data disk ID used to initialize the data disk. When data disk type is `LOCAL_BASIC` and `LOCAL_SSD`, disk id is not supported. Invalid value passed in when creating.", }, "delete_with_instance": { Type: schema.TypeBool, diff --git a/tencentcloud/services/cvm/resource_tc_instance_set.go b/tencentcloud/services/cvm/resource_tc_instance_set.go index 3b1a1d64ee..7463e13199 100644 --- a/tencentcloud/services/cvm/resource_tc_instance_set.go +++ b/tencentcloud/services/cvm/resource_tc_instance_set.go @@ -138,10 +138,23 @@ func ResourceTencentCloudInstanceSet() *schema.Resource { Description: "The ID of a VPC subnet. If you want to create instances in a VPC network, this parameter must be set.", }, "private_ip": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Description: "The private IP to be assigned to this instance, must be in the provided subnet and available.", + Type: schema.TypeString, + Optional: true, + Computed: true, + ConflictsWith: []string{ + "private_ip_addresses", + }, + Description: "The private IP to be assigned to this instance, must be in the provided subnet and available. Cannot be set at the same time as `private_ip_addresses`.", + }, + "private_ip_addresses": { + Type: schema.TypeSet, + Elem: &schema.Schema{Type: schema.TypeString}, + Optional: true, + Computed: true, + ConflictsWith: []string{ + "private_ip", + }, + Description: "Private network subnet IP array, which can be used when creating an instance or modifying instance vpc attributes. Currently, only batch creation of multiple instances supports passing in multiple IPs of the same subnet. Cannot be set at the same time as `private_ip`.", }, // security group "security_groups": { @@ -415,6 +428,15 @@ func doResourceTencentCloudInstanceSetCreate(d *schema.ResourceData, meta interf if v, ok = d.GetOk("private_ip"); ok { request.VirtualPrivateCloud.PrivateIpAddresses = []*string{helper.String(v.(string))} } + + if v, ok := d.GetOk("private_ip_addresses"); ok { + addressListSet := v.(*schema.Set).List() + for i := range addressListSet { + addressList := addressListSet[i].(string) + request.VirtualPrivateCloud.PrivateIpAddresses = append(request.VirtualPrivateCloud.PrivateIpAddresses, &addressList) + } + } + } if v, ok := d.GetOk("security_groups"); ok { @@ -579,6 +601,14 @@ func doResourceTencentCloudInstanceSetRead(d *schema.ResourceData, meta interfac _ = d.Set("keep_image_login", *instance.LoginSettings.KeepImageLogin == CVM_IMAGE_LOGIN) } + privateIpAddresses := []*string{} + for _, v := range instanceSet { + if len(v.PrivateIpAddresses) > 0 { + privateIpAddresses = append(privateIpAddresses, v.PrivateIpAddresses...) + } + } + _ = d.Set("private_ip_addresses", privateIpAddresses) + return nil } diff --git a/website/docs/d/eips.html.markdown b/website/docs/d/eips.html.markdown index a79ede63f7..104bc6160e 100644 --- a/website/docs/d/eips.html.markdown +++ b/website/docs/d/eips.html.markdown @@ -57,9 +57,10 @@ data "tencentcloud_eips" "example" { The following arguments are supported: +* `address_ip` - (Optional, String) The elastic ip address. * `eip_id` - (Optional, String) ID of the EIP to be queried. * `eip_name` - (Optional, String) Name of the EIP to be queried. -* `public_ip` - (Optional, String) The elastic ip address. +* `public_ip` - (Optional, String, **Deprecated**) Use 'address_ip' instead. The elastic ip address. * `result_output_file` - (Optional, String) Used to save results. * `tags` - (Optional, Map) The tags of EIP. @@ -68,6 +69,7 @@ The following arguments are supported: In addition to all arguments above, the following attributes are exported: * `eip_list` - An information list of EIP. Each element contains the following attributes: + * `address_ip` - The elastic ip address. * `create_time` - Creation time of the EIP. * `eip_id` - ID of the EIP. * `eip_name` - Name of the EIP. diff --git a/website/docs/r/eip_association.html.markdown b/website/docs/r/eip_association.html.markdown index bd1293b973..9709274cfd 100644 --- a/website/docs/r/eip_association.html.markdown +++ b/website/docs/r/eip_association.html.markdown @@ -123,7 +123,7 @@ The following arguments are supported: * `eip_id` - (Required, String, ForceNew) The ID of EIP. * `instance_id` - (Optional, String, ForceNew) The CVM or CLB instance id going to bind with the EIP. This field is conflict with `network_interface_id` and `private_ip fields`. * `network_interface_id` - (Optional, String, ForceNew) Indicates the network interface id like `eni-xxxxxx`. This field is conflict with `instance_id`. -* `private_ip` - (Optional, String, ForceNew) Indicates an IP belongs to the `network_interface_id`. This field is conflict with `instance_id`. +* `private_ip` - (Optional, String, ForceNew) The private IP to bind to. If `network_interface_id` is specified, `private_ip` must also be specified. It cannot be specified at the same time as `instance_id`.Also make sure the specified `private_ip` is a private IP on the specified `network_interface_id`. ## Attributes Reference diff --git a/website/docs/r/eip_public_address_adjust.html.markdown b/website/docs/r/eip_public_address_adjust.html.markdown index b74b682e2f..27e09ebdce 100644 --- a/website/docs/r/eip_public_address_adjust.html.markdown +++ b/website/docs/r/eip_public_address_adjust.html.markdown @@ -4,12 +4,12 @@ layout: "tencentcloud" page_title: "TencentCloud: tencentcloud_eip_public_address_adjust" sidebar_current: "docs-tencentcloud-resource-eip_public_address_adjust" description: |- - Provides a resource to create a eip public_address_adjust + Provides a resource to create a eip public_address_adjust. Used to change the IP address. It supports changing the common public IP of the CVM instance and the EIP with monthly bandwidth. `address_id` and `instance_id` cannot exist at the same time. When `address_id` is passed, only the EIP with monthly bandwidth is supported. --- # tencentcloud_eip_public_address_adjust -Provides a resource to create a eip public_address_adjust +Provides a resource to create a eip public_address_adjust. Used to change the IP address. It supports changing the common public IP of the CVM instance and the EIP with monthly bandwidth. `address_id` and `instance_id` cannot exist at the same time. When `address_id` is passed, only the EIP with monthly bandwidth is supported. ## Example Usage diff --git a/website/docs/r/instance.html.markdown b/website/docs/r/instance.html.markdown index e3697046a0..50ea0123fe 100644 --- a/website/docs/r/instance.html.markdown +++ b/website/docs/r/instance.html.markdown @@ -233,7 +233,7 @@ The following arguments are supported: * `instance_charge_type_prepaid_period` - (Optional, Int) The tenancy (time unit is month) of the prepaid instance, NOTE: it only works when instance_charge_type is set to `PREPAID`. Valid values are `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `11`, `12`, `24`, `36`, `48`, `60`. * `instance_charge_type_prepaid_renew_flag` - (Optional, String) Auto renewal flag. Valid values: `NOTIFY_AND_AUTO_RENEW`: notify upon expiration and renew automatically, `NOTIFY_AND_MANUAL_RENEW`: notify upon expiration but do not renew automatically, `DISABLE_NOTIFY_AND_MANUAL_RENEW`: neither notify upon expiration nor renew automatically. Default value: `NOTIFY_AND_MANUAL_RENEW`. If this parameter is specified as `NOTIFY_AND_AUTO_RENEW`, the instance will be automatically renewed on a monthly basis if the account balance is sufficient. NOTE: it only works when instance_charge_type is set to `PREPAID`. * `instance_charge_type` - (Optional, String) The charge type of instance. Valid values are `PREPAID`, `POSTPAID_BY_HOUR`, `SPOTPAID`, `CDHPAID` and `CDCPAID`. The default is `POSTPAID_BY_HOUR`. Note: TencentCloud International only supports `POSTPAID_BY_HOUR` and `CDHPAID`. `PREPAID` instance may not allow to delete before expired. `SPOTPAID` instance must set `spot_instance_type` and `spot_max_price` at the same time. `CDHPAID` instance must set `cdh_instance_type` and `cdh_host_id`. -* `instance_count` - (Optional, Int, **Deprecated**) It has been deprecated from version 1.59.18. Use built-in `count` instead. The number of instances to be purchased. Value range:[1,100]; default value: 1. +* `instance_count` - (Optional, Int, **Deprecated**) It has been deprecated from version 1.59.18. Use built-in `count` instead. https://developer.hashicorp.com/terraform/language/meta-arguments/count. The number of instances to be purchased. Value range:[1,100]; default value: 1. * `instance_name` - (Optional, String) The name of the instance. The max length of instance_name is 128, and default value is `Terraform-CVM-Instance`. * `instance_type` - (Optional, String) The type of the instance. * `internet_charge_type` - (Optional, String) Internet charge type of the instance, Valid values are `BANDWIDTH_PREPAID`, `TRAFFIC_POSTPAID_BY_HOUR`, `BANDWIDTH_POSTPAID_BY_HOUR` and `BANDWIDTH_PACKAGE`. If not set, internet charge type are consistent with the cvm charge type by default. This value takes NO Effect when changing and does not need to be set when `allocate_public_ip` is false. @@ -250,9 +250,9 @@ The following arguments are supported: * `security_groups` - (Optional, Set: [`String`], **Deprecated**) It will be deprecated. Use `orderly_security_groups` instead. A list of security group IDs to associate with. * `spot_instance_type` - (Optional, String) Type of spot instance, only support `ONE-TIME` now. Note: it only works when instance_charge_type is set to `SPOTPAID`. * `spot_max_price` - (Optional, String, ForceNew) Max price of a spot instance, is the format of decimal string, for example "0.50". Note: it only works when instance_charge_type is set to `SPOTPAID`. -* `stopped_mode` - (Optional, String) Billing method of a pay-as-you-go instance after shutdown. Available values: `KEEP_CHARGING`,`STOP_CHARGING`. Default `KEEP_CHARGING`. +* `stopped_mode` - (Optional, String) Billing method of a pay-as-you-go instance after shutdown. Available values: `KEEP_CHARGING`,`STOP_CHARGING`. Default `KEEP_CHARGING`.Need to be used with the running_flag field set to `false`. * `subnet_id` - (Optional, String) The ID of a VPC subnet. If you want to create instances in a VPC network, this parameter must be set. -* `system_disk_id` - (Optional, String) System disk snapshot ID used to initialize the system disk. When system disk type is `LOCAL_BASIC` and `LOCAL_SSD`, disk id is not supported. +* `system_disk_id` - (Optional, String) System disk snapshot ID used to initialize the system disk. When system disk type is `LOCAL_BASIC` and `LOCAL_SSD`, disk id is not supported. Invalid value passed in when creating. * `system_disk_name` - (Optional, String) Name of the system disk. * `system_disk_resize_online` - (Optional, Bool) Resize online. * `system_disk_size` - (Optional, Int) Size of the system disk. unit is GB, Default is 50GB. If modified, the instance may force stop. @@ -266,7 +266,7 @@ The `data_disks` object supports the following: * `data_disk_size` - (Required, Int) Size of the data disk, and unit is GB. * `data_disk_type` - (Required, String, ForceNew) Data disk type. For more information about limits on different data disk types, see [Storage Overview](https://intl.cloud.tencent.com/document/product/213/4952). Valid values: LOCAL_BASIC: local disk, LOCAL_SSD: local SSD disk, LOCAL_NVME: local NVME disk, specified in the InstanceType, LOCAL_PRO: local HDD disk, specified in the InstanceType, CLOUD_BASIC: HDD cloud disk, CLOUD_PREMIUM: Premium Cloud Storage, CLOUD_SSD: SSD, CLOUD_HSSD: Enhanced SSD, CLOUD_TSSD: Tremendous SSD, CLOUD_BSSD: Balanced SSD. -* `data_disk_id` - (Optional, String) Data disk ID used to initialize the data disk. When data disk type is `LOCAL_BASIC` and `LOCAL_SSD`, disk id is not supported. +* `data_disk_id` - (Optional, String) Data disk ID used to initialize the data disk. When data disk type is `LOCAL_BASIC` and `LOCAL_SSD`, disk id is not supported. Invalid value passed in when creating. * `data_disk_name` - (Optional, String) Name of data disk. * `data_disk_snapshot_id` - (Optional, String, ForceNew) Snapshot ID of the data disk. The selected data disk snapshot size must be smaller than the data disk size. * `delete_with_instance_prepaid` - (Optional, Bool, ForceNew) Decides whether the disk is deleted with instance(only applied to `CLOUD_BASIC`, `CLOUD_SSD` and `CLOUD_PREMIUM` disk with `PREPAID` instance), default is false. diff --git a/website/docs/r/instance_set.html.markdown b/website/docs/r/instance_set.html.markdown index 8f3907b432..d6573197c3 100644 --- a/website/docs/r/instance_set.html.markdown +++ b/website/docs/r/instance_set.html.markdown @@ -96,7 +96,8 @@ The following arguments are supported: * `key_name` - (Optional, String) The key pair to use for the instance, it looks like `skey-16jig7tx`. Modifying will cause the instance reset. * `password` - (Optional, String) Password for the instance. In order for the new password to take effect, the instance will be restarted after the password change. Modifying will cause the instance reset. * `placement_group_id` - (Optional, String, ForceNew) The ID of a placement group. -* `private_ip` - (Optional, String) The private IP to be assigned to this instance, must be in the provided subnet and available. +* `private_ip_addresses` - (Optional, Set: [`String`]) Private network subnet IP array, which can be used when creating an instance or modifying instance vpc attributes. Currently, only batch creation of multiple instances supports passing in multiple IPs of the same subnet. Cannot be set at the same time as `private_ip`. +* `private_ip` - (Optional, String) The private IP to be assigned to this instance, must be in the provided subnet and available. Cannot be set at the same time as `private_ip_addresses`. * `project_id` - (Optional, Int) The project the instance belongs to, default to 0. * `security_groups` - (Optional, Set: [`String`]) A list of security group IDs to associate with. * `subnet_id` - (Optional, String) The ID of a VPC subnet. If you want to create instances in a VPC network, this parameter must be set.