{"id":13796330,"url":"https://github.com/ellerbrock/alibaba-cloud-terraform-github-travis","last_synced_at":"2026-05-17T06:34:23.126Z","repository":{"id":71782742,"uuid":"117191503","full_name":"ellerbrock/alibaba-cloud-terraform-github-travis","owner":"ellerbrock","description":":coffee: quickstart for alibaba cloud with terraform github and travis","archived":false,"fork":false,"pushed_at":"2018-01-13T12:18:43.000Z","size":279,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T10:13:37.359Z","etag":null,"topics":["alibaba","alibaba-cloud","alibabacloud","alicloud","alicloud-terraform-provider","docker","infrastructure-as-code","terraform","travis","travis-ci"],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ellerbrock.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-01-12T04:17:31.000Z","updated_at":"2018-08-07T15:36:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"2436ccc1-4d8b-480b-9159-8d89b4ccc258","html_url":"https://github.com/ellerbrock/alibaba-cloud-terraform-github-travis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ellerbrock%2Falibaba-cloud-terraform-github-travis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ellerbrock%2Falibaba-cloud-terraform-github-travis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ellerbrock%2Falibaba-cloud-terraform-github-travis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ellerbrock%2Falibaba-cloud-terraform-github-travis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ellerbrock","download_url":"https://codeload.github.com/ellerbrock/alibaba-cloud-terraform-github-travis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244776353,"owners_count":20508507,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alibaba","alibaba-cloud","alibabacloud","alicloud","alicloud-terraform-provider","docker","infrastructure-as-code","terraform","travis","travis-ci"],"created_at":"2024-08-03T23:01:09.029Z","updated_at":"2025-10-22T21:36:34.647Z","avatar_url":"https://github.com/ellerbrock.png","language":"HCL","funding_links":[],"categories":["Infrastructure as Code"],"sub_categories":[],"readme":"![alibaba cloud terraform github travis](https://upload.wikimedia.org/wikipedia/commons/4/40/Alibaba-cloud-logo-grey-2-01.png)\n\n# Alibaba Cloud Infrastructure as Code Quickstart [![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg)](https://github.com/ellerbrock/open-source-badges/) [![Gitter Chat](https://badges.gitter.im/frapsoft/frapsoft.svg)](https://gitter.im/frapsoft/frapsoft/) [![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://opensource.org/licenses/mit-license.php)\n\n\n## What you need\n\n- [Github Account](https://github.com/join)\n- [Travis Account](https://travis-ci.org/) for Continuous Integration and Delivery\n- [Terraform](https://www.terraform.io/) installed for local testing\n\n## Remote Storage\n\nA first draft from a working but not yet production ready version you can find here: \u003chttps://github.com/ellerbrock/terraform-consul-backend\u003e\n\nIn this setup we could make a initial bootstraping of the account, setup a Consul Cluster and then import the Remote State to there, even with locking support.\n\n\n## Configuration\n\n### 1.) Activate Travis for the Repository\n\n![](./img/travis-activate-repo.jpg)\n\n### 2.) Go to Travis Repository Settings\n\n![](./img/travis-settings.jpg)\n\nUnder General i have my Settings that:\n\n- ON: Building only if .travis.yml is present\n- ON: Build branch updates\n- ON: Limit concurrent jobs? 1\n- OFF: Build pull request updates\n\n### 3.) Add your Credentials to Environment Variables\n\n![](./img/travis-env-vars.jpg)\n\nThe Terraform Alicloud Provider Plugin expect the Environment Variables named like these:\n\n- `ALICLOUD_ACCESS_KEY=\"your-key-here\"`\n- `ALICLOUD_SECRET_KEY=\"your-secret-here\"`\n- `ALICLOUD_REGION=\"your-region\"`\n\nEnsure to disable the  `Display value in build log` \n\nYou can read in more detail about this [here](https://www.terraform.io/docs/providers/alicloud/index.html#argument-reference).\n\n### 4.) Add `.travis.yml` to your Repo\n\nFor a clean and isolated work i choose the [Docker service](https://docs.travis-ci.com/user/docker/) for Travis CI.\nWe run `terraform` with the official lightweight Alpine Linux Image [hashicorp/terraform:light](https://hub.docker.com/r/hashicorp/terraform/) for the provisioning.\n\nEnsure to have all your commands which needs access to the encrypted environment variables from travis in the `before_script`, for whatever weird reason after you can't access them anymore e.g. via `script`. I hope this get's updated in the future.\n\n\n```yml\nsudo: required\n\nlanguage: bash\n\ndist: trusty\n\ngroup: deprecated-2017Q4\n\nservices:\n  - docker\n\ncache:\n  directories:\n    - \".terraform\"\n\nenv:\n  - TRAVIS_SECURE_ENV_VARS=true\n\nbefore_script:\n  - docker pull hashicorp/terraform:light\n  - docker run -e \"ALICLOUD_ACCESS_KEY=${ALICLOUD_ACCESS_KEY}\" -e \"ALICLOUD_SECRET_KEY=${ALICLOUD_SECRET_KEY}\" -e \"ALICLOUD_REGION=${ALICLOUD_REGION}\" -v $(pwd):/x/ -w /x/ hashicorp/terraform:light init\n  - docker run -e \"ALICLOUD_ACCESS_KEY=${ALICLOUD_ACCESS_KEY}\" -e \"ALICLOUD_SECRET_KEY=${ALICLOUD_SECRET_KEY}\" -e \"ALICLOUD_REGION=${ALICLOUD_REGION}\" -v $(pwd):/x/ -w /x/ hashicorp/terraform:light validate\n  - docker run -e \"ALICLOUD_ACCESS_KEY=${ALICLOUD_ACCESS_KEY}\" -e \"ALICLOUD_SECRET_KEY=${ALICLOUD_SECRET_KEY}\" -e \"ALICLOUD_REGION=${ALICLOUD_REGION}\" -v $(pwd):/x/ -w /x/ hashicorp/terraform:light plan\n  - docker run -e \"ALICLOUD_ACCESS_KEY=${ALICLOUD_ACCESS_KEY}\" -e \"ALICLOUD_SECRET_KEY=${ALICLOUD_SECRET_KEY}\" -e \"ALICLOUD_REGION=${ALICLOUD_REGION}\" -v $(pwd):/x/ -w /x/ hashicorp/terraform:light apply -auto-approve\n\nnotifications:\n  email:\n    on_success: never\n    on_failure: always\n```\n\n### 5.) Add your Terraform Code\n\nIn this example i create for the test a VPC.\n\n`main.tf`\n\n```\n# Terraform Provider Alicloud expects these Variables:\n#\n# ALICLOUD_ACCESS_KEY\n# ALICLOUD_SECRET_KEY\n# ALICLOUD_REGION\n#\n# Store them as environment variables in Travis for the Repository.\n\nprovider \"alicloud\" {\n  access_key = \"${var.access_key}\"\n  secret_key = \"${var.secret_key}\"\n  region     = \"${var.region}\"\n}\n\nresource \"alicloud_vpc\" \"vpc\" {\n  name       = \"${var.vpc_name}\"\n  cidr_block = \"${var.vpc_cidr_block}\"\n}\n```\n`variables.tf`\n\n```\n~/d/c/a/alibaba-cloud-terraform-github-travis ❯❯❯ cat variables.tf.old\nvariable \"access_key\" {\n  description = \"aws access key\"\n  default     = \"\"\n}\n\nvariable \"secret_key\" {\n  description = \"aws secret key\"\n  default     = \"\"\n}\n\nvariable \"region\" {\n  description = \"default region\"\n  default     = \"eu-central-1\"\n}\n\nvariable \"vpc_name\" {\n  description = \"vpc name\"\n  default     = \"default\"\n}\n\nvariable \"vpc_cidr_block\" {\n  description = \"default vpc cidr\"\n  default     = \"192.168.0.0/16\"\n}\n```\n\n## Links\n\n- [Terraform Alicloud Provider Docs](https://www.terraform.io/docs/providers/alicloud/index.html)\n- [Terraform Registry for Alicloud](https://registry.terraform.io/browse?provider=alicloud)\n\n#### Alicloud Terraform Examples\n \n- \u003chttps://github.com/terraform-providers/terraform-provider-alicloud/\u003e\n- \u003chttps://github.com/alibaba/terraform-provider/tree/master/terraform/examples\u003e\n\n\n## Support\n\nYou can get direct support for my Open Source projects on Alibaba Cloud here\n\n[![gitter](https://github.frapsoft.com/top/gitter-alibabacloudnews.jpg)](https://gitter.im/alibabacloudnews/Lobby)\n\n\n## Try Alibaba Cloud\n\n[Sign up](http://ow.ly/YKQe30hHgp8) today and get $300 valid for the first 60 days to try Alibaba Cloud.\n\n\n## Contact\n\n[![Github](https://github.frapsoft.com/social/github.png)](https://github.com/ellerbrock/)[![Docker](https://github.frapsoft.com/social/docker.png)](https://hub.docker.com/u/ellerbrock/)[![npm](https://github.frapsoft.com/social/npm.png)](https://www.npmjs.com/~ellerbrock)[![Twitter](https://github.frapsoft.com/social/twitter.png)](https://twitter.com/frapsoft/)[![Facebook](https://github.frapsoft.com/social/facebook.png)](https://www.facebook.com/frapsoft/)[![Google+](https://github.frapsoft.com/social/google-plus.png)](https://plus.google.com/116540931335841862774)[![Gitter](https://github.frapsoft.com/social/gitter.png)](https://gitter.im/frapsoft/frapsoft/)\n\n## License \n\n[![MIT license](https://badges.frapsoft.com/os/mit/mit-125x28.png?v=103)](https://opensource.org/licenses/mit-license.php)\n\nThis work by \u003ca xmlns:cc=\"http://creativecommons.org/ns#\" href=\"https://github.com/ellerbrock\" property=\"cc:attributionName\" rel=\"cc:attributionURL\"\u003eMaik Ellerbrock\u003c/a\u003e is licensed under a \u003ca rel=\"license\" href=\"https://creativecommons.org/licenses/by/4.0/\"\u003eCreative Commons Attribution 4.0 International License\u003c/a\u003e and the underlying source code is licensed under the \u003ca rel=\"license\" href=\"https://opensource.org/licenses/mit-license.php\"\u003eMIT license\u003c/a\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fellerbrock%2Falibaba-cloud-terraform-github-travis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fellerbrock%2Falibaba-cloud-terraform-github-travis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fellerbrock%2Falibaba-cloud-terraform-github-travis/lists"}