Closed oerp-odoo closed 6 years ago
As workaround it is possible to use vpc_security_group_ids
inside aws_instance
resource. This way it does assign group before trying to run remote-exec
.
Hi again, @oerp-odoo 👋
Using vpc_security_group_ids
is not a workaround, but a requirement if you're looking to assign a VPC security group when creating an EC2 instance. As it looks like you discovered, this should properly setup security group access before provisioners run against the EC2 instance.
Above though you are mentioning that you are trying to get provisioners working through an EIP as well. This process is more complicated, but has to be generally achieved with the provisioners being on the EIP resource or a separate null_resource
. The documentation page there gives an example directly with aws_instance
that you would need to adjust to point to something like the aws_eip_association
resource instead. Hopefully this gets you started.
Please note: We use GitHub issues in this repository for tracking AWS provider bugs and enhancements rather than for questions. While we may be able to help with some simple problems here it's generally better to use one of the community forums where there are far more people ready to help; the GitHub issues here are generally monitored only by our few maintainers who are generally only working on provider bugs or enhancements. Given this, I'm going to close this issue out, but please let us know if there is some bug with any of the AWS resources. 👍
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!
Community Note
Terraform Version
Terraform v0.11.8
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
Should create EC2 instance, associate EIP and associate security group.
Actual Behavior
Steps to Reproduce
terraform apply
Important Factoids
It seems there is already similar issue created last year (look at references). Is there a workaround at least then?.. Cause I don't know now how to run
provisioner file
andprovisioner remote-exec
when terraform tries to apply those commands before actually setting security group and elastic IP.References
Looks like this issue is similar to mine, though I do get a bit different error: https://github.com/terraform-providers/terraform-provider-aws/issues/1712
0000