Amazon API Gateway enables developers to publish and manage APIs that access AWS and other web services and data sources. Once connected to API Gateway, you can view your API deployment status and history from within Postman. You can also view Amazon CloudWatch metrics for each stage to get operational insight into your API.
This integration supports OpenAPI 3.0 definitions for HTTP and REST APIs. You can import a definition from Amazon API Gateway and use it in Postman. For HTTP APIs, you can choose to export your definition from Postman to API Gateway. You can use the AWS console to deploy your exported definition to a stage, or deploy your HTTP API definition directly from Postman to a stage.
To connect to Amazon API Gateway in Postman, select APIs in the sidebar and select an API. Select Deployments, and then select AWS API Gateway.
When setting up the connection to API Gateway, you can choose to authenticate by creating an AWS IAM role or by using an AWS access key. Follow the steps for your chosen method:
When you delete an API or remove it from a workspace, any configured integrations aren't deleted or removed. On the Postman Home page, select Integrations and search for "AWS API Gateway" to view the list of AWS API gateway integrations. To delete an integration, select it and then select Delete Integration.
To set up a connection to Amazon API Gateway using an AWS IAM role, select IAM under AWS Authentication Mechanism.
Enter a Nickname for this integration and select the AWS API Type (HTTP or REST).
To create an IAM role for Postman in AWS, do the following:
Sign in to the AWS IAM console and select Create role.
Under Select trusted entity, select AWS account.
Under An AWS account, select Another AWS account and enter Postman's AWS Account ID: 258201882842
Under Options, select the Require external ID checkbox and enter the External ID from Postman. You can find the external ID in Postman's Connect to AWS API Gateway procedure above, in Step 1: Create an IAM role.
For more information, refer to the AWS IAM guide on using external IDs.
Select Next: Permissions.
Select an existing IAM policy or select Create policy. If you are creating a policy, use the following JSON code:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt909923626743",
"Effect": "Allow",
"Action": [
"apigateway:GET",
"apigateway:PUT",
"apigateway:POST",
"cloudwatch:GetMetricData"
],
"Resource": [
"*"
]
}
]
}
This policy will enable exporting and deploying for HTTP API definitions. (Exporting and deploying aren't supported for REST API definitions.) You can customize the Action
section in the IAM policy based on your needs:
"apigateway:GET"
- (Required) Enables viewing API Gateway deployments for HTTP and REST APIs in Postman."apigateway:PUT"
- Enables exporting HTTP API definitions to the API Gateway."apigateway:POST"
- Enables deploying HTTP API definitions to a stage on the API Gateway."apigateway:*"
- Assigns all GET, PUT, POST, PATCH, DELETE permissions to the IAM role."cloudwatch:GetMetricData"
- Enables viewing CloudWatch metrics in Postman.Select Next: Tags.
Select Next: Review.
Add a Role name and Role description, then select Create role.
Copy the Role ARN from AWS and paste it in Postman under Step 2: Enter role ARN and region. Next, enter the AWS Region where the API Gateway is located and select the API Gateway. When you're ready, select Connect.
To set up a connection to Amazon API Gateway using an AWS access key, select Access Key under AWS Authentication Mechanism.
Next, enter information about the connection:
When you're ready, select Connect.
After setting up the connection, you can choose to import an HTTP or REST definition from the API Gateway:
After connecting to Amazon API Gateway, you can view the export and deployment history for your API definitions in Postman. Select APIs in the sidebar and select an API. Select Deployments.
4xx
and 5xx
errors.
From the Deployments view, you can take the following actions:
Amazon CloudWatch provides monitoring and observability for APIs deployed to Amazon API Gateway. By default, API Gateway metrics data is automatically sent to CloudWatch in one-minute intervals. After connecting to API Gateway, you can view the last week of CloudWatch metrics in Postman.
From the Deployments view, select the name of a stage to view the CloudWatch dashboard for that stage. The graphs on the dashboard display metrics for latency, integration latency, 4xx
and 5xx
error rates, and count.
From the CloudWatch dashboard, you can take the following actions:
The Amazon API Gateway integration supports viewing CloudWatch metrics in Postman. If you previously created an IAM policy when configuring the integration, you may need to update the policy to enable CloudWatch metrics. Make sure to add the "cloudwatch:GetMetricData"
action to your IAM policy:
"Action": [
"apigateway:GET",
"apigateway:PUT",
"apigateway:POST",
"cloudwatch:GetMetricData"
],
You can import an HTTP or REST definition from a connected Amazon API Gateway to your API in Postman. Importing a definition will replace your current API definition or add a new definition if one doesn't exist.
Exporting an HTTP API definition makes it available in the connected Amazon API Gateway. After you export a definition from Postman, use the AWS console to configure and deploy the definition to a stage in API Gateway. When exporting, you can also choose to deploy the definition directly from Postman to a stage in the connected API Gateway. Once the definition is deployed, users can start calling the API.
HTTP API definition can be exported and deployed from Postman. To deploy a REST API definition, use the AWS console.
To export and deploy your API definition to an AWS stage, do the following:
Select APIs in the sidebar and select an API.
Select Deployments.
Select Deploy API.
Select the source of the definition you want to deploy. You can select the current definition or any published version of the definition.
(Optional) If you would like to deploy the definition to a stage after exporting, select Deploy on a stage. Select the AWS stage to deploy the definition to, and enter a brief description.
To deploy your definition, your gateway must have at least one route with a configured integration.
Select Deploy.
If you have a problem exporting or deploying, make sure you've assigned both the PUT and POST permissions in your IAM policy.
API Gateway extensions to Open API (vendor extensions) are preserved when pushing and deploying a definition from Postman. Postman merges any extensions present in the API Gateway into the definition before pushing the merged definition to the API Gateway.
Last modified: 2024/07/01