Sam
01/20/2022, 3:00 AMauth.attachPermissionsForUnauthUsers([api])
allow unauthenticated users access to my api? Api endpoints returns {"message":"Forbidden"}
if I am unauthenticated. Am I missing something?
Thanks!Sahan Amadoruge
01/20/2022, 1:24 PMError: The Content-Range header is missing in the HTTP Response. The simple REST data provider expects responses for lists of resources to contain this header with the total number of results to build the pagination. If you are using CORS, did you declare Content-Range in the Access-Control-Expose-Headers header?
I try to pass the requested header on the response. But still i'm getting this error. What did i miss?
return {
statusCode: 200,
headers: {
'Content-Type': 'application/json',
'Content-Range': 'results 0-24/319'
},
body: JSON.stringify(results),
};
Vinicius Carvalho
01/20/2022, 1:48 PMINFO: Incremental deploy failed. Falling back to full deploy...
) occurs?Narayan Chaudhary
01/20/2022, 2:06 PMnpx sst add-cdk @aws-cdk/aws-iam
❌ @aws-cdk/aws-iam is an AWS CDK v1 package. Only v2 packages are supported.
Failed to add the @aws-cdk/aws-iam package to the app
Dan Van Brunt
01/20/2022, 2:39 PMsst.Api
…. just looking at the src for sst.Api
though and it looks like it uses both CDK v1 and CDK v2? is that right?
Anyone know of a way to get Service integrations (Event Bridge) working with @aws-cdk/aws-apigatewayv2-alpha
?Sam Hulick
01/20/2022, 3:08 PMsst update
still won’t update my CDK packages 😞 can anyone tell me what the version # is supposed to be for the CDK packages, in the latest serverless stack 0.60.2?Martin Wawrusch
01/20/2022, 3:23 PM// import { APIGatewayProxyHandlerV2 } from "aws-lambda";
// import { AppSyncResolverHandler } from "aws-lambda";
export const main: any /* AppSyncResolverHandler */ = async (event: any, x: any, a: any) => {
console.log(event);
console.log(x);
console.log(a);
return {
statusCode: 200,
headers: { "Content-Type": "text/plain" },
body: `Hello, World! Your request was received at ${event.requestContext.time}.`,
};
};
Sam Hulick
01/20/2022, 3:38 PMError [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './core' is not defined by "exports" in /Volumes/SuperData/Sites/reelcrafter/v2-microservices/node_modules/aws-cdk-lib/package.json
FIXED!: HttpUserPoolAuthorizer
is used.Sam Hulick
01/20/2022, 4:39 PMHttpUserPoolAuthorizer
syntax
dev-microservices-api-base | UPDATE_ROLLBACK_IN_PROGRESS | AWS::CloudFormation::Stack | dev-microservices-api-base | Export dev-microservices-api-base:ExportsOutputRefRestApiUserPoolAuthorizer34D6B3E8DA3B1D94 cannot be deleted as it is in use by dev-microservices-api-files, dev-microservices-api-media and dev-microservices-api-misc (and 2 more)
Kristian Lake
01/20/2022, 4:54 PMPavan Kumar
01/20/2022, 5:57 PM503 ERROR
The request could not be satisfied.
The Lambda function associated with the CloudFront distribution is invalid or doesn't have the required permissions. We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
Generated by cloudfront (CloudFront)
Request ID: RRTOBh45Cnnslf2dj35V0o8Iylx_gSXhlaxW0ibLRc3H5qkHkUq6tw==
Here is the code for the page.
// pages/events/[events].tsx
import type { GetServerSideProps, NextPage } from 'next'
import styles from '../../styles/Home.module.css'
export const getServerSideProps: GetServerSideProps = async (context) => {
return {
props: {
event: context.params?.event,
},
}
}
type Props = {
event: string,
}
const Home: NextPage<Props> = ({ event}) => {
return (
<div className={styles.container}>
<h1>Event Page</h1>
<p>Event {event}</p>
</div>
)
}
export default Home
Sam Hulick
01/20/2022, 6:10 PMsst start
crashes upon the first HTTP API request
TypeError: Cannot read property 'map' of undefined
at Object.build (/Volumes/SuperData/Sites/reelcrafter/v2-microservices/node_modules/@serverless-stack/core/dist/runtime/handler/node.js:163:33)
at Object.build (/Volumes/SuperData/Sites/reelcrafter/v2-microservices/node_modules/@serverless-stack/core/dist/runtime/handler/handler.js:12:25)
at Server.trigger (/Volumes/SuperData/Sites/reelcrafter/v2-microservices/node_modules/@serverless-stack/core/dist/runtime/server.js:173:53)
at Server.invoke (/Volumes/SuperData/Sites/reelcrafter/v2-microservices/node_modules/@serverless-stack/core/dist/runtime/server.js:141:21)
at WS.handleRequest (/Volumes/SuperData/Sites/reelcrafter/v2-microservices/node_modules/@serverless-stack/cli/scripts/start.js:307:33)
at WS.handleMessage (/Volumes/SuperData/Sites/reelcrafter/v2-microservices/node_modules/@serverless-stack/core/dist/runtime/ws.js:90:37)
at WebSocket.<anonymous> (/Volumes/SuperData/Sites/reelcrafter/v2-microservices/node_modules/@serverless-stack/core/dist/runtime/ws.js:50:49)
at WebSocket.emit (events.js:400:28)
at WebSocket.emit (domain.js:475:12)
at Receiver.receiverOnMessage (/Volumes/SuperData/Sites/reelcrafter/v2-microservices/node_modules/ws/lib/websocket.js:1008:20)
I have "type": "module"
in my root package.json, and I’ve set bundle.format
to 'esm'
. I’m pretty sure this is related to one of both of these settingsRoss Gerbasi
01/20/2022, 6:39 PMMichael Clifford
01/20/2022, 7:31 PMbundle.format: 'esm'
with ApolloAPI
, I get the following when trying to make a request:
Unhandled Promise Rejection {"errorType":"Runtime.UnhandledPromiseRejection","errorMessage":"Error: Dynamic require of \"stream\" is not supported","reason":"Error: Dynamic require of \"stream\" is not supported","promise":{},"stack":["Runtime.UnhandledPromiseRejection: Error: Dynamic require of \"stream\" is not supported"," at process.<anonymous> (file:///home/mclifford/Development/github.com/cliffom/sst-bff-demo/node_modules/@serverless-stack/aws-lambda-ric/lib/index.js:34:23)"," at process.emit (node:events:390:28)"," at emit (node:internal/process/promises:136:22)"," at processPromiseRejections (node:internal/process/promises:242:25)"," at processTicksAndRejections (node:internal/process/task_queues:97:32)"]}
Mehmet Ali SARAÇ
01/20/2022, 7:55 PMDan Van Brunt
01/20/2022, 8:50 PMKristian Lake
01/20/2022, 10:17 PMSam Hulick
01/20/2022, 11:00 PMsst start
), it says “No changes to deploy”. but if I quit & run sst start
again, it deploys the changes I madeNir Weiner
01/20/2022, 11:39 PMCreateOrder(productsIds: string[])
api, how do I validate those product exists?
I mean, how do I organize the folders in a way that its easy to validate this information?
For example, if the data is stored in dynamoDB
1. Should I query the dynamoDB products table directly from the service?
2. Should I call the GetProduct() api?
Is there any trivial approach here?Sam Hulick
01/21/2022, 1:17 AM"errorType": "Runtime.ImportModuleError",
"errorMessage": "Error: Cannot find module 'punycode/'\nRequire stack:\n- /var/task/src/lambda/rest/functions/get-listener-signed-cookie.js\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js",
this is new.. I dunno what this package is, and I’m not using it anywhere
🔥 ugh.. our production app is down nowFrank Faubert
01/21/2022, 3:50 AMLukasz K
01/21/2022, 8:02 AMSean Matheson
01/21/2022, 9:51 AMRoss Coundon
01/21/2022, 1:53 PMDestroy underlying resources, like sockets. It's usually not necessary to do this. However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed. Otherwise, sockets might stay open for quite a long time before the server terminates them.In a Node.js lambda environment, would you say it's necessary to call destroy after processing each time? Seems like unnecessary tear-down and then client creation on next invocation if warm
Garret Harp
01/21/2022, 3:59 PMKristian Lake
01/21/2022, 4:02 PMDerek Kershner
01/21/2022, 4:08 PMsst start
boots up as per normal, but all functions called through API routes (https) throw error
"Runtime.HandlerNotFound: /home/dkershner/repos/global-api-devops/.sst/artifacts/157a4603/src/api/health/get.default is not a function"
The file at that location appears to exist and contain uglified, but valid, code...
I have tested 2 apps, and this persists to both.Sam Hulick
01/21/2022, 4:42 PMaws-cdk-lib
and any related -alpha
libraries as we normally would with npm & yarn? no need for sst update
?Kristian Lake
01/21/2022, 4:44 PMTony J
01/21/2022, 5:43 PM