another big question is, when i use api gateway (A...
# general
r
another big question is, when i use api gateway (AWS) and deploy with a new resource. the entire api gateway goes down and says “unexpected token e error” and cannot invoke any lambda. it needs a second deployment to fix
l
Can you share the code which sets up the API Gateway?
r
sure
Copy code
const apigateway = new awsx.apigateway.API('api-gateway', {
  routes,
  restApiArgs: {
    binaryMediaTypes: []
  }
});
Copy code
export const routes: awsx.apigateway.Route[] = [
  {
    path: 'route/',
    method: 'GET',
    eventHandler: callbackFunction,
  },]
l
Can you also post the full console output when the error occurs, also with
pulumi about
output?
r
its not an error like that. it is an error that happens inside the lambda function invoked by the API Gateway
the second deployment fixes it
Error
ERROR Invoke Error {"errorType":"SyntaxError","errorMessage":"Unexpected token e in JSON at position 0"
l
What is Pulumi changing to the infrastructure on the second deployment? Do you have output of that you can paste?
r
it changes the api gateway stage and deployment
yes lemme check
l
which version of
awsx
package are you using?
r
“@pulumi/awsx”: “^0.30.0", this is it
im having some trouble sending the output beacuse the deployment seems to be taking some time, but
it changes the api gateway stage and deployment
doe this help?
l
That is an old one. Could you first bump to the latest version, which is v1.0.0-beta.11? https://www.pulumi.com/registry/packages/awsx/
r
the beta? is there any stable one?
l
Yes, I see we just released 1.0.0 https://github.com/pulumi/pulumi-awsx/releases
r
lemme bump to that and see
l
It’s possible you have to update your code because there is a big difference between the 0.xx version range and the 1.0 one.
r
lemme check
yeah seems i have to change my entire api gateway structure