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

question regarding error #6

Open
cordoval opened this issue Dec 3, 2015 · 8 comments
Open

question regarding error #6

cordoval opened this issue Dec 3, 2015 · 8 comments

Comments

@cordoval
Copy link

cordoval commented Dec 3, 2015

i am trying the project and getting this error after adapting it a little bit:

* aws_elb.s3-registry-elb: [WARN] Error looking up ELB Security Group ID: No security groups found for name amazon-elb-sg and vpc id

do you know why this is happening?

I assign on the elb the security groups with:

security_groups = ["${aws_security_group.ecs.id}"]

but still getting the same error and on the state security_groups.# = 0 and it has the source_security_group = amazon-elb-sg

@chuckyz
Copy link

chuckyz commented Dec 3, 2015

Try using assigning a name to resource "aws_security_group" "ecs" and doing the following:

security_groups = ["${aws_security_group.ecs.name}"]

I've had a similar problem where trying to grab an id for a preexisting SG created in the GUI (or a default pre-created one). Using id fails for some reason, and I had to use the name instead.

Also if you're putting it in a vpc make sure you're setting vpc_id.

@cordoval
Copy link
Author

cordoval commented Dec 3, 2015

same error for the .id -> .name change

The security_group.ecs has a vpc_id = "${module.vpc.vpc_id}" set

@cordoval
Copy link
Author

cordoval commented Dec 4, 2015

I think all of this is related to hashicorp/terraform#2420

@cordoval
Copy link
Author

cordoval commented Dec 4, 2015

now i see that i am running into exactly this error on this line:

https://github.com/hashicorp/terraform/pull/3780/files#diff-5bd4dc8acacea4f1ba989ac829a90894R658

@mmerchant
Copy link

You can try adding in a sleep such that the resource exists as others have suggested as work-around:

provisioner "local-exec" { command = "sleep 10" }

@pporada-gl
Copy link

@mmerchant Where would you add that local-exec provisioner? Would it be in the launch config for an ASG or in an EC2 instance declaration? Would you be able to provide a better example please?

@mmerchant
Copy link

@pporada-gl I have an IAM role that I create for ECS and in the IAM instance profile (aws_iam_instance_profile) I call when creating the role:
provisioner "local-exec" { command = "sleep 10" }

@pporada-gl
Copy link

@mmerchant That makes a lot of sense! Thanks for the tip!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants