Skip to content

Commit a7b71a3

Browse files
razor-xseambot
andauthored
Add R2 bucket (#337)
Co-authored-by: Seam Bot <[email protected]>
1 parent 3e4c116 commit a7b71a3

File tree

10 files changed

+112
-0
lines changed

10 files changed

+112
-0
lines changed

.github/workflows/format.yml

+5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ jobs:
3131
uses: ./.github/actions/setup
3232
- name: Format
3333
run: npm run format
34+
- name: Setup Terraform
35+
uses: hashicorp/setup-terraform@v2
36+
- name: Format terraform
37+
working-directory: terraform
38+
run: terraform fmt -write -recursive
3439
- name: Commit
3540
uses: stefanzweifel/git-auto-commit-action@v4
3641
if: always()

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ The following repository secrets must be set on [GitHub Actions]:
424424

425425
The following repository variables must be set on [GitHub Actions]:
426426

427+
- `CLOUDFLARE_R2_BUCKET`: The Cloudflare R2 bucket name.
427428
- `VERCEL_TEAM_ID`: The Vercel team id.
428429
- `STORYBOOK_SEAM_ENDPOINT`: The Seam endpoint to use with Storybook.
429430
- `STORYBOOK_SEAM_PUBLISHABLE_KEY`: The Seam publishable key to use with Storybook.

terraform/.gitignore

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Parts of this file were adapted from
2+
# GitHub’s collection of .gitignore file templates
3+
# which are Copyright (c) 2023 GitHub, Inc.
4+
# and released under the MIT License.
5+
# For more details, visit the project page:
6+
# https://github.com/github/gitignore
7+
8+
# Local .terraform directories
9+
**/.terraform/*
10+
11+
# .tfstate files
12+
*.tfstate
13+
*.tfstate.*
14+
15+
# Crash log files
16+
crash.log
17+
crash.*.log
18+
19+
# Exclude all .tfvars files, which are likely to contain sensitive data, such as
20+
# password, private keys, and other secrets. These should not be part of version
21+
# control as they are data points which are potentially sensitive and subject
22+
# to change depending on the environment.
23+
# *.tfvars
24+
# *.tfvars.json
25+
26+
# Ignore override files as they are usually used to override resources locally and so
27+
# are not checked in
28+
override.tf
29+
override.tf.json
30+
*_override.tf
31+
*_override.tf.json
32+
33+
# Include override files you do wish to add to version control using negated pattern
34+
# !example_override.tf
35+
36+
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
37+
# example: *tfplan*
38+
39+
# Ignore CLI configuration files
40+
.terraformrc
41+
terraform.rc

terraform/.terraform.lock.hcl

+25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

terraform/default.tfvars

Whitespace-only changes.

terraform/main.tf

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
locals {
2+
org = "seamapi"
3+
repo = "react"
4+
id = 0
5+
}
6+
7+
resource "cloudflare_r2_bucket" "main" {
8+
account_id = var.cloudflare_account_id
9+
name = join("-", [local.org, local.repo, local.id])
10+
location = "wnam"
11+
}

terraform/outputs.tf

Whitespace-only changes.

terraform/provider.tf

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
terraform {
2+
cloud {
3+
hostname = "app.terraform.io"
4+
organization = "seamapi"
5+
workspaces {
6+
name = "react"
7+
}
8+
}
9+
}
10+
11+
provider "cloudflare" {
12+
api_token = var.cloudflare_api_token
13+
}

terraform/variables.tf

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
variable "cloudflare_api_token" {
2+
type = string
3+
}
4+
5+
variable "cloudflare_account_id" {
6+
type = string
7+
}

terraform/versions.tf

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
terraform {
2+
required_version = "~> 1.5"
3+
required_providers {
4+
cloudflare = {
5+
source = "cloudflare/cloudflare"
6+
version = "~> 4.11.0"
7+
}
8+
}
9+
}

0 commit comments

Comments
 (0)