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,
|
Type: schema.TypeBool,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
Default: false,
|
Default: false,
|
||||||
|
ForceNew: true,
|
||||||
},
|
},
|
||||||
"tags": tagsSchema(),
|
"tags": tagsSchema(),
|
||||||
},
|
},
|
||||||
|
@ -133,8 +134,10 @@ func resourceAwsRoute53HealthCheckCreate(d *schema.ResourceData, meta interface{
|
||||||
healthConfig.ResourcePath = aws.String(v.(string))
|
healthConfig.ResourcePath = aws.String(v.(string))
|
||||||
}
|
}
|
||||||
|
|
||||||
if v, ok := d.GetOk("measure_latency"); ok {
|
if *healthConfig.Type != route53.HealthCheckTypeCalculated {
|
||||||
healthConfig.MeasureLatency = aws.Bool(v.(bool))
|
if v, ok := d.GetOk("measure_latency"); ok {
|
||||||
|
healthConfig.MeasureLatency = aws.Bool(v.(bool))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
input := &route53.CreateHealthCheckInput{
|
input := &route53.CreateHealthCheckInput{
|
||||||
|
|
|
@ -20,6 +20,8 @@ func TestAccAWSRoute53HealthCheck_basic(t *testing.T) {
|
||||||
Config: testAccRoute53HealthCheckConfig,
|
Config: testAccRoute53HealthCheckConfig,
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckRoute53HealthCheckExists("aws_route53_health_check.foo"),
|
testAccCheckRoute53HealthCheckExists("aws_route53_health_check.foo"),
|
||||||
|
resource.TestCheckResourceAttr(
|
||||||
|
"aws_route53_health_check.foo", "measure_latency", "true"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
resource.TestStep{
|
||||||
|
|
Loading…
Reference in New Issue