Adrián Mouly
08/04/2021, 5:59 AMpr149-tasks-stack-LambdaDELETEtaskstaskId55457B-Phy8XB3Kr1eU
Josias Duarte Busiquia
08/04/2021, 11:24 AMsst.json
each imply multiple installations of SST?Drew
08/04/2021, 10:55 PMJimmy
08/05/2021, 8:22 AMFrank
// Function.cs
namespace SampleFunction
{
public class Function
{
public string FunctionHandler(string input, ILambdaContext context)
{
return input?.ToUpper();
}
}
}
ie. I want to invoke FunctionHandler
from my terminalMatthew Purdon
08/05/2021, 3:10 PMfromBucket[Name|Arn]
? I know the general philosophy is to let CDK generate names (especially things that will generate a CW log group) but is there a way to get a handle to an existing bucket?Sam Hulick
08/06/2021, 4:41 AMYN0002: │ @aws-cdk/aws-events-targets@npm:1.111.0 [d4661] doesn't provide @aws-cdk/assets (p44201), requested by @aws-cdk/aws-codebuild
➤ YN0002: │ testproj@workspace:. doesn't provide jest (pa7e45), requested by @aws-cdk/assert
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 6s 410ms
it doesn’t like the fact that jest
is not in the dependencies. could work in peerDependencies
but maybe better in devDependencies
. so maybe the SST project creation script could include jest
. more info on this: https://dev.to/arcanis/implicit-transitive-peer-dependencies-ed0Nick Laffey
08/06/2021, 7:02 PMStaticSite
construct and deploying and removing was working fine until a few days ago. I’m doing sst remove --stage MyStageName
in a Github action. It’s throwing an error because the path/folder to the distribution files doesn’t exist… But I don’t see why that should matter though if I’m destroying the stack? If I build before destroying it works fine. Am I missing something? Is there a good reason to need to build my static site before destroying or was an issue introduced recently? Again, it seems like this just started happening recently. I’ll see if I can track down whether we did an sst upgrade.Adrián Mouly
08/06/2021, 11:21 PMexport class AnotherStack extends Stack {
constructor(scope: App, id: string, props: AnotherStackProps) {
super(scope, id, props);
props.api.addRoutes(this, {
"GET /notes/{id}": "src/get.main",
"PUT /notes/{id}": "src/update.main",
"DELETE /notes/{id}": "src/delete.main",
});
}
}
The thing is my “routes” all need to have the same “base path” like…
/myapp/notes
And I don’t want to put..
props.api.addRoutes(this, {
"GET /myapp/notes/{id}": "src/get.main",
"PUT /myapp/notes/{id}": "src/update.main",
"DELETE /myapp/notes/{id}": "src/delete.main",
});
Is there a way to define the path
for only those routes?
I know that I can define the path
when creating the API from scratch with customDomain
, but not sure how to do on this scenario.Adrián Mouly
08/07/2021, 7:59 AMpackage.json
file today, due most of them have totally different dependencies between each other.
How is supposed that I can do the same with SST?
For example, I have a bunch of lambdas under the user
service that uses the jsonwebtoken
dependency. Of course I don’t want to share that dependency with every other service.
Based on mono-repo examples, all shared a package.json
on the root, at the same level as the sst.json
file, then all the projects are built with the same dependencies, I guess.
Anybody else has any thoughts?Ross Coundon
08/07/2021, 8:29 PMsst deploy
it seems to take longer than it should.
Running tsc
on the entire project takes about 10s
I feel like the Building Lambda function /src/somePath/func.handler stage takes longer than it should. For this project to get from the running sst deploy
to Deploying Stacks takes 11 minutes.Sakar
08/08/2021, 8:21 AMGarret Harp
08/08/2021, 4:33 PMconst Cognito = new Auth(this, 'AuthResourceId', {
cognito: true
})
// Enable SES for emails:
const cfnUserPool = Cognito.cognitoUserPool!.node.defaultChild as CfnUserPool
cfnUserPool.emailConfiguration = {
emailSendingAccount: 'DEVELOPER',
replyToEmailAddress: '<mailto:email@example.com|email@example.com>',
from: '<mailto:email@example.com|email@example.com>',
sourceArn: 'arn:something'
}
// Create domain for UserPool:
new CfnUserPoolDomain(this, 'DomainResourceId', {
userPoolId: Cognito.cognitoUserPool!.userPoolId,
domain: 'some-domain'
})
// Add a group:
new CfnUserPoolGroup(this, 'GroupResourceId', {
userPoolId: Cognito.cognitoUserPool!.userPoolId,
groupName: 'GroupName',
precedence: 0
})
Would be really nice if I could just do something similar to this:
const Cognito = new Auth(this, 'AuthResourceId', {
cognito: {
userPool: {
domain: 'some-domain',
groups: [{ id: 'ResourceId', groupName: 'GroupName', precedence: 0 }],
emailConfiguration: {
emailSendingAccount: 'DEVELOPER',
replyToEmailAddress: '<mailto:email@example.com|email@example.com>',
...
}
}
}
})
Luke Wyman
08/09/2021, 4:59 AMnpx create-serverless-stack@latest [project name] --language python
. Some thoughts on this:
• The above creates a hybrid of Javascript sst code, Javascript sst tests for MyStack.js
, and Python for the lambdas. The usual package.json, etc.
• Where/how are the Python dependencies needed in my Lambdas managed (since I'm seeing node stuff everywhere else)?
• What happens when I run npx sst test
? I know Jest is a part of serverless stack, so what happens with whatever Python testing framework I'll end up using (for domain object unit tests)? Does the test command detect that and respond accordingly, or do I have to wire that up? Or, do I just run a separate command to run the Python tests?
• My guess is that sst knows how to bundle and deploy Python Lambdas by detecting the .py
extension.
• Integration tests can still still be in typescript, since that's what they are for my typescript microservices and don't intrude into the guts of my Lambdas.Sam Hulick
08/09/2021, 9:48 PM[dotenv][DEBUG] did not match key and value when parsing line 1: # These variables are only available in your SST code.
[dotenv][DEBUG] did not match key and value when parsing line 2: # To apply them to your Lambda functions, checkout this doc - <https://docs.serverless-stack.com/environment-variables#environment-variables-in-lambda-functions>
[dotenv][DEBUG] did not match key and value when parsing line 3:
[dotenv][DEBUG] did not match key and value when parsing line 7:
Adrián Mouly
08/10/2021, 5:56 AMAPI One
it’s defined with IAM auth, and then must be consumed by Service Two
.. how should I setup Service Two
to send the proper authentication? I’m lost on this, can’t find examples of it.Jay
Lukasz K
08/10/2021, 1:43 PMKujtim Hoxha
08/10/2021, 2:58 PMcwd
srcPath
is defined in the function props this should be changed to the srcPath
instead of root
the reason for this is that go
does not find the go.mod
file and does not compile the code.David Martin
08/10/2021, 9:11 PMconst parseSchema = require("graphql/language").parse;
try {
parseSchema(graphQLSchemaAsString);
} catch (e) {
// parse failed
}
Sam Hulick
08/11/2021, 3:44 AM{
"name": "v2-microservices",
"version": "0.1.0",
"private": true,
"workspaces": [
"src/services/*"
],
"dependencies": {
"@serverless-stack/cli": "^0.37.2"
}
}
when I run yarn
, I see a node_modules folder pop up in src/services/mytest/
which I don’t think is supposed to happen. no other dependencies do this.. if I remove the SST CLI package and install a bunch of other stuff, it’s fine.
I’ve let one of the Yarn 2 maintainers know. not sure if this bug exists in Yarn 1Ashishkumar Pandey
08/11/2021, 6:10 PMnpx sst start
. When I attempt this, my requests work but they don’t get logged in the console and my changes also don’t get reflected.Ross Coundon
08/11/2021, 9:28 PMAdrián Mouly
08/11/2021, 11:39 PM/projects/{projectId}
-> <http://google.com/projects/{projectId}|google.com/projects/{projectId}>
Sam Hulick
08/12/2021, 4:01 AMenvironment
is missing in the Properties on the right sidebar. https://docs.serverless-stack.com/constructs/FunctionAshishkumar Pandey
08/13/2021, 10:09 AM❯ npm audit
# npm audit report
jszip <3.7.0
Severity: moderate
Prototype Pollution - <https://npmjs.com/advisories/1774>
fix available via `npm audit fix --force`
Will install @serverless-stack/resources@0.4.5, which is a breaking change
node_modules/jszip
zip-local *
Depends on vulnerable versions of jszip
node_modules/zip-local
@serverless-stack/resources >=0.5.0
Depends on vulnerable versions of zip-local
node_modules/@serverless-stack/resources
@serverless-stack/cli >=0.5.0
Depends on vulnerable versions of @serverless-stack/resources
node_modules/@serverless-stack/cli
4 moderate severity vulnerabilities
To address all issues (including breaking changes), run:
npm audit fix --force
this is for 0.38.0Kujtim Hoxha
08/13/2021, 10:44 AMapp.setDefaultFunctionProps
but it looks like you can only do that within the context of a stack, I think there should be an easier way to add lambda layers for all functions in all my stacks (I ended up just adding it to one of the stacks that the others are dependent on)Phil Astle
08/13/2021, 10:49 AMSam Hulick
08/13/2021, 7:29 PM.js
and .js.map
files are written there. that way it’s super easy to just upload those to Sentry/wherever in one shotDavid Martin
08/13/2021, 7:45 PM