Giter Club home page Giter Club logo

Comments (8)

rpgreen avatar rpgreen commented on June 22, 2024

Curious, why do you need to update after creating it? There is a
deploy flag to create/deploy or update/deploy.

On Monday, 28 September 2015, AndreyStrib [email protected] wrote:

How can I get identitfier of API created by importer, in a way that can be
reused by following update/deploy commands?
Is it possible to update aws-api-import to return the identifier?


Reply to this email directly or view it on GitHub
#47.

from aws-apigateway-importer.

AndreyStrib avatar AndreyStrib commented on June 22, 2024

In my project api gateway is built around lambdas. I've made few scripts that simplify developing/deployment and defining inputs and outputs of lambdas, also I've automated api swagger file generation based on lambdas in my project, which is used by another script to update api in aws, using importer. To make this update without necessity to provide api id manually, I need to get api id from importer on api creation.
Currently, in my fork I changed importer to output api id and than script tries to catch it.

from aws-apigateway-importer.

cosbor11 avatar cosbor11 commented on June 22, 2024

I also need this functionality to automate the gateway creation since there is no cloudformation solution available. Each time I run the importer a new API is created. I would like to update any existing APIs that have the same name (If one does not exist, create it).

Is this possible with this importer?

from aws-apigateway-importer.

Nr18 avatar Nr18 commented on June 22, 2024

You could use the CLI tool for that:

aws apigateway get-rest-apis --query 'items[?name == `API_NAME`] | [0].{id: id}'

if the value is null create else update the returned id

from aws-apigateway-importer.

cosbor11 avatar cosbor11 commented on June 22, 2024

Thanks that's very helpful. Where is the --query syntax documentation?

Im trying to get the id string from the json

{
    "id": "cdw66dzmk7"
}

from aws-apigateway-importer.

cosbor11 avatar cosbor11 commented on June 22, 2024

I figured it out:

  --output text 

from aws-apigateway-importer.

Nr18 avatar Nr18 commented on June 22, 2024

If you have jq available you could use the following as well:

aws apigateway get-rest-apis --query 'items[?name == `API_NAME`] | [0].{id: id}' --output json | jq -r '.id'

Could come in handy in some situations.

The --query syntax is JMESPath, see http://jmespath.org

from aws-apigateway-importer.

rpgreen avatar rpgreen commented on June 22, 2024

Swagger/OpenAPI import is now generally available in the API Gateway REST API, the AWS CLI and all AWS SDKs. You can also import and export Swagger definitions using the API Gateway console. This release addresses many of the open issues and feedback in this repository.

I would encourage you to migrate your workflow to the standard AWS tools. aws-apigateway-importer will receive minimal support from the API Gateway team going forward.

Any feedback or issues with the new importer should be directed to the official API Gateway forums.

Thanks,
Ryan

from aws-apigateway-importer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.