Skip to content
Terraform module for creating a Kubernetes cluster on Alibaba Cloud ("aliyun") with latest available version, all RAM roles with their policies and kubeconfig file.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Terraform Managed Kubernetes on Alibaba Cloud ("aliyun")

This repository contains the Terraform module for creating a simple but ready-to-use managed Kubernetes Cluster on Alibaba Cloud Container Service for Kubernetes (ACK).

It uses the latest available Kubernetes version available in the Alibaba Cloud region, creates all necessary RAM roles with its policies and generates a kubeconfig file at completion.

Link to my comprehensive blog post (beginner friendly):

Alibaba Cloud Logo


You need an Alibaba Cloud account.


  • Always uses latest Kubernetes version available at Alibaba Cloud region
  • Creates all necessary RAM roles and policies
  • kubeconfig file generation



See tables at the end for a comprehensive list of inputs and outputs.

  • Default region: eu-central-1 (Frankfurt, Germany)
  • Default worker node type: ecs.sn1.medium (2x vCPU, 4.0GB memory) (choose your cpu and memory configuration -> auto selection of the right instance type)
  • Default worker node pool size: 2

Terraform Inputs

Name Description Type Default Required
enable_alibaba Enable / Disable Alibaba Cloud k8s bool true yes
random_cluster_suffix Random 6 byte hex suffix for cluster name string no
ali_region Alibaba Cloud region string eu-central-1 no
ali_access_key Alibaba Cloud access key string yes
ali_secret_key Alibaba Cloud secret key string yes
ssh_public_key_path Path to your existing SSH public key file string ~/.ssh/ no
ali_vpc_name Alibaba Cloud VPC name string k8svpc no
ali_vpc_cidr Alibaba Cloud VPC CIDR block string no
ali_vswitch_cidrs List of CIDR blocks used to create several new VSwitches list(string) no
ack_name Alibaba Managed Kubernetes cluster name string k8s-ali no
ack_node_count Alibaba Managed Kubernetes cluster worker node count list 2 no
ack_node_types Alibaba node instance types for worker nodes list(string) ecs.sn1.medium no
ack_k8s_cni Kubernetes CNI plugin to use for networking string flannel no
ack_k8s_pod_cidr CIDR for Kubernetes pod network string no
ack_k8s_service_cidr CIDR for Kubernetes service network string no


Name Description
alicloud_eip_ip_address Alibaba Cloud EIP IPv4 address (used for NAT gateway)
kubeconfig_path_oci kubeconfig file path
You can’t perform that action at this time.