colossal-easter-73659
12/11/2020, 2:53 PMconst region: aws.Region = <aws.Region>"us-east-1";
const regionWest = aws.Region.USWest2;
const providerEast = new aws.Provider(`provider-${region}`, {
region: region,
profile: "dev_account_work",
});
const providerWest = new aws.Provider(`provider-${regionWest}`, {
region: regionWest,
profile: "dev_account_work",
});
const existing = aws.lambda.Function.get(
arnWest,
arnWest,
{},
{ provider: providerWest }
);
const endpoint = new awsx.apigateway.API(
"test-api",
{
routes: [
// Serve a simple REST API on `GET /name` (using AWS Lambda)
{
path: "/source",
method: "GET",
eventHandler: existing,
},
],
restApiArgs: {endpointConfiguration: { types: 'REGIONAL'}}
},
// { providers: [providerEast, providerWest] }
{provider: providerEast}
);
// Export the public URL for the HTTP service
exports.url = endpoint.url;
}