Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consul_service and consul_agent_service errantly subtitute localhost as provider address #13481

Closed
cfromm1911 opened this issue Apr 7, 2017 · 1 comment

Comments

@cfromm1911
Copy link

cfromm1911 commented Apr 7, 2017

Seems quite bizarre, but I get the same response out of both consul_service and consul_agent_service fairly often, but random.

�[0m�[1mmodule.events_qa.asg.asg_lb.consul_service.app: Creating...�[0m
  address:    "" => "demo-test1.wvhtest.com"
  name:       "" => "demo"
  port:       "" => "443"
  service_id: "" => "<computed>"�[0m
�[31mError applying plan:

1 error(s) occurred:

* module.events_qa.module.asg.module.asg_lb.consul_service.app: 1 error(s) occurred:

* consul_service.app: Failed to register service 'demo' with Consul agent: Put http://127.0.0.1:8500/v1/agent/service/register?dc=test1: dial tcp 127.0.0.1:8500: getsockopt: connection refused

Config is nothing special, except that I'm feeding consul address from a seperate consul datasource. But where would it get 127.0.0.1 from? That's definitely not in my datasource. When it doesn't do this, it appears to work, but it does this so often I cant tell.

provider "consul" {
    address = "elb-docker-consul-util.wvendpoints.com:8500"
        datacenter = "USE1"
}
provider "consul" {
    alias = "localvpc"
    address = "${data.consul_keys.vpc.var.dns_lb_ip}:8500"
    datacenter = "${var.environment}"
}
resource "consul_service" "app" {
  provider = "consul.localvpc"
  address = "${aws_route53_record.alb.fqdn}"
  name    = "${var.project}"
  port    = "${element(split("|", element(split(":", data.consul_keys.alb.var.app_lb_map), 1)),0)}"
}
@ghost
Copy link

ghost commented Apr 9, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants