hashicorp / terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
https://www.terraform.io/
Other
42.74k stars 9.56k forks source link

Not able to set caller reference in aws_route53_health_check #8679

Closed dlyubarskiy closed 8 years ago

dlyubarskiy commented 8 years ago

I have attempted to deploy a couple of Route 53 heath checks with terraform and got the following error:

I, [2016-09-06T11:00:56.629375 #4836] INFO -- : * aws_route53_health_check.healthstate.0: HealthCheckAlreadyExists: A different health check has already been created with the specified caller reference. I, [2016-09-06T11:00:56.629375 #4836] INFO -- : status code: 409

I believe the issue it that aws_route53_health_check resource does not support 'reference_name' argument like 'aws_route53_delegation_set' does. Are there any plans to add support for that argument in the future?

Thank you!

achalupa74 commented 8 years ago

+1

We are blocked by the same problem.

zhefanlin commented 8 years ago

+1 Same here. Version 0.7.0

stack72 commented 8 years ago

Hi @dlyub

Please can you post a configuration that would allow us to try and re-create this error?

Thanks

Paul

brendonmartino commented 8 years ago

+1

dlyubarskiy commented 8 years ago

Hi Paul (@stack72)

Any time you'd use aws_route53_health_check with 'count' argument you'll probably see that. Here's the way I've tried to use it

resource "aws_route53_health_check" "healthstate" {

  depends_on = [ "aws_cloudwatch_metric_alarm.statuscheck" ]
  provider = "aws.instance_provider"
  count = "${var.instance_count}"

  type = "CLOUDWATCH_METRIC"
  cloudwatch_alarm_name = "${var.aws_instance_name}${count.index + var.index_offset + 1} status"
  cloudwatch_alarm_region = "${var.region}"
  insufficient_data_health_status = "Healthy"

  tags = {
    Name = "${var.aws_instance_name}${count.index + var.index_offset + 1}_health_check"
   }
}

I actually haven't tried passing 'reference_name' to this resource since it's not present in the documentation (https://www.terraform.io/docs/providers/aws/r/route53_health_check.html). Maybe it's just a documentation issue? I did see it listed for aws_route53_delegation_set resource (https://www.terraform.io/docs/providers/aws/r/route53_delegation_set.html).

dlyubarskiy commented 8 years ago

@stack72 - Paul, you have any updates on this? Thank you!

stack72 commented 8 years ago

Hi @dlyub just submitted a PR that fixes this - apologies for the time taken here

Paul

dlyubarskiy commented 8 years ago

Thank you Paul! ( @stack72 )

ghost commented 4 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.