Install Env Via Terraform Module
Refer to Overview▸, using AutoMQ Cloud requires the initial setup of the environment. This article outlines how to install the BYOC environment using the Terraform Module.
In this article, references to AutoMQ Product Service Provider, AutoMQ Service Provider, and AutoMQ specifically refer to AutoMQ HK Limited and its subsidiaries.
Operational Process
Step 1: Prepare the VPC
The AutoMQ BYOC environment is deployed within the user’s VPC to ensure data privacy and security. When installing the AutoMQ environment using Terraform, the following methods are supported:
Automatically create a new VPC installation environment: Selecting this option will have the installer automatically create the VPC and other resources without the need for manual configuration by the user. This is recommended for initial POCs and testing.
User-provided VPC installation environment: The installer will not proactively create a VPC network. The user specifies the existing VPC network and subnet information.
If you choose User-provided VPC installation environment, the VPC must meet the following conditions:
Zone requirements: Depending on business needs, if a three-zone instance needs to be created subsequently, at least three zones and subnets need to be allocated.
Subnet CIDR requirements: The AutoMQ data plane cluster uses the user VPC for deployment, which will consume the VPC subnet IPs. It is recommended to allocate sufficient available IPs in each subnet (at least 1,000 available IPs per subnet) to avoid future deployment and expansion issues.
Public Network Access Requirements: Deploying the AutoMQ data plane cluster requires pulling Docker images and Helm Chart artifacts from the public network. Therefore, the VPC environment must support egress to the public network through methods like SNAT. For instructions on configuring public SNAT, refer to the Appendix of this document Install Env via Huawei Marketplace▸.
Step 2: Invoke the AutoMQ Terraform Module to Install the Environment
Before using the Terraform Module to install the BYOC environment, it is recommended to select (or upgrade to) the latest module version according to the documentation and then integrate the AutoMQ Terraform Module for environment installation and deployment.
- Install the Terraform CLI tool in your local environment; confirm the version output after installation.
- Configure a Huawei Cloud account. You can use a sub-account and grant permissions. Configure AK, SK for installation execution.
export HW_ACCESS_KEY='set the cloud account's ak'
export HW_SECRET_KEY='Set the cloud account sk'
- Create an automq_byoc_env folder and within it, create a
main.tf
file. A simple example code to install the BYOC environment is as follows:
module "automq_byoc" {
source = "AutoMQ/automq-byoc-environment/huaweicloud"
# Set the Identifier for the Environment to Be Installed. This ID Will Be Used for Naming Internal Resources. the Environment ID Supports Only Uppercase and Lowercase English Letters, Numbers, and Hyphens (-). It Must Start with a Letter and Is Limited to a Length of 32 Characters.
automq_byoc_env_id = "xxxxxxxxxx"
# Set the Target RegionId of Huaweicloud
cloud_provider_region = "cn-east-3"
create_new_vpc = true
}
# Necessary Outputs
output "automq_byoc_env_id" {
value = module.automq_byoc.automq_byoc_env_id
}
output "automq_byoc_endpoint" {
value = module.automq_byoc.automq_byoc_endpoint
}
output "automq_byoc_initial_username" {
value = module.automq_byoc.automq_byoc_initial_username
}
output "automq_byoc_initial_password" {
value = module.automq_byoc.automq_byoc_initial_password
}
output "automq_byoc_vpc_id" {
value = module.automq_byoc.automq_byoc_vpc_id
}
output "automq_byoc_instance_id" {
value = module.automq_byoc.automq_byoc_instance_id
}
For the complete documentation, visit AutoMQ Terraform Modules Repository, and refer to the corresponding README document to execute the creation operations.
- Execute the
terraform init
command within that folder to complete the initialization.
❯ terraform init
Initializing the backend...
Initializing modules...
Downloading registry.terraform.io/AutoMQ/automq-byoc-environment/huaweicloud 0.1.1 for automq_byoc...
- automq_byoc in .terraform/modules/automq_byoc
Initializing provider plugins...
- Reusing previous version of huaweicloud/huaweicloud from the dependency lock file
- Using previously-installed huaweicloud/huaweicloud v1.68.1
...
- Execute
terraform apply
to view the planned cloud resources to be created. Enteryes
to proceed with the actual creation process.
- Wait for approximately 1-2 minutes. Terraform will create the environment cloud resources and provide the environment access point along with the initial account credentials.
- Access the environment console, log in using the initial account credentials provided by terraform, and change the password to a custom one.
Step 2: Complete the BYOC Environment Operations Authorization
The BYOC environment is deployed within the user’s VPC, providing data security and privacy isolation. However, the BYOC environment will generate system logs, metrics, and other non-business system data. After the environment is installed, users need to refer to Manage Environment Ops Authing▸ to provide the necessary operational authorization to the AutoMQ service provider. This enables the AutoMQ service provider to perform system stability monitoring and fault self-healing operations.
Next Steps
After the environment installation is complete, it can be accessed for use. AutoMQ supports the following two methods:
Using AutoMQ via Terraform: After the environment installation is complete, users can manage and use AutoMQ through the AutoMQ Terraform Provider. For detailed guidance on using AutoMQ via Terraform, please refer to the documentation.
Using AutoMQ via WebUI: Access the returned console address through a browser, enter the initial username and password to enter the environment console, create instances, and experience product features. Experience AutoMQ for Kafka▸
Note:
If you choose the k8s mode during the installation environment setup, you need to configure the CCE cluster first before creating the AutoMQ instance (cluster). For configuring the CCE cluster, please refer to Deploy to HuaWei Cloud CCE▸。