APIs and How They Work in Amazon Web Services
The Amazon Web Services (AWS) environment acts as an integrated collection of hardware and software services designed to enable the easy, quick, and inexpensive use of computing resources. Now, sitting atop this integrated collection is the AWS application programming interface (API, for short): In essence, an API represents a way to communicate with a computing resource.
With respect to AWS, nothing gets done without using the AWS API. The AWS API is the sole way that external users interact with AWS resources, and there's literally no way to use AWS resources without the API being involved. In fact, if you access AWS through the AWS Management Console or the command line tools, you are actually using tools that make calls to the AWS API.
What are APIs?
APIs (application programming interfaces) have become increasingly important in the world of computing. You may consider yourself the kind of person who'd never, ever have to use an API. You'd be wrong. APIs have been important, they are important now, and they'll become even more important. More likely than not, you've been using APIs for years without even knowing it.
With respect to Amazon, the API is the sole external interface to computing resources and services. Without API calls being made, nothing gets done.
A good way to describe an API is to say that it represents a way for one program to interact with another via a defined interface — in other words, a mechanism by which any other program that communicates with the program can be assured that it will fulfill its role.
The idea is that if a calling program provides the right information within the correct syntax, the program with the API will respond in the requested manner.
The AWS API
As you might imagine, given the comprehensiveness of AWS services and the way Amazon has been improving and extending them, the AWS API is one large puppy — the AWS S3 API reference manual is 269 pages. (Think that's a lot of pages? The AWS EC2 API reference manual is 561 pages.)
However, if you take a quick look at the following example of an API call, you'll quickly see that it closely resembles a (quite simple) REST example:
https://ec2.amazonaws.com/?Action=RunInstances &ImageId=ami-60a54009 &MaxCount=3 &MinCount=1 &Placement.AvailabilityZone=us-east-1b &Monitoring.Enabled=true &AUTHPARAMS
The call, which is straightforward, instructs AWS to run between one and three instances based on an Amazon machine image of ami-60a54009 and to place them in the us-east-1b availability zone.
AWS provides monitoring capabilities, and this call instructs AWS to enable this monitoring. The AUTHPARAMS part is a stand-in for the information that AWS uses to implement security in its API. Know that this call has the appropriate security mechanisms in place to ensure its execution.