forked from aliyun/terraform-provider-alicloud
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
provider/alicloud: Add new resource ESS, including scalinggroup scali…
…ngconfiguration scalingrule and schedule (#13731) * add docs * add new resource ess * add examples * update aliyun go * merge master * fix ci
- Loading branch information
Showing
20 changed files
with
522 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
--- | ||
layout: "alicloud" | ||
page_title: "Alicloud: alicloud_ess_scaling_configuration" | ||
sidebar_current: "docs-alicloud-resource-ess-scaling-configuration" | ||
description: |- | ||
Provides a ESS scaling configuration resource. | ||
--- | ||
|
||
# alicloud\_ess\_scaling\_configuration | ||
|
||
Provides a ESS scaling configuration resource. | ||
|
||
## Example Usage | ||
|
||
``` | ||
resource "alicloud_security_group" "classic" { | ||
# Other parameters... | ||
} | ||
resource "alicloud_ess_scaling_group" "scaling" { | ||
min_size = 1 | ||
max_size = 2 | ||
removal_policies = ["OldestInstance", "NewestInstance"] | ||
} | ||
resource "alicloud_ess_scaling_configuration" "config" { | ||
scaling_group_id = "${alicloud_ess_scaling_group.scaling.id}" | ||
image_id = "ubuntu_140405_64_40G_cloudinit_20161115.vhd" | ||
instance_type = "ecs.s2.large" | ||
security_group_id = "${alicloud_security_group.classic.id}" | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `scaling_group_id` - (Required) ID of the scaling group of a scaling configuration. | ||
* `image_id` - (Required) ID of an image file, indicating the image resource selected when an instance is enabled. | ||
* `instance_type` - (Required) Resource type of an ECS instance. | ||
* `io_optimized` - (Required) Valid values are `none`, `optimized`, If `optimized`, the launched ECS instance will be I/O optimized. | ||
* `security_group_id` - (Required) ID of the security group to which a newly created instance belongs. | ||
* `scaling_configuration_name` - (Optional) Name shown for the scheduled task. If this parameter value is not specified, the default value is ScalingConfigurationId. | ||
* `internet_charge_type` - (Optional) Network billing type, Values: PayByBandwidth or PayByTraffic. If this parameter value is not specified, the default value is PayByBandwidth. | ||
* `internet_max_bandwidth_in` - (Optional) Maximum incoming bandwidth from the public network, measured in Mbps (Mega bit per second). The value range is [1,200]. | ||
* `internet_max_bandwidth_out` - (Optional) Maximum outgoing bandwidth from the public network, measured in Mbps (Mega bit per second). The value range for PayByBandwidth is [1,100]. | ||
* `system_disk_category` - (Optional) Category of the system disk. The parameter value options are cloud and ephemeral. | ||
* `data_disk` - (Optional) DataDisk mappings to attach to ecs instance. See [Block datadisk](#block-datadisk) below for details. | ||
* `instance_ids` - (Optional) ID of the ECS instance to be attached to the scaling group after it is enabled. You can input up to 20 IDs. | ||
|
||
|
||
## Block datadisk | ||
|
||
The datadisk mapping supports the following: | ||
|
||
* `size` - (Optional) Size of data disk, in GB. The value ranges from 5 to 2,000 for a cloud disk and from 5 to 1,024 for an ephemeral disk. A maximum of four values can be entered. | ||
* `category` - (Optional) Category of data disk. The parameter value options are cloud and ephemeral. | ||
* `snapshot_id` - (Optional) Snapshot used for creating the data disk. If this parameter is specified, the size parameter is neglected, and the size of the created disk is the size of the snapshot. | ||
* `device` - (Optional) Attaching point of the data disk. If this parameter is empty, the ECS automatically assigns the attaching point when an ECS is created. The parameter value ranges from /dev/xvdb to /dev/xvdz. Restrictions on attaching ECS instances: | ||
- The attached ECS instance and the scaling group must be in the same region. | ||
- The attached ECS instance and the instance with active scaling configurations must be of the same type. | ||
- The attached ECS instance must in the running state. | ||
- The attached ECS instance has not been attached to other scaling groups. | ||
- The attached ECS instance supports Subscription and Pay-As-You-Go payment methods. | ||
- If the VswitchID is specified for a scaling group, you cannot attach Classic ECS instances or ECS instances on other VPCs to the scaling group. | ||
- If the VswitchID is not specified for the scaling group, ECS instances of the VPC type cannot be attached to the scaling group | ||
* `active` - (Optional) If active current scaling configuration in the scaling group. | ||
* `enable` - (Optional) Enables the specified scaling group. | ||
- After the scaling group is successfully enabled (the group is active), the ECS instances specified by the interface are attached to the group. | ||
- If the current number of ECS instances in the scaling group is still smaller than MinSize after the ECS instances specified by the interface are attached, the Auto Scaling service automatically creates ECS instances in Pay-As-You-Go mode to make odds even. For example, a scaling group is created with MinSize = 5. Two existing ECS instances are specified by the InstanceId.N parameter when the scaling group is enabled. Three additional ECS instances are automatically created after the two ECS instances are attached by the Auto Scaling service to the scaling group. | ||
|
||
## Attributes Reference | ||
|
||
The following attributes are exported: | ||
|
||
* `id` - The scaling configuration ID. | ||
* `active` - Wether the current scaling configuration is actived. | ||
* `image_id` - The ecs instance Image id. | ||
* `instance_type` - The ecs instance type. | ||
* `io_optimized` - The ecs instance whether I/O optimized. | ||
* `security_group_id` - ID of the security group to which a newly created instance belongs. | ||
* `scaling_configuration_name` - Name of scaling configuration. | ||
* `internet_charge_type` - Internet charge type of ecs instance. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
layout: "alicloud" | ||
page_title: "Alicloud: alicloud_ess_scaling_group" | ||
sidebar_current: "docs-alicloud-resource-ess-scaling-group" | ||
description: |- | ||
Provides a ESS scaling group resource. | ||
--- | ||
|
||
# alicloud\_ess\_scaling\_group | ||
|
||
Provides a ESS scaling group resource. | ||
|
||
## Example Usage | ||
|
||
``` | ||
resource "alicloud_ess_scaling_group" "scaling" { | ||
min_size = 1 | ||
max_size = 2 | ||
removal_policies = ["OldestInstance", "NewestInstance"] | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `min_size` - (Required) Minimum number of ECS instances in the scaling group. Value range: [0, 100]. | ||
* `max_size` - (Required) Maximum number of ECS instances in the scaling group. Value range: [0, 100]. | ||
* `scaling_group_name` - (Optional) Name shown for the scaling group, which must contain 2-40 characters (English or Chinese). If this parameter is not specified, the default value is ScalingGroupId. | ||
* `default_cooldown` - (Optional) Default cool-down time (in seconds) of the scaling group. Value range: [0, 86400]. The default value is 300s. | ||
* `vswitch_id` - (Optional) The virtual switch ID which the ecs instance to be create in. | ||
* `removal_policies` - (Optional) RemovalPolicy is used to select the ECS instances you want to remove from the scaling group when multiple candidates for removal exist. Optional values: | ||
- OldestInstance: removes the first ECS instance attached to the scaling group. | ||
- NewestInstance: removes the first ECS instance attached to the scaling group. | ||
- OldestScalingConfiguration: removes the ECS instance with the oldest scaling configuration. | ||
- Default values: OldestScalingConfiguration and OldestInstance. You can enter up to two removal policies. | ||
* `db_instance_ids` - (Optional) If an RDS instance is specified in the scaling group, the scaling group automatically attaches the Intranet IP addresses of its ECS instances to the RDS access whitelist. | ||
- The specified RDS instance must be in running status. | ||
- The specified RDS instance’s whitelist must have room for more IP addresses. | ||
* `loadbalancer_ids` - (Optional) If a Server Load Balancer instance is specified in the scaling group, the scaling group automatically attaches its ECS instances to the Server Load Balancer instance. | ||
- The Server Load Balancer instance must be enabled. | ||
- Health check must be enabled for all listener ports configured for the Server Load Balancer instance; otherwise, creation fails. | ||
- The Server Load Balancer instance attached with VPC-type ECS instances cannot be attached to the scaling group. | ||
- The default weight of an ECS instance attached to the Server Load Balancer instance is 50. | ||
|
||
## Attributes Reference | ||
|
||
The following attributes are exported: | ||
|
||
* `id` - The scaling group ID. | ||
* `min_size` - The minimum number of ECS instances. | ||
* `max_size` - The maximum number of ECS instances. | ||
* `scaling_group_name` - The name of the scaling group. | ||
* `default_cooldown` - The default cool-down of the scaling group. | ||
* `removal_policies` - The removal policy used to select the ECS instance to remove from the scaling group. | ||
* `db_instance_ids` - The db instance id which the ECS instance attached to. | ||
* `loadbalancer_ids` - The slb instance id which the ECS instance attached to. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
layout: "alicloud" | ||
page_title: "Alicloud: alicloud_ess_scaling_rule" | ||
sidebar_current: "docs-alicloud-resource-ess-scaling-rule" | ||
description: |- | ||
Provides a ESS scaling rule resource. | ||
--- | ||
|
||
# alicloud\_ess\_scaling\_rule | ||
|
||
Provides a ESS scaling rule resource. | ||
|
||
## Example Usage | ||
|
||
``` | ||
resource "alicloud_ess_scaling_group" "scaling" { | ||
# Other parameters... | ||
} | ||
resource "alicloud_ess_scaling_configuration" "config" { | ||
# Other parameters... | ||
} | ||
resource "alicloud_ess_scaling_rule" "rule" { | ||
scaling_group_id = "${alicloud_ess_scaling_group.scaling.id}" | ||
adjustment_type = "TotalCapacity" | ||
adjustment_value = 2 | ||
cooldown = 60 | ||
} | ||
``` | ||
|
||
## Argument Reference | ||
|
||
The following arguments are supported: | ||
|
||
* `scaling_group_id` - (Required) ID of the scaling group of a scaling rule. | ||
* `adjustment_type` - (Required) Adjustment mode of a scaling rule. Optional values: | ||
- QuantityChangeInCapacity: It is used to increase or decrease a specified number of ECS instances. | ||
- PercentChangeInCapacity: It is used to increase or decrease a specified proportion of ECS instances. | ||
- TotalCapacity: It is used to adjust the quantity of ECS instances in the current scaling group to a specified value. | ||
* `adjustment_value` - (Required) Adjusted value of a scaling rule. Value range: | ||
- QuantityChangeInCapacity:(0, 100] U (-100, 0] | ||
- PercentChangeInCapacity:[0, 10000] U [-10000, 0] | ||
- TotalCapacity:[0, 100] | ||
* `scaling_rule_name` - (Optional) Name shown for the scaling rule, which is a string containing 2 to 40 English or Chinese characters. | ||
* `cooldown` - (Optional) Cool-down time of a scaling rule. Value range: [0, 86,400], in seconds. The default value is empty. | ||
|
||
|
||
## Attributes Reference | ||
|
||
The following attributes are exported: | ||
|
||
* `id` - The scaling rule ID. | ||
* `scaling_group_id` - The id of scaling group. | ||
* `ari` - Unique identifier of a scaling rule. | ||
* `adjustment_type` - Adjustment mode of a scaling rule. | ||
* `adjustment_value` - Adjustment value of a scaling rule. | ||
* `scaling_rule_name` - Name of a scaling rule. | ||
* `cooldown` - Cool-down time of a scaling rule. |
Oops, something went wrong.