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:
AJ Bahnken 2015-10-29 12:50:02 -07:00
parent c1bb852390
commit ab273bb2ee
2 changed files with 7 additions and 2 deletions

View File

@ -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{

View File

@ -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{