Automation and setup for sites I own.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

192 行
5.4 KiB

  1. variable "cloudflare_mitchty_com_zoneid" {
  2. type = string
  3. }
  4. resource "cloudflare_record" "ns1_mitchty_com" {
  5. zone_id = var.cloudflare_mitchty_com_zoneid
  6. name = "@"
  7. value = "mitch.ns.cloudflare.com"
  8. type = "NS"
  9. }
  10. resource "cloudflare_record" "ns2_mitchty_com" {
  11. zone_id = var.cloudflare_mitchty_com_zoneid
  12. name = "@"
  13. value = "tegan.ns.cloudflare.com"
  14. type = "NS"
  15. }
  16. resource "cloudflare_record" "root_mitchty_com" {
  17. depends_on = [
  18. linode_instance.prod,
  19. cloudflare_record.ns1_mitchty_com,
  20. cloudflare_record.ns2_mitchty_com ]
  21. zone_id = var.cloudflare_mitchty_com_zoneid
  22. name = "@"
  23. value = linode_instance.prod.ip_address
  24. type = "A"
  25. ttl = local.dns_ttl
  26. }
  27. resource "cloudflare_record" "splat_mitchty_com" {
  28. depends_on = [
  29. linode_instance.prod,
  30. cloudflare_record.ns1_mitchty_com,
  31. cloudflare_record.ns2_mitchty_com ]
  32. zone_id = var.cloudflare_mitchty_com_zoneid
  33. name = "*"
  34. value = linode_instance.prod.ip_address
  35. type = "A"
  36. ttl = local.dns_ttl
  37. }
  38. # resource "cloudflare_record" "root6_mitchty_com" {
  39. # depends_on = [
  40. # linode_instance.prod,
  41. # cloudflare_record.ns1_mitchty_com,
  42. # cloudflare_record.ns2_mitchty_com ]
  43. # zone_id = var.cloudflare_mitchty_com_zoneid
  44. # name = "@"
  45. # value = local.ipv6
  46. # type = "AAAA"
  47. # ttl = local.dns_ttl
  48. # }
  49. # resource "cloudflare_record" "splat6_mitchty_com" {
  50. # depends_on = [
  51. # linode_instance.prod,
  52. # cloudflare_record.ns1_mitchty_com,
  53. # cloudflare_record.ns2_mitchty_com ]
  54. # zone_id = var.cloudflare_mitchty_com_zoneid
  55. # name = "*"
  56. # value = local.ipv6
  57. # type = "AAAA"
  58. # ttl = local.dns_ttl
  59. # proxied = true
  60. # }
  61. resource "cloudflare_record" "www_mitchty_com" {
  62. depends_on = [
  63. cloudflare_record.root_mitchty_com,
  64. cloudflare_record.splat_mitchty_com ]
  65. zone_id = var.cloudflare_mitchty_com_zoneid
  66. name = "www"
  67. value = "mitchty.com"
  68. type = "CNAME"
  69. ttl = local.dns_ttl
  70. }
  71. resource "cloudflare_record" "git_mitchty_com" {
  72. depends_on = [
  73. cloudflare_record.root_mitchty_com,
  74. cloudflare_record.splat_mitchty_com ]
  75. zone_id = var.cloudflare_mitchty_com_zoneid
  76. name = "git"
  77. value = "mitchty.com"
  78. type = "CNAME"
  79. ttl = local.dns_ttl
  80. }
  81. # MX record setup for fastmail dkim/spf on root and all subdomains
  82. resource "cloudflare_record" "mx_cname_1_mitchty_com" {
  83. depends_on = [
  84. cloudflare_record.root_mitchty_com,
  85. cloudflare_record.splat_mitchty_com ]
  86. zone_id = var.cloudflare_mitchty_com_zoneid
  87. name = "fm1._domainkey"
  88. value = "fm1.mitchty.com.dkim.fmhosted.com"
  89. type = "CNAME"
  90. ttl = local.dns_ttl
  91. }
  92. resource "cloudflare_record" "mx_cname_2_mitchty_com" {
  93. depends_on = [
  94. cloudflare_record.root_mitchty_com,
  95. cloudflare_record.splat_mitchty_com ]
  96. zone_id = var.cloudflare_mitchty_com_zoneid
  97. name = "fm2._domainkey"
  98. value = "fm2.mitchty.com.dkim.fmhosted.com"
  99. type = "CNAME"
  100. ttl = local.dns_ttl
  101. }
  102. resource "cloudflare_record" "mx_cname_3_mitchty_com" {
  103. depends_on = [
  104. cloudflare_record.root_mitchty_com,
  105. cloudflare_record.splat_mitchty_com ]
  106. zone_id = var.cloudflare_mitchty_com_zoneid
  107. name = "fm3._domainkey"
  108. value = "fm3.mitchty.com.dkim.fmhosted.com"
  109. type = "CNAME"
  110. ttl = local.dns_ttl
  111. }
  112. resource "cloudflare_record" "mx_10_root_mitchty_com" {
  113. depends_on = [
  114. cloudflare_record.root_mitchty_com,
  115. cloudflare_record.splat_mitchty_com ]
  116. zone_id = var.cloudflare_mitchty_com_zoneid
  117. name = "@"
  118. value = "in1-smtp.messagingengine.com"
  119. type = "MX"
  120. priority = "10"
  121. ttl = local.dns_ttl
  122. }
  123. resource "cloudflare_record" "mx_20_root_mitchty_com" {
  124. depends_on = [
  125. cloudflare_record.root_mitchty_com,
  126. cloudflare_record.splat_mitchty_com ]
  127. zone_id = var.cloudflare_mitchty_com_zoneid
  128. name = "@"
  129. value = "in2-smtp.messagingengine.com"
  130. type = "MX"
  131. priority = "20"
  132. ttl = local.dns_ttl
  133. }
  134. resource "cloudflare_record" "mx_10_splat_mitchty_com" {
  135. depends_on = [
  136. cloudflare_record.root_mitchty_com,
  137. cloudflare_record.splat_mitchty_com ]
  138. zone_id = var.cloudflare_mitchty_com_zoneid
  139. name = "*"
  140. value = "in1-smtp.messagingengine.com"
  141. type = "MX"
  142. priority = "10"
  143. ttl = local.dns_ttl
  144. }
  145. resource "cloudflare_record" "mx_20_splat_mitchty_com" {
  146. depends_on = [
  147. cloudflare_record.root_mitchty_com,
  148. cloudflare_record.splat_mitchty_com ]
  149. zone_id = var.cloudflare_mitchty_com_zoneid
  150. name = "*"
  151. value = "in2-smtp.messagingengine.com"
  152. type = "MX"
  153. priority = "20"
  154. ttl = local.dns_ttl
  155. }
  156. resource "cloudflare_record" "txt_mx_root_mitchty_com" {
  157. depends_on = [
  158. cloudflare_record.root_mitchty_com,
  159. cloudflare_record.splat_mitchty_com ]
  160. zone_id = var.cloudflare_mitchty_com_zoneid
  161. name = "@"
  162. value = "v=spf1 include:spf.messagingengine.com ?all"
  163. type = "TXT"
  164. ttl = local.dns_ttl
  165. }
  166. resource "cloudflare_record" "txt_mx_splat_mitchty_com" {
  167. depends_on = [
  168. cloudflare_record.root_mitchty_com,
  169. cloudflare_record.splat_mitchty_com ]
  170. zone_id = var.cloudflare_mitchty_com_zoneid
  171. name = "*"
  172. value = "v=spf1 include:spf.messagingengine.com ?all"
  173. type = "TXT"
  174. ttl = local.dns_ttl
  175. }