JASPHI
JASPHI

Reputation: 143

AWS CLI : How to get the API Gateway ID

Is there a way/possible on how we can get the API GAteway ID by name or can we iterate the list and return by its name from AWS CLI, i tried the following way and it doesn't return any thing

aws apigateway get-rest-apis --query 'items[?name==`TestAPI`].value' --output text --region us-east-1

thanks in advance

Updated the list output

"items": [
    {
        "id": "5aa9gcij77",
        "name": "JavaLamdba",
        "description": "JavaLamdba",
        "createdDate": 1608225655,
        "apiKeySource": "HEADER",
        "endpointConfiguration": {
            "types": [
                "REGIONAL"
            ]
        }
    },

Upvotes: 0

Views: 1704

Answers (2)

Abhinash Khuntia
Abhinash Khuntia

Reputation: 1

This should give you the expected result

> select name, description, created_date from aws.aws_api_gateway_rest_api where name = 'lambda-test';
+-------------+-------------+---------------------+
|    name     | description |    created_date     |
+-------------+-------------+---------------------+
| lambda-test | lambda-test | 2019-07-25 09:05:16 |
+-------------+-------------+---------------------

https://steampipe.io/

Upvotes: 0

amitd
amitd

Reputation: 1532

aws apigateway get-rest-apis --query 'items[?name==`JavaLamdba`].id' --output text --region us-east-1

Upvotes: 3

Related Questions