Is there any default AMI in all EC2 regions?

The team ec2-run-instancesrequires an AMI identifier, and the identifier in all regions. Is there a way to indicate that I need an AMI that is suitable for the x / zone y region and instance_type z region?

In other words, I need a way to use some “default AMI” so that I can write a script that will work in all EC2 regions.

+3
source share
1 answer

There is nothing like the default AMI for Amazon EC2 , and there is no concept of choosing the default (or rather region-specific) AMI among otherwise identical AMIs with different identifiers for the region as well (regardless of the region, the AMI ID will be a great improvement) .

This is usually solved by adding the appropriate mapping to your script, so it depends on the scripting environment used (a simple map should always be available somehow) - for example. AWS CloudFormation uses the same approach, see the EC2ChooseAMI.template sample , which is an example of using mappings to select AMI based on region and instance type.

AWSRegionArch2AMI , , ( , AMI , ).

+3

All Articles