Skip to content

Commit

Permalink
feat: coverframe records
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Gleich <git@mattglei.ch>
  • Loading branch information
gleich committed Feb 7, 2025
1 parent 04cb53a commit 3ac03ca
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 15 deletions.
10 changes: 2 additions & 8 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,8 @@ provider "digitalocean" {
token = var.digitalocean_api_token
}

module "mattgleich_dns" {
source = "./modules/cloudflare"
zone_id = "b580b7998284e872e4e6d3a33aac00a8"
}

module "mattgleich_com_dns" {
source = "./modules/cloudflare"
zone_id = "0321ab5a32959ab44e02ba727bae8106"
module "cloudflare" {
source = "./modules/cloudflare"
}

module "vercel" {
Expand Down
8 changes: 8 additions & 0 deletions modules/cloudflare/coverframe/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
terraform {
required_providers {
cloudflare = {
source = "cloudflare/cloudflare"
version = "~> 4.0"
}
}
}
15 changes: 15 additions & 0 deletions modules/cloudflare/coverframe/records.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
resource "cloudflare_record" "root" {
zone_id = var.zone_id
type = "CNAME"
name = "@"
content = var.addresses.vercel
ttl = 1
}

resource "cloudflare_record" "www" {
zone_id = var.zone_id
type = "CNAME"
name = "www"
content = var.addresses.vercel
ttl = 1
}
12 changes: 12 additions & 0 deletions modules/cloudflare/coverframe/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
variable "zone_id" {
type = string
}

variable "addresses" {
default = {
vercel = "cname.vercel-dns.com."
}
type = object({
vercel = string
})
}
25 changes: 18 additions & 7 deletions modules/cloudflare/main.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
terraform {
required_providers {
cloudflare = {
source = "cloudflare/cloudflare"
version = "~> 4.0"
}
}
module "mattgleich_dns" {
source = "./personal"
zone_id = "b580b7998284e872e4e6d3a33aac00a8"
}

module "mattgleich_com_dns" {
source = "./personal"
zone_id = "b580b7998284e872e4e6d3a33aac00a8"
}

module "coverframe_dev_dns" {
source = "./coverframe"
zone_id = "273ba96ea009fff540bf1809d0cfdda8"
}

module "coverframe_dev_dns" {
source = "./coverframe"
zone_id = "bacf7227ff8abdbb5e44310d60fd6ffe"
}
8 changes: 8 additions & 0 deletions modules/cloudflare/personal/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
terraform {
required_providers {
cloudflare = {
source = "cloudflare/cloudflare"
version = "~> 4.0"
}
}
}
File renamed without changes.
File renamed without changes.

0 comments on commit 3ac03ca

Please # to comment.