HuaweiCloud Terraform Provider

repository·master·Indexed 42 days ago

https://github.com/huaweicloud/terraform-provider-huaweicloud

The Terraform HuaweiCloud Provider enables Infrastructure as Code (IaC) workflows to manage HuaweiCloud resources using Terraform configuration files. It supports Terraform 0.12.x and provides data sources for services such as API Gateway (APIG), Auto Scaling (AS), Application Service Mesh (ASM), and Bare Metal Server (BMS).

Tokens
393.7K
Snippets
886
Records
1.6K
Agent score
54%

What's inside HuaweiCloud Terraform Provider

  1. Manage Cloud Connect (CC) bandwidth packages

    master

    The huaweicloud_cc_bandwidth_package resource allows you to manage bandwidth package resources within HuaweiCloud's Cloud Connect (CC) service. You can configure both postpaid (pay-per-use) and prepaid (subscription-based) billing models.

    resource "huaweicloud_cc_bandwidth_package" "test" {
      name           = "my-bandwidth-package"
      local_area_id  = "Chinese-Mainland"
      remote_area_id = "Chinese-Mainland"
      charge_mode    = "bandwidth"
      billing_mode   = 3
      bandwidth      = 5
      description    = "This is a demo"
    }
  2. Manage HuaweiCloud CSE Microservices

    master

    The huaweicloud_cse_microservice resource manages a microservice resource under a specified Cloud Service Engine (CSE) microservice engine.

    Prerequisites

    1. EIP Binding: Ensure the engine is bound to an Elastic IP (EIP).
    2. Security Group Rules: The corresponding security group must have the required rules enabled (see Security Group Rules) to allow access to the engine.
    3. Deletion Warning: When deleting a microservice, all associated instances will be deleted automatically.

    Important Note on Configuration

    Ensure all parameter values are correct. If incorrect values are provided, Terraform may assume the resource does not exist and remove it from the local .tfstate file, requiring an import to manage it again.

  3. Manage TaurusDB HTAP StarRocks replication tasks

    master

    The huaweicloud_taurusdb_htap_starrocks_replication resource allows you to manage data replication tasks from a source TaurusDB instance to a TaurusDB HTAP StarRocks instance. You can configure replication at the instance level (all databases) or at a partial level (specific databases and tables).

    resource "huaweicloud_taurusdb_htap_starrocks_replication" "test" {
      instance_id            = var.htap_instance_id
      source_instance_id     = var.taurusdb_instance_id
      task_name              = "task_name"
      # ... other configuration ...
    }
  4. Manage an ELB pool with huaweicloud_elb_pool

    master

    The huaweicloud_elb_pool resource manages an Elastic Load Balance (ELB) pool within HuaweiCloud. Depending on your architecture, you can associate the pool with a Load Balancer, a Listener, or create it within a VPC to be associated later.

    resource "huaweicloud_elb_pool" "pool_1" {
      name            = "test"
      protocol        = "HTTP"
      lb_method       = "ROUND_ROBIN"
      loadbalancer_id = var.loadbalancer_id
    
      slow_start_enabled  = true
      slow_start_duration = 100
    
      protection_status = "consoleProtection"
      protection_reason = "test reason"
    
      persistence {
        type        = "APP_COOKIE"
        cookie_name = "testCookie"
      }
    }
  5. Manage DSC database watermark embed tasks

    master

    The huaweicloud_dsc_database_watermark_embed_task resource manages Data Security Center (DSC) tasks that embed watermarks into databases. It supports three primary embedding modes:

    1. EMBED_FAKE_ROW: A lossless watermark that uses row spacing.
    2. EMBED_FAKE_COLUMN: A lossless watermark that creates new fake columns with generated data.
    3. EMBED_COLUMN: A lossy watermark that embeds information into existing selected fields.

    You must specify the source and target database information, the watermark content, and the error correction level (error_code).

    resource "huaweicloud_dsc_database_watermark_embed_task" "test" {
      task_name         = "my_task"
      water_mark        = "my_watermark_content"
      watermark_version = "V2"
    
      db_water_param {
        embed_mode    = "EMBED_FAKE_COLUMN"
        watermark_key = "my_key"
        # ... other configuration
      }
    
      source_db_info {
        db_id      = "db_id"
        db_name    = "db_name"
        db_type    = "MySQL"
        ins_id     = "ins_id"
        ins_name   = "ins_name"
        table_name = "table_name"
      }
    
      target_db_info {
        db_id      = "db_id"
        db_name    = "db_name"
        db_type    = "MySQL"
        ins_id     = "ins_id"
        ins_name   = "ins_name"
        table_name = "table_name"
      }
    
      error_code    = 1
      schedule_type = "ONCE"
    }
  6. Manage Cloud Service Engine (CSE) microservice instances

    master

    The huaweicloud_cse_microservice_instance resource allows you to manage a microservice instance under a specific microservice engine in HuaweiCloud.

    Prerequisites:

    1. Ensure the microservice engine is bound to an EIP.
    2. Enable the required security group rules (see Security Group Rules) to allow access to the engine.

    Important Note on Configuration: Many arguments in this resource are NonUpdatable. If you change these values in your Terraform configuration, Terraform may assume the resource does not exist and attempt to remove it from the .tfstate file. In such cases, you will need to use the import command to regain management of the resource.

  7. Manage ModelArts models with huaweicloud_modelarts_model

    master

    The huaweicloud_modelarts_model resource allows you to manage ModelArts model resources within the HuaweiCloud AI Development Platform. You can import models from various sources including Object Storage Service (OBS), predefined templates, ModelArts training jobs, or container images from Software Repository for Container (SWR).

    resource "huaweicloud_modelarts_model" "test" {
      name            = "demo"
      version         = "0.0.2"
      description     = "This is a demo"
      source_location = var.source_obs_path
      model_type      = "TensorFlow"
      runtime         = "python3.6"
    }
  8. Manage Workspace application rules with huaweicloud_workspace_application_rule

    master

    The huaweicloud_workspace_application_rule resource allows you to define rules for applications within a HuaweiCloud Workspace. Rules are categorized by a scope, which determines whether the rule is based on product metadata (PRODUCT) or a specific installation file path (PATH).

    Rule Scopes

    1. PRODUCT: Used to identify applications based on their publisher, product name, or process name. Requires a product_rule block.
    2. PATH: Used to identify applications based on their installation directory. Requires a path_rule block.
    resource "huaweicloud_workspace_application_rule" "example" {
      name = "my-rule"
      detail {
        scope = "PRODUCT" # or "PATH"
        # ... rule specific block
      }
    }
  9. Manage LTS structuring custom configurations

    master

    The huaweicloud_lts_structuring_custom_configuration resource allows you to manage Log Tank Service (LTS) structuring custom configurations. These configurations define how log events are parsed and structured into searchable fields.

    To use this resource, you must provide a sample content log event. LTS uses this sample to generate parsing rules. You must choose exactly one of the following parsing methods:

    1. JSON structuring: Use the layers argument to specify the maximum parsing layers (up to 3). This parses the log body as JSON and splits it into key-value pairs.
    2. Split structuring: Use the tokenizer argument to specify a delimiter (e.g., spaces or colons) to split the log body.
    3. Nginx structuring: Use the log_format argument to provide an Nginx configuration string for extracting key-value pairs from Nginx log events.
    4. Custom Regex structuring: Use the regex_rules argument to provide a regular expression for parsing logs.

    Note: regex_rules, layers, tokenizer, and log_format are mutually exclusive.

    resource "huaweicloud_lts_structuring_custom_configuration" "test" {
      log_group_id  = "your_log_group_id"
      log_stream_id = "your_log_stream_id"
      content       = "sample log content"
      # Choose ONE of: layers, tokenizer, log_format, or regex_rules
      tokenizer     = " " 
    
      demo_fields {
        field_name  = "field1"
        content     = "value1"
        type        = "string"
        is_analysis = true
      }
    }
  10. Manage CodeArts deploy hosts with huaweicloud_codearts_deploy_host

    master

    The huaweicloud_codearts_deploy_host resource manages a CodeArts deploy host within HuaweiCloud. Hosts can be configured as proxy hosts (agent hosts) or target hosts. Target hosts can either connect directly or use a proxy host for access.

    Important Prerequisites: Before using this resource, servers must be prepared according to HuaweiCloud documentation regarding Preparations, Security Configuration, Target Host Configuration, and Proxy Host Configuring.

    resource "huaweicloud_codearts_deploy_host" "test" {
      group_id   = "your_group_id"
      ip_address = "your_ip_address"
      port       = 22
      username   = "your_username"
      password   = "your_password"
      os_type    = "linux"
      name       = "my_host"
    }
  11. Manage CSE Microservice Engine Configurations

    master

    The huaweicloud_cse_microservice_engine_configuration resource manages key/value pairs within a dedicated HuaweiCloud Cloud Service Engine (CSE) microservice engine (version 2.0+).

    Prerequisites: Before creating a configuration, ensure the microservice engine has the required security group rules enabled (see the Appendix for details).