The capabilities of EC2 continued to expand this week with the addition of filtering and resource tagging, in addition to what the company’s blog admits is the “somewhat esoteric yet very useful” feature called idempotent instance creation.
Resource Tagging – This feature allows EC2 users to tag individual resources, including EC2 instances, AMIs, EBS volumes and snapshots, and Amazon VPC resources.
Filtering – Allows users to filter the types of information that will be returned from an EC describe call using one or more key/value pairs as filters.
Bring Your Own Keypair – EC2 users can now import their own RSA keypair.
And of course, this brings us to the other, slightly more nebulous side of the announcement involving idempotent instance creation…
Amazon’s API includes functions that create resources, including instances and key pairs, which are created in a synchronous manner, thus it is possible to identify whether the request you’ve made has been successful by examination of the value the call returns.
However, there are some functions that are not quite as simple to execute, which are asynchronous. This is where the latest idempotent instance creation feature comes into play. As Amazon noted, in asynchronous cases, “making the call initiates an action that may take a fairly long time (seconds or minutes) to complete. When the call returns, you cannot know if the request has succeeded or not. Timeouts and connection errors can further muddy the water; you don’t want to unnecessarily retry a request if there’s an associated cost for the resource” and furthermore, there should be no reason to create two instances when you only needed one to begin with.
EC2’s RunInstances now supports idempotency and the company suggests that “if you are launching EC2 instances as part of a higher level process, this feature should help you to build management and control applications that are more robust.”