Hi, I'm trying to use Pulumi to create an API Gate...
# aws
s
Hi, I'm trying to use Pulumi to create an API Gateway that can call multiple Lambda endpoints, i.e, there is a one-to-one mapping between the path called and the respective Lambda function invoked. Is there any available example in Pulumi documentation for achieving this? I tried using the
body
argument in
apigateway.RestApi
to have OpenAPI specs for each individual path and a corresponding integration under
x-amazon-apigateway-integration
but it gives an error like this -
Unable to put integration on 'POST' for resource at path '/<some>/<path>': Integrations of type 'AWS_PROXY' currently only supports Lambda function and Firehose stream invocations.
s
Can you just configure a seperate method and integration for each
Copy code
const methodGet = new aws.apigateway.Method("get", {
    restApi: openApiId,
    resourceId: resource.id,
    httpMethod: "GET",
    authorization: "CUSTOM",
    authorizerId: openApiAuthorizorId,
    apiKeyRequired: true,
});

const integration = new aws.apigateway.Integration("integration", {
    restApi: openApiId,
    resourceId: resource.id,
    httpMethod: methodGet.httpMethod,
    integrationHttpMethod: methodGet.httpMethod,
    type: "HTTP_PROXY",
    uri: "<https://httpbin.org/uuid>",
});
s
Yeah that is another way of doing it instead of giving the OpenAPI specs. I would also need to create a specific
Resource
before each right?
s
yes
or define the shared resource