Skip to content

Commit ed16ebc

Browse files
committed
Upgrade Cloudflare Terraform provider to v5
1 parent bda6a6a commit ed16ebc

3 files changed

Lines changed: 27 additions & 46 deletions

File tree

terraform/.terraform.lock.hcl

Lines changed: 11 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

terraform/main.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ terraform {
1717
source = "heroku/heroku"
1818
}
1919
cloudflare = {
20-
source = "cloudflare/cloudflare"
21-
version = "4.52.7"
20+
source = "cloudflare/cloudflare"
2221
}
2322
}
2423
}

terraform/www.tf

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,39 @@ locals {
44
}
55
}
66

7-
data "cloudflare_accounts" "this" {
8-
name = "Kitware"
7+
data "cloudflare_account" "this" {
8+
# Kitware
9+
account_id = "b7ba799b50a979650d3362e965257042"
910
}
1011

1112
resource "cloudflare_pages_project" "www" {
12-
account_id = data.cloudflare_accounts.this.accounts[0].id
13+
account_id = data.cloudflare_account.this.id
1314
name = "bats-ai"
1415
production_branch = "main"
1516

16-
source {
17+
source = {
1718
type = "github"
18-
config {
19+
config = {
1920
production_branch = "main"
2021
owner = "Kitware"
2122
repo_name = "batai"
23+
path_includes = ["client/*"]
2224
}
2325
}
2426

25-
build_config {
27+
build_config = {
2628
build_caching = true
2729
root_dir = "client"
2830
build_command = "npm run build"
2931
destination_dir = "dist"
3032
}
3133

32-
deployment_configs {
33-
preview {
34-
environment_variables = local.www_env_vars
34+
deployment_configs = {
35+
preview = {
36+
env_vars = local.www_env_vars
3537
}
36-
production {
37-
environment_variables = merge(
38+
production = {
39+
env_vars = merge(
3840
local.www_env_vars,
3941
{
4042
VITE_SENTRY_DSN = "https://a224627951abd0f0606d8578cacef5d6@o267860.ingest.us.sentry.io/4510829950730240"
@@ -48,9 +50,9 @@ resource "cloudflare_pages_project" "www" {
4850
}
4951

5052
resource "cloudflare_pages_domain" "www" {
51-
account_id = data.cloudflare_accounts.this.accounts[0].id
53+
account_id = data.cloudflare_account.this.id
5254
project_name = cloudflare_pages_project.www.name
53-
domain = aws_route53_record.www.fqdn
55+
name = aws_route53_record.www.fqdn
5456
}
5557

5658
resource "aws_route53_record" "www" {

0 commit comments

Comments
 (0)