Giter Club home page Giter Club logo

alicloud-cs-terraform's Introduction

Github repo: https://github.com/3dw1np/alicloud-cs-terraform

Deploy Container service (K8S cluster) on Alibaba Cloud with Terraform

At Alibaba Cloud, we use Terraform to provide fast demos to our customers. I truly believe that the infrasture-as-code is the quick way to leverage a public cloud provider services. Instead of clicking on the Web Console UI, the logic of the infrasture-as-code allows us to define more accuratly each used services, automate the entire infrastructure and version it with a versionning control (git).

High-level design

Export environment variables

We provide the Alicloud credentials with envrionments variables. In this tutorial, we are going to use the Europe Central Region (eu-central-1).

root@alicloud:~$ export ALICLOUD_ACCESS_KEY="anaccesskey"
root@alicloud:~$ export ALICLOUD_SECRET_KEY="asecretkey"
root@alicloud:~$ export ALICLOUD_REGION="ap-southeast-1"

If you don't have an access key for your Alicloud account yet, just follow this tutorial.

Install Terraform

To install Terraform, download the appropriate package for your OS. The download contains an executable file that you can add in your global PATH.

Verify your PATH configuration by typing the terraform

root@alicloud:~$ terraform
Usage: terraform [--version] [--help] <command> [args]

Setup Alicloud terraform provider (> v1.9.1)

The official repository for Alicloud terraform provider is https://github.com/alibaba/terraform-provider

# Configure the Alicloud Provider
provider "alicloud" {}
  • Initialize the working directory but Terraform will not download the alicloud provider plugin from internet, because we provide a newest version locally.
terraform init

Deployment steps

Base vpc

terraform init solutions/base_vpc
terraform plan|apply \
  -var-file=parameters/base_vpc.tfvars \
  -state=states/base_vpc.tfstate \
  solutions/base_vpc

Container service (K8S cluster)

terraform init solutions/cs_k8s
terraform plan|apply \
  -var-file=parameters/base_vpc.tfvars \
  -state=states/base_vpc.tfstate \
  solutions/base_vpc

alicloud-cs-terraform's People

Contributors

3dw1np avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.