Seth Geoghegan
01/03/2022, 5:59 PMonCreate
and removes a database onDelete
. I've tested by putting the lambda behind the sst.API construct and it works fine.
However, when I define the sst.Script construct with the same lambda, sst start
and sst remove
take very long (20+ minutes). Without the Script construct, these actions take around 1-2 minutes to deploy from scratch.
Any tips to debug this, or is this the expected behavior with custom resources?thdxr
01/03/2022, 5:59 PMSeth Geoghegan
01/03/2022, 6:00 PMthdxr
01/03/2022, 6:01 PMthdxr
01/03/2022, 6:01 PMFrank
Matt Morgan
01/03/2022, 7:04 PMMatt Morgan
01/03/2022, 7:04 PMMatt Morgan
01/03/2022, 7:05 PMSeth Geoghegan
01/03/2022, 7:08 PMthdxr
01/03/2022, 7:08 PMSeth Geoghegan
01/03/2022, 7:09 PMMatt Morgan
01/03/2022, 7:11 PMSeth Geoghegan
01/03/2022, 7:17 PMyarn run db:migrate
or similar doesn't seem awful.Seth Geoghegan
01/03/2022, 7:17 PMMatt Morgan
01/03/2022, 7:17 PMSeth Geoghegan
01/03/2022, 7:29 PMsst start
and have a database created for them within the development RDS instance. Using this approach, I hope to eliminate the need to run a local DB in docker (what they do today) and push all development for this particular service to the cloud.
I'm mostly trying to ensure that sst start
and sst remove
deliver a good experience. I suppose it's not the end of the world if sst remove
is slow, since it shouldn't happen terribly often. Just exploring options 🙂Seth Geoghegan
01/03/2022, 7:30 PMMatt Morgan
01/03/2022, 7:31 PMSeth Geoghegan
01/03/2022, 7:34 PMSeth Geoghegan
01/03/2022, 8:56 PMsst start
as well. I doubt there is anything SST specific to do here, just providing this for insight:
sgeoghegan-my-ts-sst-app-kas-migration | CREATE_FAILED | Custom::SSTScript | AfterDeployScriptResource204FEBCF | Received response status [FAILED] from custom resource. Message returned: connect ETIMEDOUT 54.161.169.125:443
Logs: /aws/lambda/sgeoghegan-my-ts-sst-app--AfterDeployonCreateFunct-SjMUZ26yDHhS
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16) (RequestId: a81d3c7b-a1f9-46c0-86b9-fcda6e880ab8)
Seth Geoghegan
01/03/2022, 8:58 PMFrank
Frank
TCPConnectWrap.afterConnect
timeout on sst start
related to the sst remove
timeout?Seth Geoghegan
01/04/2022, 1:39 PMnew sst.Script(this, "DbMigrate", {
defaultFunctionProps: {
environment: {
SECRET_ARN: props.databaseSecretArn,
DB_NAME: scope.stage,
DEFAULT_DB_NAME: props.defaultDatabaseName
},
vpc: Vpc.fromLookup(this, 'VPC', { vpcName: props.vpcName }),
permissions:["secretsManager"]
},
onCreate: "src/script.dbMigrate",
onDelete: "src/script.dbMigrate",
});
Frank
Seth Geoghegan
01/04/2022, 5:59 PMTCPConnectWrap.afterConnect
timeout. This timeout is a result of my crappy code 🙂
2) Setting up and tearing down the stack can be slow, particularly tearing down the stack. I'm consistently seeing 21 minutes for sst remove
to completely remove a fairly basic REST API. I haven't seen this slowness create a timeout yet.
The tricky part is this is painful to diagnose since each create/remove takes a loooong time 🙂Frank
sst.Construct
does it take ~20min to sst remove
?