EC2 Instance Types

Juju stores all the EC2 Instance Types in the following generate.go location.

The instance types capture all the information from Amazon AWS EC2 in a consumable format for juju, so that when deploying to an instance type (think juju deploy mysql --constraints 'instance-type=m2.xlarge'), we can validate and gain information about the various instance types.

Updating

To update the generate.go file you first need to ensure that you’ve setup up juju correctly, so when you run the following it generates the file correctly.

Firstly you should download the following file index.json, which is provided by amazon directly.

Place the file in the following juju folder

provider/ec2/internal/ec2instancetypes

Then run the following command inside that folder

go generate .

The generate.go file should now be correctly updated and a PR of the changes can then be submitted.

3 Likes

That endpoint is for us-east-1. Do we know if AWS releases region-specific instance types?

Yes, the instance types are very much region specific.

A given instance type is the same across all regions that have that instance type, but what instances are available depends on the region. (eg, m4.2xlarge is the same instance in us-east-1 and eu-central-1, but us-east-1 might have an m4.4xlarge but that isn’t available in eu-central-1.)

This tends to happen with new instance types and new regions. As they roll out new hardware in the new region, they end up with a bunch of new instance types, that aren’t available in older regions yet.