AWS Cloudwatch Integration

Number of APIs: 3

Introduction

This collection is intended to recreate API requests (GET, POST, PUT, and DELETE) from a specified Log Group in AWS Cloudwatch within a specified collection by the user. In order to run the following integrations, you will need to select the AWS Cloudwatch environment and follow the documentation below for Environment Setup specifics.

Prerequisites

This collection requires that you have both a Qodex API key ([learn more about the Qodex API here] and get your Qodex API key here) and AWS access keys (learn more about AWS access keys here). Furthermore, execution logs must enabled for the API wanting to be tracked in AWS. More information for the steps in achieving this process can be found here.

Forking Collections

In order to use this integration, you will need to fork this collection. You can do this by left clicking on a collection and pressing create a fork. You will also need to fork the environment named AWS Cloudwatch Integration ([learn more about forking collections and environments here]

Monitors

In the integration, a monitor is used to automatically check updates made to the specified Log Group once a day and create a new collection including the updated requests (since Qodex does not currently support modifying pre-existing collections through their API).

In order to make this monitor, input the desired Monitor Name, select the AWS Cloudwatch Integration collection as the Collection. Select the AWS Cloudwatch environment as the environment and select how often you want it to be run to check if your logs have been updated (we recommend once a day). Then, your monitor should be created ([learn more about creating a monitor here]

Mocks

If you would like to see example responses and run and interact with the collection without having to input valid credentials, you will need to create a mock server. You can do this by left clicking on your forked version of this integration and selecting Mock Collection ([learn more about creating a mock server here]

Then you will also nee to fork the [MOCK] AWS Cloudwatch Integration environment. Copy the mock server url and assign it to the environment variable mockUrl. If you run the collection with the mock environment selected, it will show you what a successful request looks so long as you fill out the environment variables with the correct variable type.

Workflow Diagram

Workflow Diagram

Environment Setup

To use this collection, the following environment variables must be defined:

KeyDescription
x-api-keyYour Qodex API key ([learn more about the Qodex API here] and get your Qodex API key here)
awsAccessKeyYour AWS access key (learn more about AWS access keys here)
awsSecretKeyYour AWS secret key (learn more about AWS access keys here)
awsRegionThe region in which your AWS service is located (e.g.: us-east-1, us-west-2)
currentWorkspaceNameThe name of your current workspace so this integration knows where to insert the generated logs collection
logGroupNameThe name of the API Log Group you would like this integration to track from AWS Cloudwatch (i.e. API-Gateway-Execution-Logs_lmcb7rvwfb/testAPI)
collectionNameThe name of collection to where the log streams should be regenerated. If this variable is not specified, the collection name will be defaulted to AWS Cloudwatch Generated Requests.
collectionDescriptionA description of collection that will be generated. If this variable is not specified, the collection description will be defaulted to This is just a collection of logs generated by the AWS Cloudwatch Integration.
  1. Get Log Events from Stream POST {{baseUrl}}

  2. Create Collection POST {{baseUrl}}?workspace={{workspaceID}}

  3. Get Workspace Id GET {{baseUrl}}/workspaces