So let’s get a basic instance stood up on Alibaba Cloud. It’s surprisingly easy and parallels how its done on AWS.
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.
Setup a Virtual Network
This is exactly the same as VPC in AWS.
Setup a Subnet (Virtual Switch)
This is exactly the same as a subnet in AWS. Complete with specifying the availability zone.
Setup a Security Group
This is again exactly the same as in AWS.
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.
Create an instance
The instance needs the bare miniumum values:
- AMI (image): the image_id
- Instance Type: the sku that we looked up using 2 cores and 4gb ram stored as a variable called “2c4g”
- Security group: used to place the instance inside
- Subnet (Virtual Switch): used to place the instance inside
Using terraform we can apply the plan and we are off to the races (assuming we’ve provided the access key to authenticate appropriately).
Now we log into the console and we can see our new instance!