The Volcengine Cloud Control Provider enables interaction with various Volcengine-supported resources through the Cloud Control API. Prior to usage, you must configure the provider with appropriate credentials.
Use the left navigation panel to explore available resource documentation. If you cannot find the desired resource, please submit an issue report for assistance.
NOTE:
- The Volcengine Cloud Control provider requires the use of Terraform 1.0.7 or later.
- This guide requires an available Volcengine account or sub-account to create resources.
Terraform 1.0.7 and later:
# Configure the Volcenginecc Provider
terraform {
required_providers {
volcenginecc = {
source = "volcengine/volcenginecc"
version = "~> 0.0.1"
}
}
}
# Create VPC
resource "volcenginecc_vpc_vpc" "VPCDemo" {
vpc_name = "vpc-demo"
description = "VpcDemo Example"
cidr_block = "192.168.0.0/24"
support_ipv_4_gateway = true
enable_ipv_6 = false
project_name = "default"
tags = [
{
key = "env"
value = "test"
}
]
}
# Query VPC
data "volcenginecc_vpc_vpc" "VpcVpcDataSource" {
id = volcenginecc_vpc_vpc.VPCDemo.id
}
The Volcenginecc provider offers a flexible means of providing credentials for authentication. The following methods are supported, in this order, and explained below:
Static credentials can be provided by adding an public_key and private_key in-line in the volcengine provider block:
Warning: Hard-coded credentials are not recommended in any Terraform configuration and risks secret leakage should this file ever be committed to a public version control system.
Usage:
provider "volcenginecc" {
access_key = "your ak"
secret_key = "your sk"
region = "cn-beijing"
}
You can provide your credentials via VOLCENGINE_ACCESS_KEY and VOLCENGINE_SECRET_KEY environment variables, representing your volcengine public key and private key respectively. VOLCENGINE_REGION is also used, if applicable:
provider "volcenginecc" {
}
Usage:
$ export VOLCENGINE_ACCESS_KEY="your_public_key"
$ export VOLCENGINE_SECRET_KEY="your_private_key"
$ export VOLCENGINE_REGION="cn-beijing"
access_key
(String) The Access Key for Volcengine Provider. It must be provided, but it can also be sourced from theVOLCENGINE_ACCESS_KEY
environment variablesecret_key
(String) he Secret Key for Volcengine Provider. It must be provided, but it can also be sourced from theVOLCENGINE_SECRET_KEY
environment variableassume_role
(Attributes) Anassume_role
block (documented below). Only oneassume_role
block may be in the configuration. (see below for nested schema)customer_headers
(String) CUSTOMER HEADERS for Volcengine Provider. The customer_headers field uses commas (,) to separate multiple headers, and colons (:) to separate each header key from its corresponding value.disable_ssl
(Boolean) Disable SSL for Volcengine Providerendpoints
(Attributes) Anendpoints
block (documented below). Only oneendpoints
block may be in the configuration. (see below for nested schema)proxy_url
(String) PROXY URL for Volcengine Providerregion
(String) The Region for Volcengine Provider. It must be provided, but it can also be sourced from theVOLCENGINE_REGION
environment variable
Required:
assume_role_session_name
(String) The session name to use when making the AssumeRole call.assume_role_trn
(String) he TRN of the role to assume.duration_seconds
(Number) The duration of the session when making the AssumeRole call. Its value ranges from 900 to 43200(seconds), and default is 3600 seconds.
Optional:
policy
(String) A more restrictive policy when making the AssumeRole call
Optional:
cloudcontrolapi
(String) Use this to override the default Cloud Control API service endpoint URLsts
(String) Use this to override the default STS service endpoint URL