Skip to content

Commit

Permalink
feat(admin): set cron secret to env (#3669)
Browse files Browse the repository at this point in the history
  • Loading branch information
ykzts authored Nov 16, 2023
1 parent c85a2c2 commit 87eb0ab
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"ghcr.io/devcontainers/features/terraform:1": {
"terragrunt": "none",
"tflint": "none",
"version": "1.3.9"
"version": "1.6.4"
}
},
"forwardPorts": [3000, 4000],
Expand Down
20 changes: 20 additions & 0 deletions terraform/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions terraform/project.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ resource "vercel_project_domain" "ink" {
team_id = vercel_project.this.team_id
}

resource "random_password" "cron_secret" {
length = 16
special = false
}

resource "vercel_project_environment_variable" "base_url" {
key = "NEXT_PUBLIC_BASE_URL"
project_id = vercel_project.this.id
Expand Down Expand Up @@ -133,3 +138,11 @@ resource "vercel_project_environment_variable" "admin_upstash_redis_rest_url_dev
team_id = vercel_project.admin.team_id
value = var.upstash_redis_rest_url_dev
}

resource "vercel_project_environment_variable" "cron_secret" {
key = "CRON_SECRET"
project_id = vercel_project.admin.id
target = ["production"]
team_id = vercel_project.admin.team_id
value = random_password.cron_secret.result
}
5 changes: 5 additions & 0 deletions terraform/versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
terraform {
required_providers {
random = {
source = "hashicorp/random"
version = "3.5.1"
}

vercel = {
source = "vercel/vercel"
version = "0.16.0"
Expand Down

0 comments on commit 87eb0ab

Please sign in to comment.