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

IAM ELB dependency on IAM certificate does not exist when modules are used #48

Closed
hashibot opened this issue Jun 13, 2017 · 6 comments
Closed
Labels
bug Addresses a defect in current functionality. service/iam Issues and PRs that pertain to the iam service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.

Comments

@hashibot
Copy link

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


When an ELB resource is using a IAM certificate created in another module, the dependency is not created. This means that terraform apply will often fail due to ordering issues.

Below is a picture of the graph:

test

@hashibot hashibot added the bug Addresses a defect in current functionality. label Jun 13, 2017
@hashibot
Copy link
Author

This comment was originally opened by @jen20 as hashicorp/terraform#3891 (comment). It was migrated here as part of the provider split. The original comment is below.


Hi @stevendborrelli! Can you post the relevant snippet of the configuration that generated this graph? If the certificate is referenced via a module variable the dependency should be generated correctly, and if not that's a bug.

@hashibot
Copy link
Author

This comment was originally opened by @stevendborrelli as hashicorp/terraform#3891 (comment). It was migrated here as part of the provider split. The original comment is below.


Cert is created like this:

module "ssl-cert" {
  source = "./modules/iam_cert"
  cert_name = "test-cert"
  cert_body = "cert.txt"
  cert_chain = "chain.txt"
  cert_private_key = "private.txt"
  cert_iam_path = "test-cert/"   
}

It is referenced in the ecs task definition like:

module "web-ecs-app" {
  source = "./modules/ecs-app"
  ...
  container_port = 8080
  elb_internal = true
  lb_port = 443
  lb_protocol = "https"
  ssl_certificate_id = "${module.ssl-cert.arn}"

}

The elb resource is:

resource "aws_elb" "elb" {
  name = "${var.name}-${var.environment}-${var.appname}"
  internal = "${var.elb_internal}"
  subnets = [ "${split(",", var.subnets)}" ]
  cross_zone_load_balancing = true

  security_groups = [ "${split(",", var.security_groups)}" ]

  listener {
    instance_port = "${var.container_port}"
    instance_protocol = "${var.instance_protocol}"
    lb_port = "${var.lb_port}" 
    lb_protocol = "${var.lb_protocol}"
    ssl_certificate_id = "${var.ssl_certificate_id}"
  }

  tags {
    Name = "${var.name}-${var.environment}-${var.appname}"
  }
}

@hashibot
Copy link
Author

This comment was originally opened by @catsby as hashicorp/terraform#3891 (comment). It was migrated here as part of the provider split. The original comment is below.


hashicorp/terraform#3898 is a patch that will retry ELB creation if it fails due to an SSL Cert not being found. That may help here, though I don't know about the actually dependency and ordering with respect to the graph

@hashibot
Copy link
Author

This comment was originally opened by @catsby as hashicorp/terraform#3891 (comment). It was migrated here as part of the provider split. The original comment is below.


#3898 has been merged, but this may be a core thing. Re-labling for @phinze or @jen20 to take a dive

@github-actions
Copy link

github-actions bot commented Apr 6, 2020

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!

@github-actions github-actions bot added the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Apr 6, 2020
@github-actions github-actions bot closed this as completed May 6, 2020
@ghost
Copy link

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

@ghost ghost locked and limited conversation to collaborators Jun 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/iam Issues and PRs that pertain to the iam service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.
Projects
None yet
Development

No branches or pull requests

2 participants