Terraform

To provision cloud resources, you can use terraform along with related cloud provider addons.

  1. vela addon enable terraform

After Terraform addon is enabled, you will have a basic capability to create cloud resources in CRD ways. Then you can enable a terraform provider addon for specific clouds.

KubeVela can support the following cloud providers by enabling the Terraform provider addons.

  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)

To enable one of them, use the following command:

  1. vela addon enable terraform-<provider-name>

You can also disable, upgrade, and check the status of an addon by command vela addon.

View the supported Terraform providers.

  1. vela config-template list | grep terraform

For example to create a provider config for AWS.

  1. vela config create aws -t terraform-aws AWS_ACCESS_KEY_ID=xxx AWS_SECRET_ACCESS_KEY=yyy AWS_DEFAULT_REGION=us-east-1

After a Terraform provider is authenticated, you can provision and/or consume cloud resources.

Last updated on Aug 4, 2023 by Daniel Higuero