admin管理员组

文章数量:1404458

I need to run a query to establish which VPC_LINK (id or name) that each of our API Resources are associated with .. We have hundreds of API's defined, each with multiple resources, and I need to programatically retrieve information about which VPC_LINK has been associated with each integration/resource

I used the following to get the resources of each API

$ aws apigateway get-resources --rest-api-id 123abcxyz 

and then the following to give details of the integration for that resource

$ aws apigateway get-integration --rest-api-id 123abcxyz --resource-id abcz1 --http-method POST

but this only gives me information that the connectionType is VPC_LINK ....but it doesnt tell me what actual VPC_LINK (id or name) it is using

i.e.

{
    "type": "HTTP_PROXY",
    "httpMethod": "POST",
    "uri": ":8443/api/v1/stuff/{version}/morestuff",
    "connectionType": "VPC_LINK",
    "connectionId": "xcvbn",
    "passthroughBehavior": "WHEN_NO_MATCH",
    "timeoutInMillis": 29000,
    "cacheNamespace": "fsdfsd",
    "cacheKeyParameters": [],
    "integrationResponses": {
        "200": {
            "statusCode": "200"
        }
    }
}

Does anyone know how i can retrieve this data without clicking through the console for eternity :-)

thanks

本文标签: amazon web servicesAWS CLIHow to get the VPCLINK associated to an API ResourceStack Overflow