Install Env Via Terraform Module
Refer to Overview▸, using AutoMQ Cloud requires setting up the environment first. This article describes how to install a BYOC environment using Terraform Modules.
In this article, references to AutoMQ Product Service Provider, AutoMQ Service Provider, and AutoMQ specifically refer to AutoMQ HK Limited and its subsidiaries.
Prerequisites
Prerequisite 1: Cloud Account Permissions
To create a BYOC environment, you need to provide credentials for a cloud account with appropriate permissions, ensuring the cloud account is either the main account or an IAM sub-account authorized for the relevant operations. If you are using the credentials of an IAM sub-account, authorization must be granted before enabling the service.
Prerequisite 2: Prepare 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 Modules, the following two methods are supported:
Automatically create a new VPC installation environment: Selecting this option will have Terraform Modules automatically create the VPC and other resources, eliminating the need for manual configuration by the user. This option is recommended for initial POCs and testing.
Provided by User VPC Installation Environment: Terraform modules do not actively create VPC networks; you must specify an existing VPC network.
If you choose the Provided by User VPC Installation Environment option, it is recommended to create a VPC with at least 3 availability zones; otherwise, subsequent creation of a three availability zone instance will not be possible.
Operational Process
Step 1: Invoke AutoMQ Terraform Module Installation 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 a 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.
- In this folder, run the command terraform init 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 review the planned cloud resources to be created. Type yes 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
BYOC environments are deployed within the user's VPC, ensuring data security and privacy isolation. However, system logs, metrics, and other non-business-related system data will be generated within the BYOC environment. After the environment installation is complete, users need to refer to Manage Environment Ops Authing▸ to provide the necessary operational authorization to the AutoMQ service provider. This facilitates system stability monitoring and self-healing operations by the AutoMQ service provider.
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, and you can enter the environment console to create instances and experience product features. Experience AutoMQ for Kafka▸
Appendix
- For a list and description of the installed cloud resources, see Cloud Resource List▸