Postman API Deployment using AWS API Gateway and AWS DynamoDB
This is a collection for deploying an API from Postman to AWS API Gateway. It was distilled down from a larger API life cycle collection I am building but I wanted to pull out and let it stand on its own. Currently it is a five step deployment process.
All of this could easily be distilled down into a single Postman request, but I want to pause and make sure that is what I need. It has already been distilled down from multiple API calls to Postman, AWS DynamoDB, and AWS API Gatway. So, I am just pausing to make sure of the workflow I want for deploying an API to a development or production environment.
This collection depends on this environment to authenticate with the Postman API, AWS DynamodDB API, and AWS API Gateway API, as well as to store data used in the deployment process. You can import this environment into your Postman, enter your keys and tokens, and it should work as long as your AWS IAM is configured properly to work with AWS API Gateway and AWS DynamoDB.
If you need an OpenAPI to test out, I have ran this collection against the following APIs so far:
I will keep working on stablizing and streamling this collection, and publishing any changes as part of this documentation. Using these docs as a complete set of instructions for how to use this collecton for deploying APIs.
POST8. Add Key to Plan (AWS API Gateway)
https://apigateway.us-east-1.amazonaws.com/usageplans/:usage_plan_id/keys
Now that we have a key and a usage plan we actually have to associate them so that they know about each other.
AUTHORIZATIONAWS Signature
Access Key
<your aws access key>
Secret Key
<your aws secret key>
PATH VARIABLES
usage_plan_id
{{aws_api_gateway_usage_plan_id}}
Bodyraw
{
"keyId" : "{{aws_api_gateway_key}}",
"keyType" : "API_KEY"
}
Example Request
8. Add Key to Plan (AWS API Gateway)
View More
curl
curl --location -g 'https://apigateway.us-east-1.amazonaws.com/usageplans/{{aws_api_gateway_usage_plan_id}}/keys' \
--data '{
"keyId" : "{{aws_api_gateway_key}}",
"keyType" : "API_KEY"
}'
Example Response
- Body
- Headers (0)
No response body
This request doesn’t return any response body
GET9. Make GET Request to API
This actually makes a call to the API, pulling any records that are available.
HEADERS
x-api-key
{{aws_api_gateway_key}}
Example Request
9. Make GET Request to API
curl
curl --location -g '{{aws_api_gateway_invoke_url}}/{{aws_dynamodb_table_name}}' \
--header 'x-api-key: {{aws_api_gateway_key}}'
Example Response
- Body
- Headers (0)
No response body
This request doesn’t return any response body
POST10. Add entry to API.
This actually adds an entry to the API we have deployed, adding a record to the backend database.
HEADERS
x-api-key
{{aws_api_gateway_key}}
Content-Type
application/json
Bodyraw
{
"identifier": "product-five",
"name": "Product Two",
"description": "This is the description for product one."
}