Is there some way to define a `apigateway.RestAPi`...
# aws
Is there some way to define a
using OpenAPI but do not rely on the
that is used within the OpenApi spec? Why I want this? Since the spec is JSON ARN and other has to be hardcoded, so I loose the advantage of referring to a lambda (
const myLambda = aws.lambda.Function
) defined with pulumi as code.
Hey @billowy-army-68599 . I see you're answering quite a lot of questions (thats nice!). I would be very happy if you could help me with this question too, or might tag somehow that could help me instead.
Maybe @little-cartoon-10569 could you point me into the right direction? I wouldn't ask directly if I otherwise would have found an answer here, on stackoverflow, pulumi docs or aws docs 😬
This is over my head, I'm afraid. I don't understand the question. I don't even know how it relates to Pulumi. Looks like an AWS topic?
First thanks a lot for the answer @little-cartoon-10569! May I explain it a bit differently: Pulumi Crosswalk for AWS - API Gateway offers a really nice way to connect an api gateway endpoint with a specific lambda, here
as a
(no ARN / URI)
Copy code
      path: "/",
      method: "GET",
      eventHandler: helloHandler,
That of course do not work when I am defining my api in JSON with OpenAPI. So to connect my endpoints with a lambda, it is suggested to use
. But when I use that, and correct me if I am wrong, I need to connect endpoint and a specific lambda via the arn/uri (not sure which, still a beginner) that I have to look after creating my
lambda using pulumi. For me, it would be more efficient if I could connect them directly using
as a reference to my lambda. Thus, my question is, if there is a way to connect my endpoint defined in my OpenAPI Json with my
lambda without manually copy/pasting the arn/uri of that lambda into the json using
? Thanks a lot in advance! Thus
Sorry, still above my pay grade. 'x-amazon-apigateway-integration' looks like a HTTP header to me, and Pulumi code doesn't expose that sort of detail to users. If you're generating a JSON payload for a HTTP or API call you're making outside of Pulumi, and if you've created the lambda using Pulumi, then your options are either 1. to export the ARN or URI from the Pulumi app and use it wherever you're creating your payload, or 2. to apply the ARN or URI within the Pulumi app and generate the payload inside the apply block.