Sam Frampton
09/17/2021, 4:37 PMthdxr
09/18/2021, 4:52 AMmain
and everything is called in the right order. All fully typed. Basically dependency injection, inversion of control, insert buzzword herethdxr
09/18/2021, 8:28 PMsst deploy <stack>
Adrián Mouly
09/19/2021, 7:56 PMJack Fraser
09/19/2021, 8:20 PMcreate_domain --stage [stage]
command? Seem to be able to do it but it creates EndpointType
as REGIONAL
instead of EDGE
@FrankAdrián Mouly
09/19/2021, 11:00 PMAdrián Mouly
09/20/2021, 5:01 AMsst remove --stage xxx
… how it know which stages has to remove? it compiles my current code to get the existing stages “in code”? or calls CF to pull existing stacks?
Asking this because sometimes I modify an stack-name locally, but on AWS there is still the same stack with other name. What would happen in that situation? is going to remove my old stack or not?Adrián Mouly
09/20/2021, 12:44 PM${scope.stage}-${scope.name}-project
… where project
is the name of the feature that I want to build.
Then when creating a Dynamo table, for example, I do this:
tableName: `${namePrefix}-myCoolTable`,
But well, it’s a little boilerplate to do this on every Construct instance.
What others are doing?Clayton
09/20/2021, 4:45 PMlib/index.ts
export default function main(app: <http://sst.App|sst.App>): void {
if (app.stage === "dev") {
app.setDefaultRemovalPolicy(RemovalPolicy.DESTROY);
}
...
error
Property 'setDefaultRemovalPolicy' does not exist on type 'App'.
thdxr
09/20/2021, 8:12 PMmathewgries
09/21/2021, 2:39 AMJoel Corona
09/21/2021, 2:36 PMSam Frampton
09/21/2021, 9:41 PMsls info -verbose
to view stack outputs of urls, & arns etcluke
09/22/2021, 12:44 PMsst start
logs. Similar idea here https://www.boyney.io/blog/2021-09-06-debug-eventbridge-with-postman.Ross Coundon
09/22/2021, 2:01 PMconst someFunctionList: Function[] = [];
but this gives the linting error
Don't use `Function` as a type. The `Function` type accepts any function-like value.
It provides no type safety when calling the function, which can be a common source of bugs.
So what I've done instead is to import Function via an alias
import { Function as SSTFunction } from '@serverless-stack/resources';
and used
const someFunctionList: SSTFunction[] = [];
David Martin
09/22/2021, 7:16 PMfatal error: all goroutines are asleep - deadlock!
goroutine 1 [semacquire]:
sync.runtime_Semacquire(0x0)
runtime/sema.go:56 +0x25
sync.(*WaitGroup).Wait(0xc00000e010)
sync/waitgroup.go:130 +0x71
main.runService(0x1)
<http://github.com/evanw/esbuild/cmd/esbuild/service.go:138|github.com/evanw/esbuild/cmd/esbuild/service.go:138> +0x4cb
main.main()
<http://github.com/evanw/esbuild/cmd/esbuild/main.go:200|github.com/evanw/esbuild/cmd/esbuild/main.go:200> +0x1eb
goroutine 4 [chan receive]:
main.runService.func1()
<http://github.com/evanw/esbuild/cmd/esbuild/service.go:66|github.com/evanw/esbuild/cmd/esbuild/service.go:66> +0x4b
created by main.runService
<http://github.com/evanw/esbuild/cmd/esbuild/service.go:64|github.com/evanw/esbuild/cmd/esbuild/service.go:64> +0x212
goroutine 5 [chan receive]:
main.(*serviceType).sendRequest(0xc000064190, {0x13f20a0, 0xc032732690})
<http://github.com/evanw/esbuild/cmd/esbuild/service.go:163|github.com/evanw/esbuild/cmd/esbuild/service.go:163> +0xda
main.runService.func2()
<http://github.com/evanw/esbuild/cmd/esbuild/service.go:92|github.com/evanw/esbuild/cmd/esbuild/service.go:92> +0x39
created by main.runService
<http://github.com/evanw/esbuild/cmd/esbuild/service.go:89|github.com/evanw/esbuild/cmd/esbuild/service.go:89> +0x313
Joel Corona
09/22/2021, 10:10 PMAdrián Mouly
09/24/2021, 4:33 AMindex
which can check if all my SSM vars are defined in the current account/environment.
I need this due I have currently 3 totally different AWS accounts (dev, stage, prod), so I need to manually configure each SSM instance by hand.
Thoughts?Adrián Mouly
09/24/2021, 4:57 AMMuhammad Ali
09/25/2021, 2:33 AMDan Van Brunt
09/25/2021, 4:03 PMyarn v2
? We’re thinking of making the move and I think in order to support it, there may only need to be some changes to how SST implements packages like eslint internally. They may not be a need to actually use yarn v2 in SST itself. Also, lots of great things in it if you did.Joel Corona
09/27/2021, 2:54 PMRoss Coundon
09/27/2021, 10:23 PMsst start
locally and specifying the same stage name that's in Seed it should allow me to ‘take over’ that application and route the API calls to my local code. Then, when I'm done, I could kick off the deploy in Seed to remove the debug stack.
However, after doing this, all requests immediately fail when running from the Seed deployed version with HTTP 500. I don't think it's even getting as far as hitting the integrated lambdas.
If I then run sst start
for that stage locally it works again.
I've also noticed that I have multiple lambdas by the same name in the account now, I'm wondering if this approach has led to things getting duplicated - haven't proven that yet, that's a job for tomorrow.
As I say, I need to do some more investigation in the morning but wanted to mention it in case there's something inherently wrong with what I'm trying to do.Blake E
09/28/2021, 7:08 PMsst.NextjsSite
and sst start
worked well (including the cool sst-env
shim). I’m looking to deploy this in ca-central-1
but now that I’m done, I’m deploying and getting the following error:
username-mysite-frontend-website | UPDATE_FAILED | AWS::CloudFront::Distribution | SiteDistribution390DED28 Resource handler returned message: "Invalid request provided: The function must be in region 'us-east-1'. ARN: arn:aws:lambda:ca-central-1:1234:function:username-mysite-fronten-SiteMainFunction123-YYZ:3 (Service: CloudFront, Status Code: 400, Request ID: ABC, Extended Request ID: null)" (RequestToken: ABC, HandlerErrorCode: InvalidRequest)
I thought maybe it was the cloudfront distribution, which I’ve tried to disable, still now joy - any pointers?
// Create a Next.js site
const site = new sst.NextjsSite(this, 'Site', {
path: 'nextjs',
cfDistribution: {
enabled: false,
},
environment: {
// Pass the table details to our app
REGION: scope.region,
API_URLS: Fn.select(0, apiUrls),
},
})
Jack Fraser
09/28/2021, 8:46 PMevent.requestContext.authorizer.*
becomes event.requestContext.authorizer.lambda.*
when using a ApiAuthorizationType.CUSTOM
- is this due to payloadFormatVersion - and is there a way round it?
@FrankErik Robertson
09/29/2021, 3:04 PMnpx create-serverless-stack@latest --example rest-api sst-test2
and then cd and do npm run start it deploys the debug stack and then fails beore deploying the app stack saying:
Cannot find app handler. Make sure to add a "lib/index.js" file.
There is indeed no such file in the sample. There is a stacks folder instead which is being referred to in sst.json.
Is /lib' a hardcoded dependency??Joe Kendal
09/29/2021, 3:17 PMJack Fraser
09/29/2021, 5:46 PMAdrián Mouly
09/29/2021, 9:22 PMLukasz K
09/30/2021, 5:02 AM