This message was deleted.
# general
s
This message was deleted.
l
this is what my resource looks like (its a different resource i think):
onst api = new awsx.apigateway.API("macs-" + environment, {
stageName: environment,
routes: [
{
path: "/getmiscdata",
method: "GET",
eventHandler: getmiscdata,
apiKeyRequired: true,
},
{
path: "/getmiscdata",
method: "OPTIONS",
eventHandler: handlecors,
apiKeyRequired: true,
},
{
path: "/getallgames",
method: "GET",
eventHandler: getallgames,
apiKeyRequired: true,
},
{
path: "/getgamecategories",
method: "GET",
eventHandler: getgamecategories,
apiKeyRequired: true,
},
{
path: "/getcreditusagereport",
method: "GET",
eventHandler: getcreditusagereport,
apiKeyRequired: true,
},
{
path: "/getcreditvaluereport",
method: "GET",
eventHandler: getcreditvaluereport,
apiKeyRequired: true,
},
{
path: "/getuserbykey/{sessionkey}",
method: "GET",
eventHandler: getuserbykey,
apiKeyRequired: true,
},
{
path: "/getgameinfobyid/{gameid}",
method: "GET",
eventHandler: getgameinfobyid,
apiKeyRequired: true,
},
{
path: "/getheartbeatinfo/{sessionkey}",
method: "GET",
eventHandler: getheartbeatinfo,
apiKeyRequired: true,
},
{
path: "/getallmembers",
method: "GET",
eventHandler: getallmembers,
apiKeyRequired: true,
},
{
path: "/getlocationbypostalcode/{postalcode}",
method: "GET",
eventHandler: getlocationinfobypostalcode,
apiKeyRequired: true,
},
{
path: "/getversion",
method: "GET",
eventHandler: getversion,
apiKeyRequired: true,
},
],
gatewayResponses: {
DEFAULT_4XX: {
statusCode: 400,
responseTemplates: {
"application/json": '{"message":$context.error.messageString}',
},
responseParameters: {
"gatewayresponse.header.Access-Control-Allow-Origin": "'*'",
"gatewayresponse.header.Access-Control-Allow-Headers": "'*'",
"gatewayresponse.header.Access-Control-Allow-Methods": "'*'",
"gatewayresponse.header.Access-Control-Allow-Credentials": "'*'",
},
},
},
apiKeySource: "HEADER",
});
its a rest api instead of an http api, @billowy-army-68599
b
@limited-solstice-34584 i don't think that's exposed as part of the
awsx
library because it's a more opinionated method. You might have to rewrite it using the lower level aws library, see the second link I posted
l
@billowy-army-68599 someone needs to create a tool for pulling existing api gateway apis and dumping their config as pulumi code 🙂
b
you can use pulumi's
import
mechanism https://www.pulumi.com/docs/guides/adopting/import/ It won't generate the code for you, but running pulumi preview will help you understand what you need to add as a resource
l
is it possible to dump the config out?
of a resource
wow i think i understand. I will need to use the aws method instead of the crosswalk method as the crosswalk method isnt specific enough, @billowy-army-68599?
b
that's right. the awsx library you're importing is designed to get people off the ground very quickly and doesn't expose all the interfaces of the aws API.
l
I see, thank you