-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
49 lines (40 loc) · 808 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
terraform {
required_providers {
hetznerdns = {
source = "timohirt/hetznerdns"
version = "1.1.1"
}
}
required_version = ">= 0.14"
}
variable "hetzner_dns_api_token" {
type = string
}
provider "hetznerdns" {
apitoken = var.hetzner_dns_api_token
}
variable "dns_zone_name" {
type = string
}
data "hetznerdns_zone" "dns_zone" {
name = var.dns_zone_name
}
variable "dns_record_name" {
type = string
}
variable "dns_record_type" {
type = string
}
variable "dns_record_value" {
type = string
}
variable "dns_record_ttl" {
type = number
}
resource "hetznerdns_record" "dns_record" {
zone_id = data.hetznerdns_zone.dns_zone.id
name = var.dns_record_name
value = var.dns_record_value
type = var.dns_record_type
ttl = var.dns_record_ttl
}