You need to enable JavaScript to run this app.
文档中心
云数据库 veDB MySQL 版

云数据库 veDB MySQL 版

复制全文
下载 pdf
Terraform
配置 Terraform
复制全文
下载 pdf
配置 Terraform
本文介绍配置 Terraform 的操作步骤。​
前提条件​
使用 Terraform 管理云数据库 veDB MySQL 版的云资源前,您需要先获取 AK/SK。更多关于如何获取 AK/SK 的信息,请参见访问密钥。​
操作步骤​
  1. 在任意目录下创建一个文本文件,命名为 main.tf。​
  1. 编辑 main.tf 文件,添加以下内容,设置 Provider 信息。​
  • ​
    terraform {​
    required_providers {​
    volcengine = {source = "volcengine/volcengine"​
    version = "0.0.155"​
    }​
    }​
    }​
    provider "volcengine" {​
    access_key = "Your Access Key"​
    secret_key = "Your Secret Key"​
    region = "cn-beijing"​
    }​
    ​
  • Provider 中各字段的说明如下:​
  1. version: 必填,最新版本信息。在 Terraform 查看。​
  1. access_key:必填,密钥 ID,即 AK。​
  1. secret_key:必填,访问密钥,即 SK。​
  1. region:必填,地域。即需要创建管理的资源所属的地域。您可以在这里查询云数据库 veDB MySQL 版支持的地域。​
  1. session_token:选填,角色扮演的安全令牌,如果使用角色扮演,授权后可以通过这里获取。​
  1. 进入 main.tf 所在目录,在终端执行 terraform init 进行 terraform 的初始化。有如下响应表示配置成功。​
  • ​
    $ terraform init​
    ​
    Initializing the backend...​
    ​
    Initializing provider plugins...​
    - Reusing previous version of volcengine/volcengine from the dependency lock file​
    - Using previously-installed volcengine/volcengine v0.0.67​
    ​
    Terraform has been successfully initialized!​
    ​
    You may now begin working with Terraform. Try running "terraform plan" to see​
    any changes that are required for your infrastructure. All Terraform commands​
    should now work.​
    ​
    If you ever set or change modules or backend configuration for Terraform,​
    rerun this command to reinitialize your working directory. If you forget, other​
    commands will detect it and remind you to do so if necessary.​
    ​
​
最近更新时间:2025.08.05 16:18:54
这个页面对您有帮助吗?
有用
有用
无用
无用