Skip to content

fix(cvm): [137843507] Modify multiple cvm doc #3157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
19 changes: 19 additions & 0 deletions .changelog/3157.txt
Original file line number Diff line number Diff line change
@@ -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`
```
2 changes: 2 additions & 0 deletions tencentcloud/services/cfs/resource_tc_cfs_user_quota.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
15 changes: 15 additions & 0 deletions tencentcloud/services/cvm/data_source_tc_eips.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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")

Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion tencentcloud/services/cvm/resource_tc_eip_association.go
Original file line number Diff line number Diff line change
Expand Up @@ -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`.",
},
},
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand Down
8 changes: 4 additions & 4 deletions tencentcloud/services/cvm/resource_tc_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个不用去吧

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.",
},
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
38 changes: 34 additions & 4 deletions tencentcloud/services/cvm/resource_tc_instance_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}

Expand Down
4 changes: 3 additions & 1 deletion website/docs/d/eips.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/eip_association.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions website/docs/r/eip_public_address_adjust.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions website/docs/r/instance.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion website/docs/r/instance_set.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading