Commit 53877bb
authored
feat: add CloudWatch LogGroup with retention policy to Lambda functions (#117)
## Summary
Add explicit CDK-managed CloudWatch LogGroups with 1-week retention to
all Lambda functions to prevent unbounded log storage costs.
## Problem
Without explicit LogGroup configuration, Lambda auto-creates LogGroups
with infinite retention. As logs accumulate, storage costs grow without
bound.
## Changes
Added `LogGroup` with `RetentionDays.ONE_WEEK` and
`RemovalPolicy.DESTROY` to:
| Construct | Lambda | File |
|-----------|--------|------|
| Webapp | Handler | `cdk/lib/constructs/webapp.ts` |
| Webapp | MigrationRunner | `cdk/lib/constructs/webapp.ts` |
| AsyncJob | Handler | `cdk/lib/constructs/async-job.ts` |
CDK test snapshots updated accordingly.
## Out of scope
Lambda@Edge (SignPayload) is excluded — edge-region LogGroups cannot be
managed by CDK and will become unnecessary after #66.
Closes #1031 parent 03c5a00 commit 53877bb
File tree
4 files changed
+94
-2
lines changed- cdk
- lib/constructs
- test/__snapshots__
4 files changed
+94
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
40 | 45 | | |
41 | 46 | | |
42 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
87 | 92 | | |
88 | 93 | | |
89 | 94 | | |
| |||
154 | 159 | | |
155 | 160 | | |
156 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
157 | 166 | | |
158 | 167 | | |
159 | 168 | | |
| |||
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
809 | 809 | | |
810 | 810 | | |
811 | 811 | | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
812 | 817 | | |
813 | 818 | | |
814 | 819 | | |
| |||
843 | 848 | | |
844 | 849 | | |
845 | 850 | | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
846 | 859 | | |
847 | 860 | | |
848 | 861 | | |
| |||
3466 | 3479 | | |
3467 | 3480 | | |
3468 | 3481 | | |
| 3482 | + | |
| 3483 | + | |
| 3484 | + | |
| 3485 | + | |
| 3486 | + | |
3469 | 3487 | | |
3470 | 3488 | | |
3471 | 3489 | | |
| |||
3536 | 3554 | | |
3537 | 3555 | | |
3538 | 3556 | | |
| 3557 | + | |
| 3558 | + | |
| 3559 | + | |
| 3560 | + | |
| 3561 | + | |
| 3562 | + | |
| 3563 | + | |
| 3564 | + | |
3539 | 3565 | | |
3540 | 3566 | | |
3541 | 3567 | | |
| |||
3829 | 3855 | | |
3830 | 3856 | | |
3831 | 3857 | | |
| 3858 | + | |
| 3859 | + | |
| 3860 | + | |
| 3861 | + | |
| 3862 | + | |
3832 | 3863 | | |
3833 | 3864 | | |
3834 | 3865 | | |
| |||
3878 | 3909 | | |
3879 | 3910 | | |
3880 | 3911 | | |
| 3912 | + | |
| 3913 | + | |
| 3914 | + | |
| 3915 | + | |
| 3916 | + | |
| 3917 | + | |
| 3918 | + | |
| 3919 | + | |
3881 | 3920 | | |
3882 | 3921 | | |
3883 | 3922 | | |
| |||
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
830 | 830 | | |
831 | 831 | | |
832 | 832 | | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
833 | 838 | | |
834 | 839 | | |
835 | 840 | | |
| |||
864 | 869 | | |
865 | 870 | | |
866 | 871 | | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
867 | 880 | | |
868 | 881 | | |
869 | 882 | | |
| |||
3296 | 3309 | | |
3297 | 3310 | | |
3298 | 3311 | | |
| 3312 | + | |
| 3313 | + | |
| 3314 | + | |
| 3315 | + | |
| 3316 | + | |
3299 | 3317 | | |
3300 | 3318 | | |
3301 | 3319 | | |
| |||
3366 | 3384 | | |
3367 | 3385 | | |
3368 | 3386 | | |
| 3387 | + | |
| 3388 | + | |
| 3389 | + | |
| 3390 | + | |
| 3391 | + | |
| 3392 | + | |
| 3393 | + | |
| 3394 | + | |
3369 | 3395 | | |
3370 | 3396 | | |
3371 | 3397 | | |
| |||
3635 | 3661 | | |
3636 | 3662 | | |
3637 | 3663 | | |
| 3664 | + | |
| 3665 | + | |
| 3666 | + | |
| 3667 | + | |
| 3668 | + | |
3638 | 3669 | | |
3639 | 3670 | | |
3640 | 3671 | | |
| |||
3684 | 3715 | | |
3685 | 3716 | | |
3686 | 3717 | | |
| 3718 | + | |
| 3719 | + | |
| 3720 | + | |
| 3721 | + | |
| 3722 | + | |
| 3723 | + | |
| 3724 | + | |
| 3725 | + | |
3687 | 3726 | | |
3688 | 3727 | | |
3689 | 3728 | | |
| |||
0 commit comments