By Xiaozhu from OpenAPI & Tools Team
In the cloud computing and big data era, continuous enterprise data cloudification, business development, and technical architecture evolution are bringing more complex O&M and higher costs for managing resources, applications, and data. Such constant and complex business scenario changes have raised the following questions:
If one or more automated tools are available to address such problems, machines can do complicated work, whereas users only need to focus on simple configurations. Such automation can greatly improve the work efficiency.
How can we make machines to do all repetitive work for users? This is where Infrastructure as Code (IaC) comes in. IaC is a process where Alibaba Cloud resources, cloud image building processes, application deployment processes, and data management processes are defined through code in templates. By managing these templates through developer tools, developers can efficiently manage Alibaba Cloud resources, applications, and data.
Currently, Alibaba Cloud supports mainstream open source management tools, such as Terraform, Ansible, Packer, Vault, and BOSH. These tools help developers release more productive forces in the automatic O&M, multi-cloud management, cloud migration, and data security domains and efficiently manage the cloud infrastructure in a unified manner.
Terraform is an open source resource orchestration tool. You can use the Terraform syntax to define resources through code in a Terraform template. Then, you can use Alibaba Cloud Terraform Provider to create and manage Alibaba Cloud resources, such as Elastic Compute Service (ECS) instances, VPCs, VSwitches, and Server Load Balancer (SLB) instances, in a unified manner.
The following uses the existing template terraform-alicloud-classic-load-balance as an example. All resources, such as VPCs, VSwitches, ECS instances, ApsaraDB for RDS instances, security groups, SLB instances, and OSS buckets, required in a classic SLB architecture are defined in the template file main.tf. To quickly build the system architecture and release resources with one click, you can run the following commands in sequence:
# Download the template and go to the template directory. $ git clone https://github.com/terraform-alicloud-modules/terraform-alicloud-classic-load-balance.git && cd terraform-alicloud-classic-load-balance # Initialize Terraform. $ terraform init # Preview the resources to be created. $ terraform plan # Create all resources. $ terraform apply # Release all resources with one click. $ terraform destroy
Currently, Alibaba Cloud Terraform Provider supports 22 Alibaba Cloud services and over 100 resources and data sources, and provides various examples and modules. It continuously enhances developers' experience and efficiency and allows developers to release more productive forces.
Packer is an open source tool used to automatically create cloud images. Packer frees you from focusing on the detailed cloud image creation process. You do not need to log on to a console or machine and manually create a cloud image. Instead, you only need to determine which software to install, which services to customize, and which applications to download. Then, Alibaba Cloud Packer Builder helps you create your own cloud image with one click.
The following uses the existing Jenkins example to describe how to create a Jenkins image with one click by using Alibaba Cloud Packer Builder:
# Download the Jenkins example. $ git clone https://github.com/alibaba/packer-provider.git # Create a Jenkins image with one click. $ packer build examples/alicloud/jenkins/alicloud.json
Currently, Alibaba Cloud Packer Builder supports image creation for 14 operating system distributions, including commonly used Ubuntu, CentOS, and Windows.
BOSH is a project used to release and deploy small or large cloud software, and manage the software throughout its lifecycle. By providing a cloud provider interface (CPI) for BOSH, Alibaba Cloud supports integration with the first open source PaaS platform Cloud Foundry, enabling more enterprises and developers to use Alibaba Cloud.
The detailed technical solution of how Alibaba Cloud supports Cloud Foundry is available for your reference.
Ansible is a powerful engine that automates processes, such as machine logon, application package upload or download, and application deployment and management. Based on the powerful automated management capabilities of Ansible, Alibaba Cloud provides multiple cloud resource management modules, such as ali_instance, ali_vpc, and ali_slb_lb. With these modules, you can incorporate the cloud resource management process into the application deployment management process, thus creating resources and deploying applications with one click. This further improves the automation capability and O&M efficiency.
The following uses the existing alicloud_ecs_vpc example to describe how to automatically create and delete resources, such as ECS instances, VPCs, VSwitches, security groups, and ECS disks.
# Download the alicloud_ecs_vpc example and go to its directory. $ git clone https://github.com/alibaba/ansible-provider.git && cd ansible-provider/examples/alicloud-ecs-vpc # Create cloud resources with one click. $ ansible-playbook alicloud.yml # Delete cloud resources with one click. $ ansible-playbook destroy.yml
Vault is a tool that manages keys and sensitive data. It manages and stores AccessTokens, AccessKeys, passwords, security certificates, keys, and other sensitive data in a unified manner. When you access Vault, Alibaba Cloud provides a secrets engine and an authentication method, so that you do not need to set complex environment variables and static key files or worry about losing your keys or AccessKeys. You can store all your sensitive data in Vault and run Vault commands to obtain the data as required in real time.
You are welcome to explore our developer tools and resources on our newly launched Developer Center. You can build your first application with our APIs and SDKs, dive into our technical guides and how-to tutorials, or share your projects and ideas with the community worldwide on the Developer Center.
Alibaba Developer - July 13, 2021
Alibaba Clouder - May 24, 2019
Alibaba Clouder - April 20, 2018
Alibaba Cloud New Products - June 11, 2020
Alibaba Developer - March 3, 2020
Alibaba Clouder - October 14, 2020
Alibaba Cloud Function Compute is a fully-managed event-driven compute service. It allows you to focus on writing and uploading code without the need to manage infrastructure such as servers.Learn More
API Gateway provides you with high-performance and high-availability API hosting services to deploy and release your APIs on Alibaba Cloud products.Learn More
An online computing service that offers elastic and secure virtual cloud servers to cater all your cloud hosting needs.Learn More
More Posts by Alibaba Clouder