No part of this document may be reproduced or transmitted in any form or by any means without prior
written consent of Huawei Technologies Co., Ltd.
Trademarks and Permissions
and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd.
All other trademarks and trade names mentioned in this document are the property of their respective
holders.
Notice
The purchased products, services and features are stipulated by the contract made between Huawei and
the customer. All or part of the products, services and features described in this document may not be
within the purchase scope or the usage scope. Unless otherwise specied in the contract, all statements,
information, and recommendations in this document are provided "AS IS" without warranties, guarantees
or representations of any kind, either express or implied.
The information in this document is subject to change without notice. Every eort has been made in the
preparation of this document to ensure accuracy of the contents, but all statements, information, and
recommendations in this document do not constitute a warranty of any kind, express or implied.
2 Elastic Cloud Server (ECS)..................................................................................................... 3
2.1 Creating an ECS....................................................................................................................................................................... 3
2.2 Adding an EVS Disk................................................................................................................................................................ 4
2.3 Binding an EIP.......................................................................................................................................................................... 5
3 Auto Scaling (AS).................................................................................................................... 6
Conguring the Network................................................................................................................................................... 10
4.2 Binding a Virtual IP Address..............................................................................................................................................12
7.1 Creating a CCE Cluster........................................................................................................................................................ 23
7.2 Creating a CCE Node........................................................................................................................................................... 26
8 Relational Database Service (RDS)...................................................................................28
8.1 Creating an RDS MySQL DB Instance............................................................................................................................ 28
8.2 Binding an EIP to an RDS DB Instance.......................................................................................................................... 31
8.3 Adding a Read Replica........................................................................................................................................................ 33
Static credentials are simple to use. However, they require AKs and SKs to be
stored in
recommended that you provide credentials as environment variables.
congurationles in plaintext, which risks secret leakage. It is
Environment Variables
Congure the region, AK, and SK as environment variables. For example:
HuaweiCloud Terraform Provider
User Guide2 Elastic Cloud Server (ECS)
2 Elastic Cloud Server (ECS)
2.1 Creating an ECS
Application Scenario
An Elastic Cloud Server (ECS) is a basic computing unit that consists of vCPUs,
memory, OS, and Elastic Volume Service (EVS) disks. After creating an ECS, you
can use it like using your local computer or physical server. HUAWEI CLOUD
provides a variety of ECS types for
an ECS, select specications, image type, and disk type and congure network
parameters and security group rules based on your scenario requirements.
Related Resources
huaweicloud_compute_instance
Procedure
Step 1 Use data source to query the AZ, ECS
parameters.
Create the main.tfle, enter the following information, and save the le:
HuaweiCloud Terraform Provider
User Guide3 Auto Scaling (AS)
3 Auto Scaling (AS)
Application Scenarios
AS automatically adjusts service resources to keep up with your demand based on
pre-congured AS policies. With automatic resource adjustment, you can enjoy
reduced costs, improved availability, and high fault tolerance. AS applies to the
following scenarios:
●
●E-commerce: Large-scale e-commerce promotions can attract visits that may
●Live streaming: A live streaming website broadcasts popular programs from
Related Resources
●
●huaweicloud_as_group
●huaweicloud_as_policy
●huaweicloud_ces_alarmrule
Procedure
Step 1 Create an AS conguration.
Create the main.tfle, enter the following information, and save the le:
data "huaweicloud_availability_zones" "myaz" {}
Heavy-trac forums: Service load changes of a heavy-trac forum website
are dicult to predict. AS dynamically adjusts the number of cloud servers
based on monitored ECS metrics, such as vCPU Usage and Memory Usage.
break your website. AS automatically adds ECSs and increases bandwidth to
ensure that promotions will go smoothly.
14:00 to 16:00 every day. AS automatically adds ECSs and increases
bandwidth during this period to ensure smooth viewer experience.
huaweicloud_as_conguration
data "huaweicloud_compute_avors""myavor" {
availability_zone = data.huaweicloud_availability_zones.myaz.names[0]
performance_type = "normal"
cpu_core_count = 2
memory_size = 4
}
data "huaweicloud_images_image" "myimage" {
name = "Ubuntu 18.04 server 64bit"
data "huaweicloud_vpc" "vpc_1" {
name = var.vpc_name
}
data "huaweicloud_vpc_subnet" "subnet_1" {
name = var.subnet_name
vpc_id = data.huaweicloud_vpc.vpc_1.id
}
data "huaweicloud_networking_secgroup" "secgroup_1" {
name = var.secgroup_name
}