João Pedro
09/28/2021, 7:28 PMnpx create-serverless-stack@latest --language typescript
it’s giving me the following error when installing the packages:
npm ERR! code 1
npm ERR! path /Users/jpmtrabbold/Documents/repos/the-gap-app-2/node_modules/aws-crt
npm ERR! command failed
npm ERR! command sh -c node ./scripts/install.js
npm ERR! info TOOL Using Unix Makefiles generator.
npm ERR! info TOOL Building only the install target, as specified from the command line.
npm ERR! ERR! OMG CMake executable is not found. Please use your system's package manager to install it, or you can get installers from there: <http://cmake.org>.
npm ERR! /Users/jpmtrabbold/Documents/repos/the-gap-app-2/node_modules/cmake-js/lib/cMake.js:115
npm ERR! throw new Error("CMake executable is not found. Please use your system's package manager to install it, or you can get installers from there: <http://cmake.org>.");
npm ERR! ^
npm ERR!
npm ERR! Error: CMake executable is not found. Please use your system's package manager to install it, or you can get installers from there: <http://cmake.org>.
npm ERR! at CMake.verifyIfAvailable (/Users/jpmtrabbold/Documents/repos/the-gap-app-2/node_modules/cmake-js/lib/cMake.js:115:15)
npm ERR! at CMake.build (/Users/jpmtrabbold/Documents/repos/the-gap-app-2/node_modules/cmake-js/lib/cMake.js:287:10)
npm ERR! at BuildSystem._invokeCMake (/Users/jpmtrabbold/Documents/repos/the-gap-app-2/node_modules/cmake-js/lib/buildSystem.js:59:40)
npm ERR! at async buildFromRemoteSource (/Users/jpmtrabbold/Documents/repos/the-gap-app-2/node_modules/aws-crt/scripts/build.js:148:5)
Sam Hulick
09/29/2021, 2:42 AMmain()
, I have this:
app.setDefaultFunctionProps(stack => ({
// ...
logRetention:
app.stage === 'prod'
? logs.RetentionDays.THREE_MONTHS
: logs.RetentionDays.FIVE_DAYS,
and yet, this one slipped through the cracksJoe Kendal
09/29/2021, 7:21 AMnew sst.Function
?
https://github.com/serverless-stack/serverless-stack/issues/868Isaac P
09/29/2021, 7:56 PMJoão Pedro
09/29/2021, 8:21 PMÖmer Toraman
09/29/2021, 10:04 PMaws configure set cli_auto_prompt on
Dan Coates
09/30/2021, 4:01 AM- packages
- api1
- src
- index.ts
- package.json
- node_modules
- api2
- src
- index.ts
- package.json
- node_modules
would you have a single install of serverless stack at the root? Or a separate one in each package? Is there an example of working with a monorepo like this?Adrián Mouly
09/30/2021, 4:47 AMAram
09/30/2021, 6:50 AMDan Van Brunt
09/30/2021, 1:07 PMCron
functions manually during testing.
a) Set the frequency very often in dev…. seems a bit too much, manual would be best
b) Keep the AWS console open and keep clicking the run test button …. too many clicks
c) write a short bash script to trigger the function with some dummy data…. I’m lazy, this would be great if there was a feature in SST to trigger on some kinda keyboard shortcut, like “on save” would be great!Dan Van Brunt
09/30/2021, 1:11 PMFazi
09/30/2021, 3:30 PMconst api = new Api(this, "Api", {
routes: {
"GET /skills": skillsSyncFunction
},
});
I want to secure these so that the client needs a bearer token before making a request. My access token has the following fields:
{ 'AccessToken': 'eyJ...', 'ExpiresIn': 300, 'TokenType': 'Bearer', 'IdToken': 'eyJ...' }
What would be the correct way to set up auth? I tried this but it failed:
const api = new Api(this, "Api", {
defaultAuthorizationType: ApiAuthorizationType.JWT,
defaultAuthorizer: new HttpUserPoolAuthorizer({
'userPool': env['AWS_USER_POOL'],
'userPoolClient': env['AWS_CLIENT_ID']
}),
routes: {
"GET /skills": skillsSyncFunction
},
});
However this threw an error message:
ApiUserPoolAuthorizer6F4D9292 Caught exception when connecting to <https://cognito-idp.eu-west-2.amazonaws.com/undefined/.well-known/openid-configuration> for issuer <https://cognito-idp.eu-west-2.amazonaws.com/undefined>. Please try again later. Error: Invalid issuer: <https://cognito-idp.eu-west-2.amazonaws.com/undefined>. Issuer must have a valid discovery endpoint ended with '/.well-known/openid-configuration' (Service: AmazonApiGatewayV2; Status Code: 400; Error Code: BadRequestException; Request ID: 0000; Proxy: null)
Could someone please guide me on how I could get auth working with API endpoints? Rest seems to all work very wellAbdul Taleb
09/30/2021, 4:39 PMAbdul Taleb
09/30/2021, 7:07 PMJonathan Chapman
09/30/2021, 11:18 PMtsconfig.json
file? Currently, in my setup I have my file named as tsconfig.app.json
and split the test file to tsconfig.spec.json
.Aaron McCloud
10/01/2021, 1:32 AMnpx sst start
and had to cancel before it had run fully. Now when I attempt to run that command I get:
Stack dev-newCenturyAPI-century-frontend is in the CREATE_IN_PROGRESS state. It cannot be deployed.
Hubert
10/01/2021, 3:42 PMsst start
for development, and today tried to deploy my application with sst deploy
which seems to have hit a lambda limit.
stack failed: Resource handler returned message: "Unzipped size must be smaller than 47358303 bytes (Service: Lambda, Status Code: 400, Request ID: e9aea816-1578-4523-9a68-2f16d3bb278c, Extended Request ID: null)" (RequestToken: 687bb199-2423-bcc6-df83-ffd2c4f44dce, HandlerErrorCode: InvalidRequest)
I've got the exact same application deployed in SLS and the functions collectively do have a size larger than the limit, but when looking at them in their "stacks" or "microservices" they dont reach more than few MBs. Any suggestions on how to go about this? I've disabled bundling on few functions but I do have quite a few using Layers and the same layer may be used in multiple stacks - not sure if its an issue but I thought i will point it out.
Thanks.Anatol
10/01/2021, 8:41 PMsls package
), and I've used buildspec instead of post deploy phase like below:
after_deploy:
- if [ $SEED_SERVICE_NAME = "cognito" ]; then cd /tmp/seed/source/services/appsync && yarn && sls deploy; fi
Sam Hulick
10/01/2021, 11:18 PM27e96e69-0234-4c15-99de-f4682c1063b6 REQUEST dev-microservices-api-files-getFolders [src/lambda/rest/functions/get-folders.main] invoked by API GET /folders
27e96e69-0234-4c15-99de-f4682c1063b6 RESPONSE {"statusCode":400,"body":"{\"message\":\"SSL error: Remote host terminated the handshake\",\"code\":\"BadRequestException\",\"time\":\"20... 142 more characters"}
Devin
10/02/2021, 10:18 PM./frontend
npm run test
works just fine. When I run it the root, like Seed would in deploy, I get some babel errors. Do I need to configure the sst app to have the same config as the react app?Noah D
10/03/2021, 7:02 AMMehmet Ali SARAÇ
10/03/2021, 12:10 PMthis.wsAuthorizerFn = new sst.Function(this, "ws-authorizer", {
handler: "src/services/messenger.wsAuthorizer",
})
this.messengerApi = new sst.WebSocketApi(this, "messenger-service", {
accessLog: false,
authorizationType: sst.WebSocketApiAuthorizationType.CUSTOM,
authorizer: new HttpLambdaAuthorizer({
authorizerName: `LambdaAuthorizer`,
handler: this.wsAuthorizerFn
}),
routes: {
$connect: {
handler: "src/services/messenger.onWebsocketConnected",
environment: {
WEBSOCKET_CONNECTION_TABLE: this.connectionTable.tableName
}
},
$disconnect: {
handler: "src/services/messenger.onWebsocketDisconnected",
environment: {
WEBSOCKET_CONNECTION_TABLE: this.connectionTable.tableName
}
},
}
})
failed: AuthorizerResultTtlInSeconds cannot be set for WEBSOCKET protocol Apis. (Service: AmazonApiGatewayV2; Status Code: 400; Error Code: BadRequestException; Request ID: d46f8a9a-e138-4a00-8b9e-fc60c36e9da9; Proxy: null)
Sam Hulick
10/03/2021, 9:05 PMyarn start
process single-threaded? I noticed that if it’s running and I get a bunch of webhooks at once from my billing provider, it runs the webhook handler function one at a timeFabian Ehringer
10/04/2021, 2:23 PMyarn start
takes a long time for us even if there are no changes. Is there a way to only debug stacks where you’re currently working on with yarn start
and just have the rest of the stacks deployed or something like that?solsglasses
10/04/2021, 4:27 PMAWS Lambda : Serverless Framework == AWS ECS : ❌
Kelly Davis
10/04/2021, 7:32 PMCloudFormation did not receive a response from your Custom Resource. Please check your logs for requestId [...]. If you are using the Python cfn-response module, you may need to update your Lambda function code so that CloudFormation can attach the updated version.
This is associated with an sst.ReactStaticSite
- any ideas what might be causing this and how to mitigate it?thdxr
10/04/2021, 10:57 PMDan Van Brunt
10/05/2021, 1:01 PMnpx sst add-cdk
when I had a bunch of packages set to 1.124.0
and it installed a bunch at 1.125.0
1. Just realized I don’t know a way to check with CDK version SST’s version is at short of hunting down SST’s package.json
2. Should a tool like npx sst add-cdk
not take into account version mismatches between what you might have installed vs CDK latest vs SST latest and let you know of any anomalies?Lukasz K
10/05/2021, 1:11 PMDan Van Brunt
10/05/2021, 2:08 PMpermissions
prop for a function?
permissions: [
[eventsBucket, 'headObject', 'getObject'],
[
new iam.PolicyStatement({
actions: ['ssm:*'],
effect: iam.Effect.ALLOW,
resources: [`arn:aws:ssm:${REGION}:${ACCOUNT_ID}:parameter${SSM_HUBSPOTAPIKEY}`],
}),
],
],
…this does not work.
in this case, do we have to use…
fun.attachPermissions([
new iam.PolicyStatement({
actions: ["execute-api:Invoke"],
effect: iam.Effect.ALLOW,
resources: [
`arn:aws:execute-api:${region}:${account}:${api.httpApiId}/*`,
],
}),
]);