provider/aws: Fix issue with Route53 and TXT records

This commit is contained in:
Clint Shryock 2015-03-16 15:36:18 -05:00
parent f4808b1ea7
commit 346ff12bc5
1 changed files with 8 additions and 1 deletions

View File

@ -261,8 +261,15 @@ func resourceAwsRoute53RecordBuildSet(d *schema.ResourceData) (*route53.Resource
recs := d.Get("records").(*schema.Set).List() recs := d.Get("records").(*schema.Set).List()
records := make([]route53.ResourceRecord, 0, len(recs)) records := make([]route53.ResourceRecord, 0, len(recs))
typeStr := d.Get("type").(string)
for _, r := range recs { for _, r := range recs {
records = append(records, route53.ResourceRecord{Value: aws.String(r.(string))}) switch typeStr {
case "TXT":
str := fmt.Sprintf("\"%s\"", r.(string))
records = append(records, route53.ResourceRecord{Value: aws.String(str)})
default:
records = append(records, route53.ResourceRecord{Value: aws.String(r.(string))})
}
} }
rec := &route53.ResourceRecordSet{ rec := &route53.ResourceRecordSet{