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,9 +134,11 @@ func resourceAwsRoute53HealthCheckCreate(d *schema.ResourceData, meta interface{
|
|||
healthConfig.ResourcePath = aws.String(v.(string))
|
||||
}
|
||||
|
||||
if *healthConfig.Type != route53.HealthCheckTypeCalculated {
|
||||
if v, ok := d.GetOk("measure_latency"); ok {
|
||||
healthConfig.MeasureLatency = aws.Bool(v.(bool))
|
||||
}
|
||||
}
|
||||
|
||||
input := &route53.CreateHealthCheckInput{
|
||||
CallerReference: aws.String(time.Now().Format(time.RFC3339Nano)),
|
||||
|
|
|
@ -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