chore: pre-migration snapshot
Layer0, MCP servers, Terraform consolidation
This commit is contained in:
@@ -20,10 +20,7 @@ data "cloudflare_accounts" "main" {
|
||||
}
|
||||
|
||||
locals {
|
||||
# Use account ID from data source if available, otherwise use variable
|
||||
account_id = (
|
||||
var.cloudflare_account_name != "" && length(data.cloudflare_accounts.main) > 0 && length(data.cloudflare_accounts.main[0].accounts) > 0
|
||||
? data.cloudflare_accounts.main[0].accounts[0].id
|
||||
: var.cloudflare_account_id
|
||||
)
|
||||
# Use account ID from data source if available, otherwise fall back to variable.
|
||||
# `try()` avoids invalid index errors when the data source count is 0 or no accounts match.
|
||||
account_id = try(data.cloudflare_accounts.main[0].accounts[0].id, var.cloudflare_account_id)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user