So let’s get a basic instance stood up on Alibaba Cloud. It’s surprisingly easy and parallels how its done on AWS.

I’ve published my source code on GitHub so you can get started quickly just by pulling the code. You may want to check out my other post on getting started with Alibaba Cloud.

Provider

The provider specifies the configuration you’ll need to talk to Alibaba Cloud. Just like AWS this is using an Access Key but instead of IAM Access Key we’re using a RAM (Resource Access Management) Access Key.

Alt

Setup a Virtual Network

This is exactly the same as VPC in AWS.

Alt

Setup a Subnet (Virtual Switch)

This is exactly the same as a subnet in AWS. Complete with specifying the availability zone.

Alt

Setup a Security Group

This is again exactly the same as in AWS.

Alt

Reference an Instance Type

This is a little different in that we do not have SKUs in the same way we do in AWS. We specify Core and memory size. It’s a bit strange coming from AWS / Azure but its probably more familiar for those coming from traditional hypervisors.

Alt

Create an instance

The instance needs the bare miniumum values:

  1. AMI (image): the image_id
  2. Instance Type: the sku that we looked up using 2 cores and 4gb ram stored as a variable called “2c4g”
  3. Security group: used to place the instance inside
  4. Subnet (Virtual Switch): used to place the instance inside

Alt

Apply

Using terraform we can apply the plan and we are off to the races (assuming we’ve provided the access key to authenticate appropriately).

Alt

Now we log into the console and we can see our new instance!

Alt