AWS API Gateway

A common use case for API documentation and governance is to receive available APIs from AWS API Gateway. For this, the LeanIX Integration API with a custom connector is used to import respective data to the workspace. AWS provides a set of public APIs that can be used to export meta data from an AWS API Gateway.

Authorize at AWS API Gateway

Calls to receive AWS API Gateway information, the consumer of interface resources needs to authorize via AWS Signature authorization. In Postman, this can be chosen as a standard authorization method:

Option for authorization to call AWS API Gateway resources in PostmanOption for authorization to call AWS API Gateway resources in Postman

Option for authorization to call AWS API Gateway resources in Postman

As credentials in this authorization method an access key needs to be provided. Those can be created and copied from the AWS IAM Service.

Receive Meta Data from AWS API Gateway

After setting up authorization, all API resources from AWS API Gateway can accessed.

An example can be to request all deployed APIs in a long list:

https://apigateway.{{region}}.amazonaws.com/restapis?limit=10

Please note that the region needs to be adapted to the one the API Gateway is running on. Furthermore, the limit can be adjusted according to the use case the requester has.

Storing data in LeanIX VSM

Using an individual ETL job based on the requirements of the integration, information responded by AWS is transformed to the LDIF-format. It is then stored in LeanIX VSM with a standard inbound connector.

Example

{
    "processors": [
        {
            "processorType": "inboundFactSheet",
            "processorName": "Interfaces instances from AWS",
            "processorDescription": "Creates LeanIX Interface Fact Sheets APIs received from AWS API Gateways",
            "type": "API",
            "filter": {
                "exactType": "API"
            },
            "identifier": {
                "external": {
                    "id": {
                        "expr": "${content.id}"
                    },
                    "type": {
                        "expr": "externalId"
                    }
                }
            },
            "updates": [
                {
                    "key": {
                        "expr": "name"
                    },
                    "values": [
                        {
                            "expr": "${data.name}"
                        }
                    ]
                },
                {
                    "key": {
                        "expr": "description"
                    },
                    "values": [
                        {
                            "expr": "${data.description}"
                        }
                    ]
                },
                {
                    "key": {
                        "expr": "lifecycle.active"
                    },
                    "values": [
                        {
                            "expr": "${data.createdDate}"
                        }
                    ]
                }
            ]
        }
    ],
    "variables": {}
}
{
    "connectorType": "awsGatewayAPICreation",
    "connectorId": "a89c09fd-f43b-482c-b4a8-ff4239946f6c",
    "connectorVersion": "1.0.0",
    "lxVersion": "1.0.0",
    "description": "Creates LeanIX Interace Fact Sheets APIs received from AWS API Gateways",
    "processingDirection": "inbound",
    "processingMode": "partial",
    "customFields": {},
    "content": [
        {
            "type": "API",
            "id": "0n1anifwvf",
            "data": {
                "name": "PetStore",
                "createdDate": "2016-04-05",
                "description": "Your first API with Amazon API Gateway. This is a sample API that integrates via HTTP with our demo Pet Store endpoints"
            }
        }
    ]
}

Did this page help you?