Spent all day converting a Serverless Framework ap...
# random
s
Spent all day converting a Serverless Framework app to SST and it's going really well. One last deploy before quitting for the day, and.....
Copy code
Stack sgeoghegan-auth-service-v2-api
  Status: failed
  Error: Received response status [FAILED] from custom resource. Message returned: Rate exceeded (RequestId: 504a0e96-6604-4185-a300-b9d89f71d315)

Failed to deploy the app
Sounds like it's a CDK issue around Cloudwatch logs when setting LogRetentions
Copy code
// Set default runtime for all functions
  app.setDefaultFunctionProps({
    srcPath: 'src',
    runtime: 'nodejs14.x',
    logRetention: config.logRetentionDays.  // <--- this is causing the issue
  });
My API only has 32 lambdas, nothing crazy. 🤷
f
Hey Seth, I'm away from my keyboard, but there are a couple of other logretention setting in the FunctionProps that lets u tweak retry policy and stuff. Might be worth taking a look.
In the CDK lambda.Function doc
s
Yup, looks like
logRetentionRetryOptions
or something
Digging it up, thanks! Mostly putting it here for the future, when I inevitably search for this error again in a few months 🙂
f
lol did that work?
s
It did! Should look like
Copy code
export default function main(app) {
  // Set default runtime for all functions
  app.setDefaultFunctionProps({
    srcPath: 'src',
    runtime: 'nodejs14.x',
    logRetention: config.logRetentionDays,
    // <https://github.com/aws/aws-cdk/issues/8257>
    logRetentionRetryOptions: {
      base: Duration.millis(500),
      maxRetries: 15,
    },
  });