-
Notifications
You must be signed in to change notification settings - Fork 9.9k
Description
Terraform Version
Terraform v0.9.0
same with v0.8.8
Affected Resource(s)
Please list the resources as a list, for example:
- ns1_record
Terraform Configuration Files
provider "ns1" {
apikey = "${var.ns1_apikey}"
}
resource "ns1_zone" "tld" {
zone = "terraform.example"
}
resource "ns1_record" "txt" {
zone = "${ns1_zone.tld.zone}"
domain = "${ns1_zone.tld.zone}"
type = "TXT"
ttl = 86400
use_client_subnet = "true"
answers = {
answer = "v=DKIM1; k=rsa; p=XXXXXXXX"
}
}
resource "ns1_record" "spf" {
zone = "${ns1_zone.tld.zone}"
domain = "${ns1_zone.tld.zone}"
type = "SPF"
ttl = 86400
use_client_subnet = "true"
answers = {
answer = "v=DKIM1; k=rsa; p=XXXXXXXX"
}
}
Debug Output
https://gist.github.com/parky/f2f1c9491c459ff87c168441e843d5d9
Panic Output
No
Expected Behavior
host -t SPF terraform.example dns1.p03.nsone.net
should return
terraform.example has SPF record "v=DKIM1; k=rsa; p=XXXXXXXX"
Actual Behavior
host -t SPF terraform.example dns1.p03.nsone.net
returns
terraform.example has SPF record "v=DKIM1;" "k=rsa;" "p=XXXXXXXX"
Steps to Reproduce
terraform apply
host -t SPF terraform.example dns1.p03.nsone.net
Important Factoids
Inserting SPF record lead to response where there are quotes between all parts delimited with space instead of an answer which has quotes only at the beginning and at the end.
This does not happen when the record is inserted via the web interface or via the API like:
curl -X PUT -H 'X-NSONE-Key: myNS1apikey' -d '{"zone":"terraform.example", "domain":"terraform.example", "type":"SPF", "answers":[{"answer":["v=DKIM1; k=rsa; p=XXXXXXXX"]}]}' https://api.nsone.net/v1/zones/terraform.example/terraform.example/SPF