OperationCode / OperationCode/operationcode_infra

Describe operationcode.org DNS records in code with Terraform

未关闭
#83 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
HCL
星标
17
派生
12
PR 合并指标
30 天内没有已合并 PR

描述

Followup for #67, let's enumerate all current DNS records that are in our operationcode.org hosted zone, and put them into Terraform in dns/operationcode.org/records.tf. It's worth noting that the build will fail on these until a separate data operation is run by someone with access to import the record into the Terraform statefile.

Below is the the exported zonefile, each of these records would need to be translated to a Terraform block. The Terraform docs for the DNSimple provider are here, and it looks like this:

operationcode.org. 3600 IN NS ns1.dnsimple.com.

becomes

resource "dnsimple_record" "ns1" {
  domain = "${var.hosted-zone}"
  name = ""
  type = "NS"
  value = "ns1.dnsimple.com"
}

The quoted string after "dnsimple_record" is an identifier only, and should be styled like foo_bar.

As another example:

k8s.operationcode.org. 60 IN NS ns-170.awsdns-21.com

becomes

resource "dnsimple_record" "k8s1" {
  domain = "${var.hosted-zone}"
  name = "k8s"
  type = "NS"
  value = "ns-170.awsdns-21.com"
}

The zonefile:

$ORIGIN operationcode.org.
$TTL 1h
operationcode.org. 3600 IN SOA ns1.dnsimple.com. admin.dnsimple.com. 1437975341 86400 7200 604800 300
operationcode.org. 3600 IN NS ns1.dnsimple.com.
operationcode.org. 3600 IN NS ns2.dnsimple.com.
operationcode.org. 3600 IN NS ns3.dnsimple.com.
operationcode.org. 3600 IN NS ns4.dnsimple.com.
k8s.operationcode.org. 60 IN NS ns-170.awsdns-21.com.
k8s.operationcode.org. 60 IN NS ns-1495.awsdns-58.org.
k8s.operationcode.org. 60 IN NS ns-800.awsdns-36.net.
k8s.operationcode.org. 60 IN NS ns-1880.awsdns-43.co.uk.
operationcode.org. 3600 IN SPF v=spf1 a include:_spf.google.com include:mailgun.org ~all
operationcode.org. 3600 IN TXT "v=spf1 a include:_spf.google.com include:mailgun.org ~all"
_jabber._tcp.operationcode.org. 3600 IN SRV 5 0 5269 xmpp-server.l.google.com.
_jabber._tcp.operationcode.org. 3600 IN SRV 20 0 5269 xmpp-server1.l.google.com.
_jabber._tcp.operationcode.org. 3600 IN SRV 20 0 5269 xmpp-server2.l.google.com.
_jabber._tcp.operationcode.org. 3600 IN SRV 20 0 5269 xmpp-server3.l.google.com.
_jabber._tcp.operationcode.org. 3600 IN SRV 20 0 5269 xmpp-server4.l.google.com.
operationcode.org. 3600 IN MX 1 ASPMX.L.GOOGLE.COM.
operationcode.org. 3600 IN MX 5 ALT1.ASPMX.L.GOOGLE.COM.
operationcode.org. 3600 IN MX 5 ALT2.ASPMX.L.GOOGLE.COM.
operationcode.org. 3600 IN MX 10 ALT3.ASPMX.L.GOOGLE.COM.
operationcode.org. 3600 IN MX 10 ALT4.ASPMX.L.GOOGLE.COM.
; operationcode.org. 60 IN ALIAS ac206d147f3ed11e7a802062a4d50822-1344197385.us-east-2.elb.amazonaws.com.
operationcode.org. 60 IN TXT "ALIAS for ac206d147f3ed11e7a802062a4d50822-1344197385.us-east-2.elb.amazonaws.com"
rancher.operationcode.org. 600 IN CNAME ranchermanager.cloudapp.net.
services.operationcode.org. 60 IN A 174.138.92.215
slash-commands.operationcode.org. 60 IN CNAME services.operationcode.org.
api.operationcode.org. 3600 IN CNAME ac206d147f3ed11e7a802062a4d50822-1344197385.us-east-2.elb.amazonaws.com.
nfs.services.operationcode.org. 60 IN A 138.197.94.99
test.operationcode.org. 60 IN CNAME services.operationcode.org.
; www.operationcode.org. 60 IN ALIAS ac206d147f3ed11e7a802062a4d50822-1344197385.us-east-2.elb.amazonaws.com.
www.operationcode.org. 60 IN TXT "ALIAS for ac206d147f3ed11e7a802062a4d50822-1344197385.us-east-2.elb.amazonaws.com"
kibana.operationcode.org. 60 IN CNAME services.operationcode.org.
mautic.operationcode.org. 60 IN CNAME services.operationcode.org.
mail.notify.operationcode.org. 3600 IN CNAME u5672389.wl140.sendgrid.net.
s1._domainkey.operationcode.org. 3600 IN CNAME s1.domainkey.u5672389.wl140.sendgrid.net.
s2._domainkey.operationcode.org. 3600 IN CNAME s2.domainkey.u5672389.wl140.sendgrid.net.
o1.notify.operationcode.org. 3600 IN A 168.245.5.176
link.notify.operationcode.org. 3600 IN CNAME sendgrid.net.
5672389.operationcode.org. 3600 IN CNAME sendgrid.net.
operationcode.org. 60 IN TXT "google-site-verification=XFeRZYknCzfwk5LTAuVDKf6T99S-DGafkhOfUlFXwFI"
ci.operationcode.org. 60 IN A 198.199.76.219
frontend.operationcode.org. 60 IN A 174.138.40.238
k8s.staging.operationcode.org. 60 IN A 159.203.102.31
community.operationcode.org. 600 IN A 192.241.185.68
blog.operationcode.org. 3600 IN A 52.0.16.118
7e3872bd410d2239f5d3d1787021af41.blog.operationcode.org. 3600 IN CNAME 916a5031aa4c129bbf848fca5a85a956.e140463581cd3bc16cb371c86404ee70.comodoca.com..
_62bdef8daffb0b85a77bd7a7c4be6e36.operationcode.org. 3600 IN CNAME _b1d3619a779f40c956b5f204733bbf79.acm-validations.aws.
_13f44eba4c5bd4c605b42ea9ecd53830.www.operationcode.org. 3600 IN CNAME _9522333907f290384715e714473c1a35.acm-validations.aws.
staging.operationcode.org. 3600 IN CNAME ac206d147f3ed11e7a802062a4d50822-1344197385.us-east-2.elb.amazonaws.com.
operationcode.org. 3600 IN TXT "google-site-verification=s2E7tZyPlszu8LHIcYlRT8s6oq6hSoGQ70gMXKP08aE"
; storybook.operationcode.org. 60 IN URL https://operation-code-storybook.netlify.com/
vettec.operationcode.org. 60 IN CNAME operationcode.org.
pybot.operationcode.org. 3600 IN CNAME pyback-lb-197482116.us-east-2.elb.amazonaws.com.
_655c556b662824871fbd33ed62c1ccf4.pybot.operationcode.org. 3600 IN CNAME _9cc0d3e9dbf92408cb6386af746aac3e.ltfvzjuylp.acm-validations.aws.

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

打开 dns/operationcode.org/records.tf,并将导出的 zonefile 与 DNSimple provider resource 文档进行比较。将列出的每条记录转换为 Terraform 块,同时保留名称、类型、值和相关 TTL;当所有当前记录都已表示出来时,工作即完成,state imports 由具有 import 权限的人员另行处理。

由索引模型根据 Issue 内容生成。

评估

技术栈
terraform
领域
infrastructure
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
描述清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。