Skip to content

Commit

Permalink
docs(dcs): fix docs issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zippo-Wang committed Sep 11, 2023
1 parent 9d08db8 commit 936d63c
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 32 deletions.
8 changes: 4 additions & 4 deletions docs/data-sources/dcs_az_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ data "flexibleengine_dcs_az_v1" "az1" {

## Argument Reference

* `name` - (Optional) Indicates the name of an AZ.
* `name` - (Optional, String) Indicates the name of an AZ.

* `code` - (Optional) Indicates the code of an AZ.
* `code` - (Optional, String) Indicates the code of an AZ.

* `port` - (Optional) Indicates the port number of an AZ.
* `port` - (Optional, String) Indicates the port number of an AZ.

## Attributes Reference
## Attribute Reference

`id` is set to the ID of the found az. In addition, the following attributes
are exported:
Expand Down
10 changes: 5 additions & 5 deletions docs/data-sources/dcs_maintainwindow_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ data "flexibleengine_dcs_maintainwindow_v1" "maintainwindow1" {

## Argument Reference

* `default` - (Optional) Specifies whether a maintenance time window is set to the default time segment.
* `default` - (Optional, Bool) Specifies whether a maintenance time window is set to the default time segment.

* `seq` - (Optional) Specifies the sequential number of a maintenance time window.
* `seq` - (Optional, Int) Specifies the sequential number of a maintenance time window.

* `begin` - (Optional) Specifies the time at which a maintenance time window starts.
* `begin` - (Optional, String) Specifies the time at which a maintenance time window starts.

* `end` - (Optional) Specifies the time at which a maintenance time window ends.
* `end` - (Optional, String) Specifies the time at which a maintenance time window ends.

## Attributes Reference
## Attribute Reference

`id` is set to the ID of the found maintainwindow. In addition, the following attributes
are exported:
Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/dcs_product_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ data "flexibleengine_dcs_product_v1" "product6" {
* `spec_code` - (Optional, String) Specifies the DCS instance specification code. You can log in to the DCS console,
click *Buy DCS Instance*, and find the corresponding instance specification.

## Attributes Reference
## Attribute Reference

In addition to all arguments above, the following attributes are exported:

Expand Down
51 changes: 29 additions & 22 deletions docs/resources/dcs_instance_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,46 +116,46 @@ resource "flexibleengine_dcs_instance_v1" "instance_1" {

The following arguments are supported:

* `name` - (Required) Indicates the name of an instance. An instance name starts with a letter,
* `name` - (Required, String) Indicates the name of an instance. An instance name starts with a letter,
consists of 4 to 64 characters, and supports only letters, digits, and hyphens (-).

* `description` - (Optional) Indicates the description of an instance. It is a character
* `description` - (Optional, String) Indicates the description of an instance. It is a character
string containing not more than 1024 characters.

* `engine` - (Required) Indicates a cache engine. Valid values are *Redis* and *Memcached*.
* `engine` - (Required, String, ForceNew) Indicates a cache engine. Valid values are *Redis* and *Memcached*.
Changing this creates a new instance.

* `engine_version` - (Optional) Indicates the version of a cache engine.
* `engine_version` - (Optional, String, ForceNew) Indicates the version of a cache engine.
This parameter is only supported and **mandatory** for *Redis* engine.
Changing this creates a new instance.

* `capacity` - (Required) Indicates the Cache capacity. Unit: GB.
* `capacity` - (Required, Float, ForceNew) Indicates the Cache capacity. Unit: GB.
For a DCS Redis or Memcached instance in single-node or master/standby mode, the cache
capacity can be 2 GB, 4 GB, 8 GB, 16 GB, 32 GB, or 64 GB.
For a DCS Redis instance in cluster mode, the cache capacity can be 64, 128, 256, 512,
or 1024 GB. Changing this creates a new instance.

* `access_user` - (Optional) Username used for accessing a DCS instance after password
* `access_user` - (Optional, String, ForceNew) Username used for accessing a DCS instance after password
authentication. A username starts with a letter, consists of 1 to 64 characters,
and supports only letters, digits, and hyphens (-).
Changing this creates a new instance.

* `password` - (Required) Password of a DCS instance.
* `password` - (Required, String, ForceNew) Password of a DCS instance.
The password of a DCS Redis instance must meet the following complexity requirements:
Changing this creates a new instance.

* `vpc_id` - (Required) Specifies the id of the VPC. Changing this creates a new instance.
* `vpc_id` - (Required, String, ForceNew) Specifies the id of the VPC. Changing this creates a new instance.

* `network_id` - (Required) Specifies the ID of the VPC subnet. Changing this creates a new instance.
* `network_id` - (Required, String, ForceNew) Specifies the ID of the VPC subnet. Changing this creates a new instance.

* `security_group_id` - (Optional) Specifies the id of the security group which the instance belongs to.
* `security_group_id` - (Optional, String) Specifies the id of the security group which the instance belongs to.
This parameter is only supported and **mandatory** for Memcached and Redis 3.0 versions.

* `available_zones` - (Required) IDs or Names of the AZs where cache nodes reside. For details
* `available_zones` - (Required, List, ForceNew) IDs or Names of the AZs where cache nodes reside. For details
on how to query AZs, see Querying AZ Information.
Changing this creates a new instance.

* `product_id` - (Optional) Product ID used to differentiate DCS instance types.
* `product_id` - (Optional, String, ForceNew) Product ID used to differentiate DCS instance types.

+ For **Redis 4.0/5.0** instance, please use [flexibleengine_dcs_product_v1](https://registry.terraform.io/providers/FlexibleEngineCloud/flexibleengine/latest/docs/data-sources/dcs_product_v1)
to get the ID of an available product.
Expand All @@ -166,11 +166,11 @@ The following arguments are supported:

Changing this creates a new instance.

* `port` - (Optional) Port customization, which is supported only by Redis 4.0 and Redis 5.0 instances and not by
Redis 3.0 and Memcached instances. The values ranges from **1** to **65535**. The default value is **6379**.
* `port` - (Optional, Int, ForceNew) Port customization, which is supported only by Redis 4.0 and Redis 5.0 instances
and not by Redis 3.0 and Memcached instances. The values ranges from **1** to **65535**. The default value is **6379**.
Changing this creates a new instance.

* `maintain_begin` - (Optional) Indicates the time at which a maintenance time window starts.
* `maintain_begin` - (Optional, String) Indicates the time at which a maintenance time window starts.
Format: HH:mm:ss.
The start time and end time of a maintenance time window must indicate the time segment of
a supported maintenance time window. For details, see section Querying Maintenance Time Windows.
Expand All @@ -179,7 +179,7 @@ The following arguments are supported:
is left blank, parameter maintain_end is also blank. In this case, the system automatically
allocates the default start time 02:00.

* `maintain_end` - (Optional) Indicates the time at which a maintenance time window ends.
* `maintain_end` - (Optional, String) Indicates the time at which a maintenance time window ends.
Format: HH:mm:ss.
The start time and end time of a maintenance time window must indicate the time segment of
a supported maintenance time window. For details, see section Querying Maintenance Time Windows.
Expand All @@ -189,24 +189,24 @@ The following arguments are supported:
blank, parameter maintain_begin is also blank. In this case, the system automatically allocates
the default end time 06:00.

* `save_days` - (Optional) Retention time. Unit: day. Range: 1–7.
* `save_days` - (Optional, Int, ForceNew) Retention time. Unit: day. Range: 1–7.
Changing this creates a new instance.

* `backup_type` - (Optional) Backup type. Options:
* `backup_type` - (Optional, String, ForceNew) Backup type. Options:
auto: automatic backup.
manual: manual backup.
Changing this creates a new instance.

* `begin_at` - (Optional) Time at which backup starts. "00:00-01:00" indicates that backup
* `begin_at` - (Optional, String, ForceNew) Time at which backup starts. "00:00-01:00" indicates that backup
starts at 00:00:00. Changing this creates a new instance.

* `period_type` - (Optional) Interval at which backup is performed. Currently, only weekly
* `period_type` - (Optional, String, ForceNew) Interval at which backup is performed. Currently, only weekly
backup is supported. Changing this creates a new instance.

* `backup_at` - (Optional) Day in a week on which backup starts. Range: 1–7. Where: 1
* `backup_at` - (Optional, List, ForceNew) Day in a week on which backup starts. Range: 1–7. Where: 1
indicates Monday; 7 indicates Sunday. Changing this creates a new instance.

## Attributes Reference
## Attribute Reference

In addition to all arguments above, the following attributes are exported:

Expand All @@ -226,6 +226,13 @@ In addition to all arguments above, the following attributes are exported:
* `used_memory` - Size of the used memory. Unit: MB.
* `user_id` - Indicates a user ID.

## Timeouts

This resource provides the following timeouts configuration options:

* `create` - Default is 20 minutes.
* `delete` - Default is 15 minutes.

## Import

DCS instances can be imported using the `id`, e.g.
Expand Down
5 changes: 5 additions & 0 deletions flexibleengine/resource_flexibleengine_dcs_instance_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ func resourceDcsInstanceV1() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"user_id": {
Type: schema.TypeString,
Computed: true,
},
},
}
}
Expand Down Expand Up @@ -372,6 +376,7 @@ func resourceDcsInstancesV1Read(d *schema.ResourceData, meta interface{}) error
d.Set("maintain_end", v.MaintainEnd)
d.Set("access_user", v.AccessUser)
d.Set("available_zones", v.AvailableZones)
d.Set("user_id", v.UserID)

// set capacity by Capacity and CapacityMinor
var capacity float64 = float64(v.Capacity)
Expand Down

0 comments on commit 936d63c

Please sign in to comment.