Skip to content

Add lifecycle rules to S3 buckets - #271

Merged
liam-lloyd merged 1 commit into
mainfrom
per-10906_add_lifecycle_rules_to_s3
Nov 18, 2026
Merged

liam-lloyd merged 1 commit into
mainfrom
per-10906_add_lifecycle_rules_to_s3

Conversation

@liam-lloyd

Copy link
Copy Markdown
Member

Currently, we have a lot of noncurrent copies of files stored in S3, which cost money and aren't used for anything. This commit adds lifecycle rules to our S3 buckets that will delete old versions of files after 30 days, as well as cleaning up incomplete multi-part uploads.

@liam-lloyd
liam-lloyd force-pushed the per-10906_add_lifecycle_rules_to_s3 branch from a956631 to 6556b55 Compare November 18, 2026 17:42

@cecilia-donnelly cecilia-donnelly left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to start with doing this on dev only so we can see what happens, and then follow up next week on prod. I know we said "AWS probably does the right thing" re too many requests to the bucket, etc, but it would give me some peace of mind to check.

Comment thread instances/production/s3.tf Outdated
alias = "us_east_1"
profile = "default"
region = "us-east-1"
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this because we already had a us west 2 provider?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes (and the prod replica bucket is the only thing this terraform workspace manages that's in us-east-1)

@liam-lloyd
liam-lloyd force-pushed the per-10906_add_lifecycle_rules_to_s3 branch from 6556b55 to d2838b2 Compare November 18, 2026 17:51
Currently, we have a lot of noncurrent copies of files stored in S3,
which cost money and aren't used for anything. This commit adds
lifecycle rules to our S3 buckets that will delete old versions of files
after 30 days, as well as cleaning up incomplete multi-part uploads.

PER-10906
@liam-lloyd
liam-lloyd force-pushed the per-10906_add_lifecycle_rules_to_s3 branch from d2838b2 to 172fff1 Compare November 18, 2026 17:56
@liam-lloyd

Copy link
Copy Markdown
Member Author

I'd like to start with doing this on dev only so we can see what happens, and then follow up next week on prod. I know we said "AWS probably does the right thing" re too many requests to the bucket, etc, but it would give me some peace of mind to check.

That makes sense; it's tricky to test these changes thoroughly prior to merging a PR. I've removed the prod changes.

@cecilia-donnelly cecilia-donnelly left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for removing prod!

Comment thread instances/dev/s3.tf
days_after_initiation = 7
}
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we expire noncurrent objects on local too? (Sorry, didn't notice this the first go-around.)

@liam-lloyd liam-lloyd Nov 18, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left out the noncurrent rule on local and staging because they don't have versioning turned on at all, and thus it wouldn't do anything (though I can see an argument for including it just for consistency)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah that makes sense. Thanks!

Comment thread instances/staging/s3.tf
days_after_initiation = 7
}
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would think we'd want the same noncurrent rule on staging, even though it's not currently (ha) a big factor there.

@liam-lloyd
liam-lloyd merged commit d805938 into main Nov 18, 2026
4 checks passed
@liam-lloyd
liam-lloyd deleted the per-10906_add_lifecycle_rules_to_s3 branch November 18, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants