blake-mealey / mantle

An infrastructure-as-code and deployment tool for Roblox.
https://mantledeploy.vercel.app/
MIT License
85 stars 11 forks source link

Add information about Cloudflare R2 State storage #194

Closed Etheroit closed 1 year ago

Etheroit commented 1 year ago

What type of feature request is this?

Describe your problem Mantle supports uploading state to AWS S3. Cloudflare R2 is S3 alternative that has quite big monthly quota of free operations (https://developers.cloudflare.com/r2/pricing/#r2-pricing) and is really easy to set up w/o any code modifications.

Since it's compatible with AWS S3 API, all you have to do to use R2 is configure Mantle in the following way.

state:
  remote:
    region:
      custom:
        name: (% R2 REGION NAME eg 'eeur' %)
        endpoint: (% S3 API [see: Select R2 Bucket > Settings > Bucket Details > S3 API] %)
    bucket: (% R2 BUCKET NAME  [see: Select R2 Bucket > Settings > Bucket Details > Name] %)
    key: (% PROJECT NAME %)

As env variables (MANTLE_AWS_ACCESS_KEY_ID, MANTLE_AWS_SECRET_ACCESS_KEY) you should set credentials of R2 API Token (has to be created separately from the bucket [see: Overview > Manage R2 API Tokens])

Describe the solution you'd like Add an information to docs that it's possible to use Cloudflare R2.

blake-mealey commented 1 year ago

Nice! I've updated the docs to include this information: https://mantledeploy.vercel.app/docs/remote-state/cloudflare-r2

Etheroit commented 1 year ago

@blake-mealey Thanks for adding! Please note though that Cloudflare R2 doesn't support object locking, so if you're considering adding the support for it in the future, do you think it'd be possible to add an option to disable it?

blake-mealey commented 1 year ago

That's good to keep in mind