Skip to content

Commit

Permalink
feat: first version (#1)
Browse files Browse the repository at this point in the history
* first commit

* add tests and docs

* add changelog
  • Loading branch information
gareda authored May 4, 2024
1 parent 6868b42 commit 5ec3a79
Show file tree
Hide file tree
Showing 31 changed files with 1,665 additions and 52 deletions.
72 changes: 72 additions & 0 deletions .config/.terraform-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
formatter: markdown

settings:
anchor: false
html: false

sort:
enabled: false

output:
file: README.md
mode: inject

content: |
{{ define "table" }}{{ printf "The `%s` supports the following:" .Resource }}
| Name | Description | Type | Default | Required |
| ---- | ------------| :--: | :-----: | :------: |
{{ range include .File | fromJson -}}
{{ print "|" (.Name | sanitizeMarkdownTbl) -}}
{{ $z := len .Support }}{{ if ne $z 0 }}{{ print "|" .Description -}}
{{ range $x, $y := .Support -}}
{{ if eq $x (sub $z 1) }}{{ printf " `%s`." . -}}
{{ else if eq $x (sub $z 2) }}{{ printf " `%s` and" . -}}
{{ else }}{{ printf " `%s`," . }}{{ end -}}
{{ end -}}
{{ else }}{{ print "|" .Description }}{{ end -}}
{{ printf "|`%s`" .Type -}}
{{ if eq .Default "n/a" }}{{ print "|" (.Default | sanitizeMarkdownTbl) -}}
{{ else }}{{ printf "|`%s`" .Default }}{{ end -}}
{{ printf "|%s|" .Required }}
{{ end }}{{ end -}}
## Parameters
The following parameters are supported:
| Name | Description | Type | Default | Required |
| ---- | ----------- | :--: | :-----: | :------: |
{{ range .Module.Inputs -}}
{{ print "|" (.Name | sanitizeMarkdownTbl) -}}
{{ print "|" (toString .Description | sanitizeMarkdownTbl) -}}
{{ if eq (substr 0 13 (toString .Type)) "list(object({" }}{{ print "|`list(object({}))`" -}}
{{ else if eq (substr 0 8 (toString .Type)) "object({" }}{{ print "|`object({})`" -}}
{{ else }}{{ printf "|`%s`" .Type }}{{ end -}}
{{ if eq .GetValue "" }}{{ print "|" (.GetValue | sanitizeMarkdownTbl) -}}
{{ else }}{{ printf "|`%s`" .GetValue }}{{ end -}}
{{ print "|" (ternary .Required "yes" "no") "|" }}
{{ end }}{{ printf "\n" -}}
{{ template "table" dict "Resource" "soa_record" "File" ".config/soa_record_parameters.json" }}
{{ template "table" dict "Resource" "a_records" "File" ".config/a_record_parameters.json" }}
{{ template "table" dict "Resource" "aaaa_records" "File" ".config/aaaa_record_parameters.json" }}
{{ template "table" dict "Resource" "cname_records" "File" ".config/cname_record_parameters.json" }}
{{ template "table" dict "Resource" "mx_records" "File" ".config/mx_record_parameters.json" }}
{{ template "table" dict "Resource" "mx_records.records" "File" ".config/mx_records_record_parameters.json" }}
{{ template "table" dict "Resource" "ptr_records" "File" ".config/ptr_record_parameters.json" }}
{{ template "table" dict "Resource" "srv_records" "File" ".config/srv_record_parameters.json" }}
{{ template "table" dict "Resource" "srv_records.records" "File" ".config/srv_records_record_parameters.json" }}
{{ template "table" dict "Resource" "txt_records" "File" ".config/txt_record_parameters.json" }}{{ printf "\n" -}}
## Outputs
The following outputs are exported:
| Name | Description | Sensitive |
| ---- | ------------| :-------: |
{{ range .Module.Outputs -}}
{{ print "|" .Name -}}
{{ print "|" (toString .Description | sanitizeMarkdownTbl) -}}
{{ print "|" (ternary .Sensitive "yes" "no") "|" }}
{{ end -}}
34 changes: 34 additions & 0 deletions .config/a_record_parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[
{
"Name": "name",
"Description": "The name of the DNS A Record.",
"Type": "string",
"Default": "n/a",
"Required": "yes",
"Support": []
},
{
"Name": "tags",
"Description": "A mapping of tags to assign to the resource.",
"Type": "map(string)",
"Default": "null",
"Required": "no",
"Support": []
},
{
"Name": "ttl",
"Description": "The Time To Live (TTL) of the DNS record in seconds.",
"Type": "number",
"Default": "n/a",
"Required": "yes",
"Support": []
},
{
"Name": "records",
"Description": "List of IPv4 Addresses.",
"Type": "list(string)",
"Default": "n/a",
"Required": "yes",
"Support": []
}
]
34 changes: 34 additions & 0 deletions .config/aaaa_record_parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[
{
"Name": "name",
"Description": "The name of the DNS AAAA Record.",
"Type": "string",
"Default": "n/a",
"Required": "yes",
"Support": []
},
{
"Name": "tags",
"Description": "A mapping of tags to assign to the resource.",
"Type": "map(string)",
"Default": "null",
"Required": "no",
"Support": []
},
{
"Name": "ttl",
"Description": "The Time To Live (TTL) of the DNS record in seconds.",
"Type": "number",
"Default": "n/a",
"Required": "yes",
"Support": []
},
{
"Name": "records",
"Description": "List of IPv6 Addresses.",
"Type": "list(string)",
"Default": "n/a",
"Required": "yes",
"Support": []
}
]
34 changes: 34 additions & 0 deletions .config/cname_record_parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[
{
"Name": "name",
"Description": "The name of the DNS CNAME Record.",
"Type": "string",
"Default": "n/a",
"Required": "yes",
"Support": []
},
{
"Name": "tags",
"Description": "A mapping of tags to assign to the resource.",
"Type": "map(string)",
"Default": "null",
"Required": "no",
"Support": []
},
{
"Name": "ttl",
"Description": "The Time To Live (TTL) of the DNS record in seconds.",
"Type": "number",
"Default": "n/a",
"Required": "yes",
"Support": []
},
{
"Name": "record",
"Description": "The target of the CNAME.",
"Type": "string",
"Default": "n/a",
"Required": "yes",
"Support": []
}
]
34 changes: 34 additions & 0 deletions .config/mx_record_parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[
{
"Name": "name",
"Description": "The name of the DNS MX Record.",
"Type": "string",
"Default": "n/a",
"Required": "yes",
"Support": []
},
{
"Name": "tags",
"Description": "A mapping of tags to assign to the resource.",
"Type": "map(string)",
"Default": "null",
"Required": "no",
"Support": []
},
{
"Name": "ttl",
"Description": "The Time To Live (TTL) of the DNS record in seconds.",
"Type": "number",
"Default": "n/a",
"Required": "yes",
"Support": []
},
{
"Name": "records",
"Description": "A list of values that make up the MX record.",
"Type": "list(object({})",
"Default": "n/a",
"Required": "yes",
"Support": []
}
]
18 changes: 18 additions & 0 deletions .config/mx_records_record_parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
{
"Name": "preference",
"Description": "String representing the preference value of the MX records. Records with lower preference value take priority.",
"Type": "number",
"Default": "n/a",
"Required": "yes",
"Support": []
},
{
"Name": "exchange",
"Description": "The mail server responsible for the domain covered by the MX record.",
"Type": "string",
"Default": "n/a",
"Required": "no",
"Support": []
}
]
34 changes: 34 additions & 0 deletions .config/ptr_record_parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[
{
"Name": "name",
"Description": "The name of the DNS PTR Record.",
"Type": "string",
"Default": "n/a",
"Required": "yes",
"Support": []
},
{
"Name": "tags",
"Description": "A mapping of tags to assign to the resource.",
"Type": "map(string)",
"Default": "null",
"Required": "no",
"Support": []
},
{
"Name": "ttl",
"Description": "The Time To Live (TTL) of the DNS record in seconds.",
"Type": "number",
"Default": "n/a",
"Required": "yes",
"Support": []
},
{
"Name": "records",
"Description": "List of Fully Qualified Domain Names.",
"Type": "list(string)",
"Default": "n/a",
"Required": "yes",
"Support": []
}
]
58 changes: 58 additions & 0 deletions .config/soa_record_parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
[
{
"Name": "email",
"Description": "The email contact for the SOA record.",
"Type": "string",
"Default": "n/a",
"Required": "yes",
"Support": []
},
{
"Name": "tags",
"Description": "A mapping of tags to assign to the Record Set.",
"Type": "map(string)",
"Default": "null",
"Required": "no",
"Support": []
},
{
"Name": "expire_time",
"Description": "The expire time for the SOA record.",
"Type": "number",
"Default": "null",
"Required": "no",
"Support": []
},
{
"Name": "minimum_ttl",
"Description": "The minimum Time To Live for the SOA record. By convention, it is used to determine the negative caching duration.",
"Type": "number",
"Default": "null",
"Required": "no",
"Support": []
},
{
"Name": "refresh_time",
"Description": "The refresh time for the SOA record.",
"Type": "number",
"Default": "null",
"Required": "no",
"Support": []
},
{
"Name": "retry_time",
"Description": "The retry time for the SOA record.",
"Type": "number",
"Default": "null",
"Required": "no",
"Support": []
},
{
"Name": "ttl",
"Description": "The Time To Live of the SOA Record in seconds.",
"Type": "number",
"Default": "null",
"Required": "no",
"Support": []
}
]
34 changes: 34 additions & 0 deletions .config/srv_record_parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[
{
"Name": "name",
"Description": "The name of the DNS SRV Record.",
"Type": "string",
"Default": "n/a",
"Required": "yes",
"Support": []
},
{
"Name": "tags",
"Description": "A mapping of tags to assign to the resource.",
"Type": "map(string)",
"Default": "null",
"Required": "no",
"Support": []
},
{
"Name": "ttl",
"Description": "The Time To Live (TTL) of the DNS record in seconds.",
"Type": "number",
"Default": "n/a",
"Required": "yes",
"Support": []
},
{
"Name": "records",
"Description": "A list of values that make up the SRV record.",
"Type": "list(object({})",
"Default": "n/a",
"Required": "yes",
"Support": []
}
]
34 changes: 34 additions & 0 deletions .config/srv_records_record_parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[
{
"Name": "priority",
"Description": "Priority of the SRV record.",
"Type": "number",
"Default": "n/a",
"Required": "yes",
"Support": []
},
{
"Name": "weight",
"Description": "Weight of the SRV record.",
"Type": "number",
"Default": "n/a",
"Required": "no",
"Support": []
},
{
"Name": "port",
"Description": "Port the service is listening on.",
"Type": "number",
"Default": "n/a",
"Required": "yes",
"Support": []
},
{
"Name": "target",
"Description": "FQDN of the service.",
"Type": "string",
"Default": "n/a",
"Required": "yes",
"Support": []
}
]
Loading

0 comments on commit 5ec3a79

Please sign in to comment.