mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-26 16:36:26 -06:00
Merge pull request #3196 from elblivion/allow-r53-zero-weighted-rr-creation
provider/aws: Allow weight = 0 in Route53 records
This commit is contained in:
commit
f90d2442ca
@ -407,12 +407,9 @@ func resourceAwsRoute53RecordBuildSet(d *schema.ResourceData, zoneName string) (
|
|||||||
rec.HealthCheckId = aws.String(v.(string))
|
rec.HealthCheckId = aws.String(v.(string))
|
||||||
}
|
}
|
||||||
|
|
||||||
if v, ok := d.GetOk("weight"); ok {
|
|
||||||
rec.Weight = aws.Int64(int64(v.(int)))
|
|
||||||
}
|
|
||||||
|
|
||||||
if v, ok := d.GetOk("set_identifier"); ok {
|
if v, ok := d.GetOk("set_identifier"); ok {
|
||||||
rec.SetIdentifier = aws.String(v.(string))
|
rec.SetIdentifier = aws.String(v.(string))
|
||||||
|
rec.Weight = aws.Int64(int64(d.Get("weight").(int)))
|
||||||
}
|
}
|
||||||
|
|
||||||
return rec, nil
|
return rec, nil
|
||||||
|
@ -133,6 +133,7 @@ func TestAccAWSRoute53Record_weighted(t *testing.T) {
|
|||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckRoute53RecordExists("aws_route53_record.www-dev"),
|
testAccCheckRoute53RecordExists("aws_route53_record.www-dev"),
|
||||||
testAccCheckRoute53RecordExists("aws_route53_record.www-live"),
|
testAccCheckRoute53RecordExists("aws_route53_record.www-live"),
|
||||||
|
testAccCheckRoute53RecordExists("aws_route53_record.www-off"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -407,6 +408,16 @@ resource "aws_route53_record" "www-live" {
|
|||||||
set_identifier = "live"
|
set_identifier = "live"
|
||||||
records = ["dev.notexample.com"]
|
records = ["dev.notexample.com"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "aws_route53_record" "www-off" {
|
||||||
|
zone_id = "${aws_route53_zone.main.zone_id}"
|
||||||
|
name = "www"
|
||||||
|
type = "CNAME"
|
||||||
|
ttl = "5"
|
||||||
|
weight = 0
|
||||||
|
set_identifier = "off"
|
||||||
|
records = ["dev.notexample.com"]
|
||||||
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
const testAccRoute53ElbAliasRecord = `
|
const testAccRoute53ElbAliasRecord = `
|
||||||
|
Loading…
Reference in New Issue
Block a user