Skip to content

Commit 8462de1

Browse files
committed
fetch zone id using data source
1 parent 96d81be commit 8462de1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

scaletest/terraform/action/cf_dns.tf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
data "cloudflare_zone" "domain" {
2+
name = var.cloudflare_domain
3+
}
4+
15
resource "cloudflare_record" "coder" {
26
for_each = local.deployments
3-
zone_id = var.cloudflare_zone_id
7+
zone_id = data.cloudflare_zone.domain.id
48
name = "${each.value.subdomain}.${var.cloudflare_domain}"
59
content = google_compute_address.coder[each.key].address
610
type = "A"
@@ -9,7 +13,7 @@ resource "cloudflare_record" "coder" {
913

1014
resource "cloudflare_record" "coder_wildcard" {
1115
for_each = local.deployments
12-
zone_id = var.cloudflare_zone_id
16+
zone_id = data.cloudflare_zone.domain.id
1317
name = each.value.wildcard_subdomain
1418
content = cloudflare_record.coder[each.key].name
1519
type = "CNAME"

scaletest/terraform/action/vars.tf

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
variable "name" {
2-
description = "The name all resources will be prefixed with."
2+
description = "The name all resources will be prefixed with. Must be one of alpha, bravo, or charlie."
33
validation {
44
condition = contains(["alpha", "bravo", "charlie"], var.name)
55
error_message = "Name must be one of alpha, bravo, or charlie."
@@ -28,10 +28,6 @@ variable "cloudflare_domain" {
2828
description = "Cloudflare coder domain."
2929
}
3030

31-
variable "cloudflare_zone_id" {
32-
description = "Cloudflare zone ID."
33-
}
34-
3531
// Coder
3632
variable "coder_license" {
3733
description = "Coder license key."

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy