Making requests to the Amazon EC2 API
Important
As of October 14, 2022, HTTP responses from
the Amazon EC2 APIs no longer include a reason-phrase element. As recommended by
RFC7230
We provide the Query API for Amazon EC2, as well as software development kits (SDK) for Amazon that enable you to access Amazon EC2 from your preferred programming language.
To monitor the calls made to the Amazon EC2 API for your account, including calls made by the Amazon Web Services Management Console, command line tools, and other services, use Amazon CloudTrail. For more information, see the Amazon CloudTrail User Guide.
Contents
- Required knowledge
- Available APIs for Amazon EC2
- Query requests for Amazon EC2
- Request throttling for the Amazon EC2 API
- Troubleshooting API request errors
- Ensuring idempotency
- SOAP requests
- Cross-origin resource sharing support and Amazon EC2
- Logging Amazon EC2, Amazon EBS, and Amazon VPC API calls using Amazon CloudTrail
- Monitoring API requests using Amazon CloudWatch
- VM Import Manifest
Required knowledge
If you plan to access Amazon EC2 through an API, you should be familiar with the following:
-
XML
-
Web services
-
HTTP requests
-
One or more programming languages, such as Java, PHP, Perl, Python, Ruby, C#, or C++.
Available APIs for Amazon EC2
The Amazon EC2 Query API provides HTTP or HTTPS requests that use the HTTP verb GET or POST
and a Query parameter named Action
.
Amazon provides libraries, sample code, tutorials, and other resources for software developers who prefer to build applications using language-specific APIs instead of submitting a request over HTTP or HTTPS. These libraries provide basic functions that automatically take care of tasks such as cryptographically signing your requests, retrying requests, and handling error responses, so that it is easier for you to get started.
For more information about the Amazon SDKs, see Amazon SDKs and Tools