Fixed up measure_latency option in r53 health checks.
* Added ignoring of param when Type is CALCULATED * Added ForceNew param to measure_latency item in schema * Added check to test
This commit is contained in:
parent
c1bb852390
commit
ab273bb2ee
|
@ -59,6 +59,7 @@ func resourceAwsRoute53HealthCheck() *schema.Resource {
|
|||
Type: schema.TypeBool,
|
||||
Optional: true,
|
||||
Default: false,
|
||||
ForceNew: true,
|
||||
},
|
||||
"tags": tagsSchema(),
|
||||
},
|
||||
|
@ -133,8 +134,10 @@ func resourceAwsRoute53HealthCheckCreate(d *schema.ResourceData, meta interface{
|
|||
healthConfig.ResourcePath = aws.String(v.(string))
|
||||
}
|
||||
|
||||
if v, ok := d.GetOk("measure_latency"); ok {
|
||||
healthConfig.MeasureLatency = aws.Bool(v.(bool))
|
||||
if *healthConfig.Type != route53.HealthCheckTypeCalculated {
|
||||
if v, ok := d.GetOk("measure_latency"); ok {
|
||||
healthConfig.MeasureLatency = aws.Bool(v.(bool))
|
||||
}
|
||||
}
|
||||
|
||||
input := &route53.CreateHealthCheckInput{
|
||||
|
|
|
@ -20,6 +20,8 @@ func TestAccAWSRoute53HealthCheck_basic(t *testing.T) {
|
|||
Config: testAccRoute53HealthCheckConfig,
|
||||
Check: resource.ComposeTestCheckFunc(
|
||||
testAccCheckRoute53HealthCheckExists("aws_route53_health_check.foo"),
|
||||
resource.TestCheckResourceAttr(
|
||||
"aws_route53_health_check.foo", "measure_latency", "true"),
|
||||
),
|
||||
},
|
||||
resource.TestStep{
|
||||
|
|
Loading…
Reference in New Issue