hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.82k stars 9.17k forks source link

Listener Creation is Done Twice #510

Closed hashibot closed 4 years ago

hashibot commented 7 years ago

This issue was originally opened by @vrenjith as hashicorp/terraform#11706. It was migrated here as part of the provider split. The original body of the issue is below.


Version 0.8.5

Look at these logs from terraform

2017/02/05 07:18:36 [DEBUG] plugin: terraform: Action=CreateLoadBalancer&AvailabilityZones.member.1=sc_1&Listeners.member.1.InstancePort=4646&Listeners.member.1.InstanceProtocol=http&Listeners.member.1.LoadBalancerPort=4646&Listeners.member.1.Protocol=http&Listeners.member.1.SSLCertificateId=&Listeners.member.2.InstancePort=8500&Listeners.member.2.InstanceProtocol=http&Listeners.member.2.LoadBalancerPort=8500&Listeners.member.2.Protocol=http&Listeners.member.2.SSLCertificateId=&LoadBalancerName=tt-ncv&Version=2012-06-01
2017/02/05 07:18:36 [DEBUG] plugin: terraform: -----------------------------------------------------
2017/02/05 07:18:40 [DEBUG] vertex "meta.count-boundary (count boundary fixup)", waiting for: "aws_elb.ncv"
2017/02/05 07:18:45 [DEBUG] vertex "meta.count-boundary (count boundary fixup)", waiting for: "aws_elb.ncv"
aws_elb.ncv: Still creating... (10s elapsed)
2017/02/05 07:18:50 [DEBUG] vertex "meta.count-boundary (count boundary fixup)", waiting for: "aws_elb.ncv"
2017/02/05 07:18:53 [DEBUG] plugin: terraform: aws-provider (internal) 2017/02/05 07:18:53 [DEBUG] [aws-sdk-go] DEBUG: Response elasticloadbalancing/CreateLoadBalancer Details:
2017/02/05 07:18:53 [DEBUG] plugin: terraform: ---[ RESPONSE ]--------------------------------------
2017/02/05 07:18:53 [DEBUG] plugin: terraform: HTTP/1.1 200 OK
2017/02/05 07:18:53 [DEBUG] plugin: terraform: Connection: close
2017/02/05 07:18:53 [DEBUG] plugin: terraform: Transfer-Encoding: chunked
2017/02/05 07:18:53 [DEBUG] plugin: terraform: Cache-Control: max-age=0, private, must-revalidate
2017/02/05 07:18:53 [DEBUG] plugin: terraform: Content-Security-Policy-Report-Only: default-src https: data: 'unsafe-inline' 'unsafe-eval'; frame-src https://* about: javascript:; img-src data:
2017/02/05 07:18:53 [DEBUG] plugin: terraform: Content-Type: application/xml; charset=utf-8
2017/02/05 07:18:53 [DEBUG] plugin: terraform: Date: Sun, 05 Feb 2017 01:48:53 GMT
2017/02/05 07:18:53 [DEBUG] plugin: terraform: Etag: W/"dda783174582a92b9b157efe5488b21e"
2017/02/05 07:18:53 [DEBUG] plugin: terraform: Server: nginx/1.8.0
2017/02/05 07:18:53 [DEBUG] plugin: terraform: Status: 200 OK
2017/02/05 07:18:53 [DEBUG] plugin: terraform: Strict-Transport-Security: max-age=631138519
2017/02/05 07:18:53 [DEBUG] plugin: terraform: X-Content-Type-Options: nosniff
2017/02/05 07:18:53 [DEBUG] plugin: terraform: X-Frame-Options: SAMEORIGIN
2017/02/05 07:18:53 [DEBUG] plugin: terraform: X-Powered-By: Phusion Passenger 5.0.23
2017/02/05 07:18:53 [DEBUG] plugin: terraform: X-Rack-Cache: invalidate, pass
2017/02/05 07:18:53 [DEBUG] plugin: terraform: X-Request-Id: 82f71632880041d8a5207c1048be72ddc
2017/02/05 07:18:53 [DEBUG] plugin: terraform: X-Runtime: 16.081434
2017/02/05 07:18:53 [DEBUG] plugin: terraform: X-Ua-Compatible: IE=Edge,chrome=1
2017/02/05 07:18:53 [DEBUG] plugin: terraform: X-Xss-Protection: 1; mode=block
2017/02/05 07:18:53 [DEBUG] plugin: terraform:
2017/02/05 07:18:53 [DEBUG] plugin: terraform: ec
2017/02/05 07:18:53 [DEBUG] plugin: terraform: <CreateLoadBalancerResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2012-06-01/">
2017/02/05 07:18:53 [DEBUG] plugin: terraform:   <CreateLoadBalancerResult>
2017/02/05 07:18:53 [DEBUG] plugin: terraform:     <DNSName>ip-10-173-76-108.mo.sap.corp</DNSName>
2017/02/05 07:18:53 [DEBUG] plugin: terraform:   </CreateLoadBalancerResult>
2017/02/05 07:18:53 [DEBUG] plugin: terraform: </CreateLoadBalancerResponse>
2017/02/05 07:18:53 [DEBUG] plugin: terraform:
2017/02/05 07:18:53 [DEBUG] plugin: terraform: 0
2017/02/05 07:18:53 [DEBUG] plugin: terraform:
2017/02/05 07:18:53 [DEBUG] plugin: terraform:
2017/02/05 07:18:53 [DEBUG] plugin: terraform: -----------------------------------------------------
2017/02/05 07:18:53 [DEBUG] plugin: terraform: aws-provider (internal) 2017/02/05 07:18:53 [INFO] ELB ID: tt-ncv
2017/02/05 07:18:53 [DEBUG] plugin: terraform: aws-provider (internal) 2017/02/05 07:18:53 [DEBUG] Waiting for state to become: [success]
2017/02/05 07:18:53 [DEBUG] plugin: terraform: aws-provider (internal) 2017/02/05 07:18:53 [DEBUG] ELB Create Listeners opts: {
2017/02/05 07:18:53 [DEBUG] plugin: terraform:   Listeners: [{
2017/02/05 07:18:53 [DEBUG] plugin: terraform:       InstancePort: 4646,
2017/02/05 07:18:53 [DEBUG] plugin: terraform:       InstanceProtocol: "http",
2017/02/05 07:18:53 [DEBUG] plugin: terraform:       LoadBalancerPort: 4646,
2017/02/05 07:18:53 [DEBUG] plugin: terraform:       Protocol: "http",
2017/02/05 07:18:53 [DEBUG] plugin: terraform:       SSLCertificateId: ""
2017/02/05 07:18:53 [DEBUG] plugin: terraform:     },{
2017/02/05 07:18:53 [DEBUG] plugin: terraform:       InstancePort: 8500,
2017/02/05 07:18:53 [DEBUG] plugin: terraform:       InstanceProtocol: "http",
2017/02/05 07:18:53 [DEBUG] plugin: terraform:       LoadBalancerPort: 8500,
2017/02/05 07:18:53 [DEBUG] plugin: terraform:       Protocol: "http",
2017/02/05 07:18:53 [DEBUG] plugin: terraform:       SSLCertificateId: ""
2017/02/05 07:18:53 [DEBUG] plugin: terraform:     }],
2017/02/05 07:18:53 [DEBUG] plugin: terraform:   LoadBalancerName: "tt-ncv"
2017/02/05 07:18:53 [DEBUG] plugin: terraform: }
2017/02/05 07:18:53 [DEBUG] plugin: terraform: aws-provider (internal) 2017/02/05 07:18:53 [DEBUG] [aws-sdk-go] DEBUG: Request elasticloadbalancing/CreateLoadBalancerListeners Details:
2017/02/05 07:18:53 [DEBUG] plugin: terraform: ---[ REQUEST POST-SIGN ]-----------------------------
2017/02/05 07:18:53 [DEBUG] plugin: terraform: POST / HTTP/1.1
2017/02/05 07:18:53 [DEBUG] plugin: terraform: Host: elb-us-west.api.monsoon.mo.sap.corp
2017/02/05 07:18:53 [DEBUG] plugin: terraform: User-Agent: APN/1.0 HashiCorp/1.0 Terraform/0.8.5
2017/02/05 07:18:53 [DEBUG] plugin: terraform: Content-Length: 455
2017/02/05 07:18:53 [DEBUG] plugin: terraform: Authorization: AWS4-HMAC-SHA256 Credential=STMwNjU3MDo6NjE4OTE%3D%0A/20170205/us_west/elasticloadbalancing/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date, Signature=f398526dcb21f5d75f53d96bbff29ee2f0c0932e017d51d8482672d0d3ae0206
2017/02/05 07:18:53 [DEBUG] plugin: terraform: Content-Type: application/x-www-form-urlencoded; charset=utf-8
2017/02/05 07:18:53 [DEBUG] plugin: terraform: X-Amz-Date: 20170205T014853Z
2017/02/05 07:18:53 [DEBUG] plugin: terraform: Accept-Encoding: gzip
2017/02/05 07:18:53 [DEBUG] plugin: terraform:
2017/02/05 07:18:53 [DEBUG] plugin: terraform: Action=CreateLoadBalancerListeners&Listeners.member.1.InstancePort=4646&Listeners.member.1.InstanceProtocol=http&Listeners.member.1.LoadBalancerPort=4646&Listeners.member.1.Protocol=http&Listeners.member.1.SSLCertificateId=&Listeners.member.2.InstancePort=8500&Listeners.member.2.InstanceProtocol=http&Listeners.member.2.LoadBalancerPort=8500&Listeners.member.2.Protocol=http&Listeners.member.2.SSLCertificateId=&LoadBalancerName=tt-ncv&Version=2012-06-01
2017/02/05 07:18:53 [DEBUG] plugin: terraform: -----------------------------------------------------
2017/02/05 07:18:55 [DEBUG] plugin: terraform: aws-provider (internal) 2017/02/05 07:18:55 [DEBUG] [aws-sdk-go] DEBUG: Response elasticloadbalancing/CreateLoadBalancerListeners Details:
2017/02/05 07:18:55 [DEBUG] plugin: terraform: ---[ RESPONSE ]--------------------------------------
2017/02/05 07:18:55 [DEBUG] plugin: terraform: HTTP/1.1 400 Bad Request
2017/02/05 07:18:55 [DEBUG] plugin: terraform: Connection: close
2017/02/05 07:18:55 [DEBUG] plugin: terraform: Transfer-Encoding: chunked
2017/02/05 07:18:55 [DEBUG] plugin: terraform: Cache-Control: no-cache
2017/02/05 07:18:55 [DEBUG] plugin: terraform: Content-Security-Policy-Report-Only: default-src https: data: 'unsafe-inline' 'unsafe-eval'; frame-src https://* about: javascript:; img-src data:
2017/02/05 07:18:55 [DEBUG] plugin: terraform: Content-Type: application/xml; charset=utf-8
2017/02/05 07:18:55 [DEBUG] plugin: terraform: Date: Sun, 05 Feb 2017 01:48:54 GMT
2017/02/05 07:18:55 [DEBUG] plugin: terraform: Server: nginx/1.8.0
2017/02/05 07:18:55 [DEBUG] plugin: terraform: Status: 400 Bad Request
2017/02/05 07:18:55 [DEBUG] plugin: terraform: Strict-Transport-Security: max-age=631138519
2017/02/05 07:18:55 [DEBUG] plugin: terraform: X-Content-Type-Options: nosniff
2017/02/05 07:18:55 [DEBUG] plugin: terraform: X-Frame-Options: SAMEORIGIN
2017/02/05 07:18:55 [DEBUG] plugin: terraform: X-Powered-By: Phusion Passenger 5.0.23
2017/02/05 07:18:55 [DEBUG] plugin: terraform: X-Rack-Cache: invalidate, pass
2017/02/05 07:18:55 [DEBUG] plugin: terraform: X-Request-Id: 88f091d70d1f7fa6f1097980139c4495f
2017/02/05 07:18:55 [DEBUG] plugin: terraform: X-Runtime: 0.296991
2017/02/05 07:18:55 [DEBUG] plugin: terraform: X-Ua-Compatible: IE=Edge,chrome=1
2017/02/05 07:18:55 [DEBUG] plugin: terraform: X-Xss-Protection: 1; mode=block
2017/02/05 07:18:55 [DEBUG] plugin: terraform:
2017/02/05 07:18:55 [DEBUG] plugin: terraform: d2
2017/02/05 07:18:55 [DEBUG] plugin: terraform: <?xml version="1.0" encoding="UTF-8"?><Response><RequestID>88f091d70d1f7fa6f1097980139c4495f</RequestID><Errors><Error><Code>BadRequest</Code><Message>Object already exists</Message></Error></Errors></Response>

main.tf

resource "aws_elb" "server" {

  name = "${var.cluster_name}-ncv"
  availability_zones = ["${var.availability_zone}"]

  listener {
    instance_port = 8500
    instance_protocol = "http"
    lb_port = 8500
    lb_protocol = "http"
  }

  listener {
    instance_port = 4646
    instance_protocol = "http"
    lb_port = 4646
    lb_protocol = "http"
  }

  instances = ["${aws_instance.server.*.id}"]

  tags {
    Name = "${var.cluster_name}-ncv"
  }
}
github-actions[bot] commented 4 years ago

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!