版本:v1.3

云资源插件

  1. vela addon enable terraform

KubeVela 支持以下 Terraform provider 插件。

  1. $ vela addon list | grep terraform-
  2. terraform-alibaba KubeVela Kubernetes Terraform Controller for Alibaba Cloud [1.0.2, 1.0.1] enabled (1.0.2)
  3. terraform-tencent KubeVela Kubernetes Terraform Controller Provider for Tencent Cloud [1.0.0, 1.0.1] enabled (1.0.0)
  4. terraform-aws KubeVela Kubernetes Terraform Controller for AWS [1.0.0, 1.0.1] enabled (1.0.0)
  5. terraform-azure KubeVela Kubernetes Terraform Controller for Azure [1.0.0, 1.0.1] enabled (1.0.0)
  6. terraform-baidu KubeVela Kubernetes Terraform Controller Provider for Baidu Cloud [1.0.0, 1.0.1] enabled (1.0.0)
  7. terraform-gcp KubeVela Kubernetes Terraform Controller Provider for Google Cloud Platform [1.0.0, 1.0.1] enabled (1.0.0)
  8. terraform-ucloud KubeVela Kubernetes Terraform Controller Provider for UCloud [1.0.1, 1.0.0] enabled (1.0.1)

要启用其中之一,请使用以下命令:

  1. $ vela addon enable terraform-xxx

您还可以通过命令 vela addon 卸载、升级、检查插件的状态。

每个 Terraform provider 都可以通过以下命令进行云资源的授权。

  1. $ vela provider add -h
  2. Authenticate Terraform Cloud Provider by creating a credential secret and a Terraform Controller Provider
  3. Usage:
  4. vela provider add [flags]
  5. vela provider add [command]
  6. Examples:
  7. vela provider add <provider-type>
  8. Available Commands:
  9. terraform-alibaba Authenticate Terraform Cloud Provider terraform-alibaba
  10. terraform-aws Authenticate Terraform Cloud Provider terraform-aws
  11. terraform-azure Authenticate Terraform Cloud Provider terraform-azure
  12. terraform-baidu Authenticate Terraform Cloud Provider terraform-baidu
  13. terraform-gcp Authenticate Terraform Cloud Provider terraform-gcp
  14. terraform-tencent Authenticate Terraform Cloud Provider terraform-tencent
  15. terraform-ucloud Authenticate Terraform Cloud Provider terraform-ucloud

例如,我们授权 Terraform provider terraform-aws

这是授权 terraform-aws 的帮助信息。

  1. $ vela provider add terraform-aws -h
  2. Authenticate Terraform Cloud Provider terraform-aws by creating a credential secret and a Terraform Controller Provider
  3. Usage:
  4. vela provider add terraform-aws [flags]
  5. Examples:
  6. vela provider add terraform-aws
  7. Flags:
  8. --AWS_ACCESS_KEY_ID string Get AWS_ACCESS_KEY_ID per https://aws.amazon.com/blogs/security/wheres-my-secret-access-key/
  9. --AWS_DEFAULT_REGION string Choose one of Code form region list https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-available-regions
  10. --AWS_SECRET_ACCESS_KEY string Get AWS_SECRET_ACCESS_KEY per https://aws.amazon.com/blogs/security/wheres-my-secret-access-key/
  11. --AWS_SESSION_TOKEN string Get AWS_SESSION_TOKEN per https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html
  12. -h, --help help for terraform-aws
  13. --name default The name of Terraform Provider for AWS, default is default (default "aws")
  14. Global Flags:
  15. -y, --yes Assume yes for all user prompts
  1. $ vela provider add terraform-aws --AWS_ACCESS_KEY_ID=xxx --AWS_SECRET_ACCESS_KEY=yyy --AWS_DEFAULT_REGION=us-east-1

如果不通过 --name 设置提供程序名称,将创建一个名为 aws 的 AWS Terraform provider。

您还可以通过指定 --name 标志来创建多个 provider。

  1. $ vela provider add terraform-aws --name aws-dev --AWS_ACCESS_KEY_ID=xxx --AWS_SECRET_ACCESS_KEY=yyy --AWS_DEFAULT_REGION=us-east-1

在 Terraform provider 授权后,您可以创建和消费云资源

Last updated on 2022年11月1日 by Tianxin Dong