https://serverless-stack.com/ logo
#help
Title
# help
g

Garret Harp

02/05/2022, 11:18 PM
Is there a reason why the accessLog definition on sst.Api does not accept RetentionDays from
aws-cdk-lib/aws-logs
?
f

Frank

02/06/2022, 1:26 AM
Hey @Garret Harp this should work
Copy code
new Api(this, "Api", {
  accessLog: {
    retention: "THREE_DAYS",
  },
  routes: ...
});
More details here https://docs.serverless-stack.com/constructs/Api#apiaccesslogprops
g

Garret Harp

02/06/2022, 1:27 AM
Yeah that is what I am doing right now but I would prefer if we could specify using RetentionDays especially since I have a helper that sets it based on the stage 😅
f

Frank

02/06/2022, 2:03 AM
Gotcha. Lemme put that in.
It takes RetentionDays in
0.61.1
🤓
g

Garret Harp

02/08/2022, 9:54 AM
Thank you!