lowercase everything in r53 names
This commit is contained in:
parent
d798042475
commit
953f38c534
|
@ -196,12 +196,13 @@ func resourceAwsRoute53RecordCreate(d *schema.ResourceData, meta interface{}) er
|
|||
// Generate an ID
|
||||
vars := []string{
|
||||
zone,
|
||||
d.Get("name").(string),
|
||||
strings.ToLower(d.Get("name").(string)),
|
||||
d.Get("type").(string),
|
||||
}
|
||||
if v, ok := d.GetOk("set_identifier"); ok {
|
||||
vars = append(vars, v.(string))
|
||||
}
|
||||
|
||||
d.SetId(strings.Join(vars, "_"))
|
||||
|
||||
// Wait until we are done
|
||||
|
@ -447,7 +448,7 @@ func cleanRecordName(name string) string {
|
|||
// If it does not, add the zone name to form a fully qualified name
|
||||
// and keep AWS happy.
|
||||
func expandRecordName(name, zone string) string {
|
||||
rn := strings.TrimSuffix(name, ".")
|
||||
rn := strings.ToLower(strings.TrimSuffix(name, "."))
|
||||
zone = strings.TrimSuffix(zone, ".")
|
||||
if !strings.HasSuffix(rn, zone) {
|
||||
rn = strings.Join([]string{name, zone}, ".")
|
||||
|
|
|
@ -291,7 +291,7 @@ func testAccCheckRoute53RecordExists(n string) resource.TestCheckFunc {
|
|||
// rec := resp.ResourceRecordSets[0]
|
||||
for _, rec := range resp.ResourceRecordSets {
|
||||
recName := cleanRecordName(*rec.Name)
|
||||
if FQDN(recName) == FQDN(en) && *rec.Type == rType {
|
||||
if FQDN(strings.ToLower(recName)) == FQDN(strings.ToLower(en)) && *rec.Type == rType {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
@ -306,7 +306,7 @@ resource "aws_route53_zone" "main" {
|
|||
|
||||
resource "aws_route53_record" "default" {
|
||||
zone_id = "${aws_route53_zone.main.zone_id}"
|
||||
name = "www.notexample.com"
|
||||
name = "www.NOTexamplE.com"
|
||||
type = "A"
|
||||
ttl = "30"
|
||||
records = ["127.0.0.1", "127.0.0.27"]
|
||||
|
|
Loading…
Reference in New Issue