Update Cloudflare DNS configuration with explicit zone ID
Replace sensitive zone_id variable with hardcoded value and update DNS record configuration to use cloudflare_dns_record resource type. Disable proxying and set explicit TTL for better control over DNS propagation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
1b1d7896e6
commit
1921aad1bd
1 changed files with 16 additions and 15 deletions
|
|
@ -1,6 +1,5 @@
|
||||||
# Required environment variables:
|
# Required environment variables:
|
||||||
# CLOUDFLARE_API_TOKEN - API token with "Edit zone DNS" permissions
|
# CLOUDFLARE_API_TOKEN - API token with "Edit zone DNS" permissions
|
||||||
# TF_VAR_zone_id - Zone ID for baduhai.dev (find in Cloudflare dashboard)
|
|
||||||
# AWS_ACCESS_KEY_ID - Cloudflare R2 access key for state storage
|
# AWS_ACCESS_KEY_ID - Cloudflare R2 access key for state storage
|
||||||
# AWS_SECRET_ACCESS_KEY - Cloudflare R2 secret key for state storage
|
# AWS_SECRET_ACCESS_KEY - Cloudflare R2 secret key for state storage
|
||||||
|
|
||||||
|
|
@ -26,9 +25,8 @@
|
||||||
|
|
||||||
variable = {
|
variable = {
|
||||||
zone_id = {
|
zone_id = {
|
||||||
description = "Cloudflare zone ID for baduhai.dev";
|
default = "c63a8332fdddc4a8e5612ddc54557044";
|
||||||
type = "string";
|
type = "string";
|
||||||
sensitive = true;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -50,28 +48,31 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
resource = {
|
resource = {
|
||||||
cloudflare_record.root = {
|
cloudflare_dns_record.root = {
|
||||||
zone_id = config.variable.zone_id;
|
zone_id = config.variable.zone_id.default;
|
||||||
name = "@";
|
name = "@";
|
||||||
type = "A";
|
type = "A";
|
||||||
content = config.data.terraform_remote_state.trantor "outputs.instance_public_ip.value";
|
content = config.data.terraform_remote_state.trantor "outputs.instance_public_ip";
|
||||||
proxied = true;
|
proxied = false;
|
||||||
|
ttl = 3600;
|
||||||
};
|
};
|
||||||
|
|
||||||
cloudflare_record.www = {
|
cloudflare_dns_record.www = {
|
||||||
zone_id = config.variable.zone_id;
|
zone_id = config.variable.zone_id.default;
|
||||||
name = "www";
|
name = "www";
|
||||||
type = "A";
|
type = "A";
|
||||||
content = config.data.terraform_remote_state.trantor "outputs.instance_public_ip.value";
|
content = config.data.terraform_remote_state.trantor "outputs.instance_public_ip";
|
||||||
proxied = true;
|
proxied = false;
|
||||||
|
ttl = 3600;
|
||||||
};
|
};
|
||||||
|
|
||||||
cloudflare_record.wildcard = {
|
cloudflare_dns_record.wildcard = {
|
||||||
zone_id = config.variable.zone_id;
|
zone_id = config.variable.zone_id.default;
|
||||||
name = "*";
|
name = "*";
|
||||||
type = "A";
|
type = "A";
|
||||||
content = config.data.terraform_remote_state.trantor "outputs.instance_public_ip.value";
|
content = config.data.terraform_remote_state.trantor "outputs.instance_public_ip";
|
||||||
proxied = true;
|
proxied = false;
|
||||||
|
ttl = 3600;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue