/terraform-provider

Terraform for Alibaba Cloud, Support ECS, Block Storage, SLB, VPC, Nat Gateway, RDS, ESS, OSS etc.

Primary LanguageGoApache License 2.0Apache-2.0

Alicloud (Alibaba Cloud) terraform provider

This is the official repository for the Alicloud terraform provider. Currently it supports terraform version ≥ v0.8.2.

If you are not planning to contribute to this repo, you can download the compiled binaries from https://github.com/alibaba/terraform-provider/releases and move the banaries (bin/terraform-provider-alicloud) into the folder under the Terraform PATH such as /usr/local/terraform.

Alternatively, the provider can be installed as described in the developer notes.
This way you will be able to sync the repo as active development is going on.

Example

Example modules can be found in the terraform/examples directory.

Developer notes

Setting up

cd $GOPATH
mkdir -p src/github.com/alibaba
cd $GOPATH/src/github.com/alibaba
git clone https://github.com/alibaba/terraform-provider.git

# switch to project
cd $GOPATH/src/github.com/alibaba/terraform-provider

# get all dependencies and install modules
go get ./...
glide up
sudo -E "PATH=$PATH" make all
terraform get

# set the creds
export ALICLOUD_ACCESS_KEY="***"
export ALICLOUD_SECRET_KEY="***"
export ALICLOUD_REGION="***"

# you're good to start rocking
# alicloud.tf contains the default example
terraform plan
# terraform apply
# terraform destroy

Regions

cn-qingdao
cn-beijing
cn-zhangjiakou
cn-huhehaote
cn-hangzhou
cn-shanghai
cn-shenzhen
cn-hongkong

ap-northeast-1
ap-southeast-1
ap-southeast-2
ap-southeast-3
ap-southeast-5
ap-south-1

us-east-1
us-west-1

me-east-1

eu-central-1

For more about the regions and availability zones, use data source alicloud_regions and alicloud_zones.

Support products

Documents

The latest supported product document as follows:

Common problems

Error configuring: 1 error(s) occurred:
* Incompatible API version with plugin. Plugin version: 2, Ours: 1

# fix by manually setting the branch in the sources
cd src/github.com/hashicorp/terraform/
git checkout v<YOUR_TF_VERSION_HERE>
cd -

# rebuild
sudo -E "PATH=$PATH" make all

How to contribute code

  • If you are not sure or have any doubts, feel free to ask and/or submit an issue or PR. We appreciate all contributions and don't want to create artificial obstacles that get in the way.
  • Contributions are welcome and will be merged via PRs.

Contributors

License

  • This project is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

Refrence