import * as apigateway from "@pulumi/aws-apigateway";
const getHandler = new aws.lambda.CallbackFunction("GET", {
policies: [aws.iam.ManagedPolicy.AWSLambdaVPCAccessExecutionRole, aws.iam.ManagedPolicy.LambdaFullAccess],
callback: async (ev, ctx) => {
[...]
},
});
// Create an API endpoint
const endpoint = new apigateway.RestAPI("hello-world", {
routes: [{
path: "/{route+}",
method: "GET",
eventHandler: getHandler,
}],
});
exports.endpoint = endpoint.url;
Running pulumi up without AWS_REGION set:
Diagnostics:
aws:apigateway:RestApi (hello-world):
error: 1 error occurred:
* creating urn:pulumi:tkappler::aws-ts-apigateway::aws-apigateway:index:RestAPI$aws:apigateway/restApi:RestApi::hello-world: 1 error occurred:
* creating API Gateway REST API (gou81ynktb) specification: BadRequestException: Errors found during import:
Unable to put integration on 'GET' for resource at path '/{route+}': Invalid ARN specified in the request
This is because the region becomes part of the endpoint URL. "Invalid ARN" doesn't help the user figure this out, though.
Simple program:
Running
pulumi up
withoutAWS_REGION
set:This is because the region becomes part of the endpoint URL. "Invalid ARN" doesn't help the user figure this out, though.