https://github.com/libre-devops/terraform-digitalocean-dns-records
A module used to update DNS records on digitalocean 💧
https://github.com/libre-devops/terraform-digitalocean-dns-records
Last synced: 2 months ago
JSON representation
A module used to update DNS records on digitalocean 💧
- Host: GitHub
- URL: https://github.com/libre-devops/terraform-digitalocean-dns-records
- Owner: libre-devops
- License: mit
- Created: 2024-03-05T22:44:31.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-05T23:18:26.000Z (about 1 year ago)
- Last Synced: 2024-12-26T16:11:58.502Z (4 months ago)
- Language: PowerShell
- Size: 22.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
```hcl
data "digitalocean_domain" "domain" {
for_each = { for k, v in var.records : k => v if v.create_domain == false }
name = each.value.domain_name
}resource "digitalocean_domain" "domain" {
for_each = { for k, v in var.records : k => v if v.create_domain == true }
name = each.value.domain_name
ip_address = each.value.domain_ip_address
}resource "digitalocean_record" "records" {
for_each = { for k, v in var.records : k => v }
domain = each.value.create_domain == true ? digitalocean_domain.domain[each.key].id : data.digitalocean_domain.domain[each.key].id
type = each.value.record_type
name = each.value.record_name
value = each.value.record_value
port = each.value.port
priority = each.value.priority
weight = each.value.weight
ttl = each.value.ttl
flags = each.value.flags
tag = each.value.tag
}
```
## RequirementsNo requirements.
## Providers
| Name | Version |
|------|---------|
| [digitalocean](#provider\_digitalocean) | n/a |## Modules
No modules.
## Resources
| Name | Type |
|------|------|
| [digitalocean_domain.domain](https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs/resources/domain) | resource |
| [digitalocean_record.records](https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs/resources/record) | resource |
| [digitalocean_domain.domain](https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs/data-sources/domain) | data source |## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [records](#input\_records) | The records to be created for digital ocean |list(object({| n/a | yes |
create_domain = optional(bool, false)
record_type = string
record_name = string
record_value = string
domain_name = string
domain_ip_address = optional(string)
port = optional(number)
priority = optional(number)
weight = optional(number)
ttl = optional(number)
flags = optional(number)
tag = optional(string)
}))## Outputs
| Name | Description |
|------|-------------|
| [domain\_id](#output\_domain\_id) | The domain id if created |
| [domain\_ttl](#output\_domain\_ttl) | The domain ttl if created |
| [domain\_urn](#output\_domain\_urn) | The domain urn if created |
| [record\_fqdn](#output\_record\_fqdn) | FQDN of each record |
| [record\_id](#output\_record\_id) | Id of each record |