Skip to Main Content

Install Env Via Terraform Module

Refer to Overview▸, using AutoMQ Cloud requires an environment setup. This article introduces 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.

Prerequisites: 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.

  1. Install the Terraform CLI tool in your local environment; confirm the version output after installation.
  1. 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'

  1. 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.

  1. 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
...

  1. Execute terraform apply to review the planned cloud resources to be created. Type yes to proceed with the actual creation process.
  1. 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.
  1. 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 in 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 allows 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, and you can enter the environment console to create instances and experience product features. Experience AutoMQ for Kafka▸

Appendix