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
Unable to output public_ip value when requesting spot instances #4313
Comments
@m8051 what was your workaround? I'm having the same issue as you except I'm trying to get the output of the private_ip addresses from the aws_spot_instance_request. |
Hi @ikekim, I'm not sure my workaround will be of any help to you as I use a collection of Linux scripts to build a pipeline using packer + terraform + serverspec, but I'm happy to share it. What I did was, output the instance_id through terraform and assign its value to a variable: target=$(terraform output instance_id) Then I used the AWS CLI to find out what the public_ip of that instance_id is by running: target_ip=$(aws ec2 describe-instances --instance-ids ${target} | grep PublicIpAddress | grep -o -P "\d+\.\d+\.\d+\.\d+" | grep -v '^10\.') I suppose you could also use the local-exec provisioner. Hope this helps ... |
If you want to do this within terraform you can do it like this.
and then output it referencing the module
You can get more information out of the spot instance request with jq but instance id is the most important. |
This is an old issue, but it is marked as a regression so I am working on trying to clear this up. Is anyone still running into this issue? I'm unable to reproduce this issue with the latest provider for both Terraform 0.11 and Terraform 0.12. I'm going to close this issue as it doesn't appear to be reproducible. If anyone is experiencing this issue using the latest version(s) of the provider please open a new issue with the details requested in the Bug Template |
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! |
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
terraform output
Actual Behavior
terraform output
Steps to Reproduce
terraform output
References
Context
This used to work well until last Friday 20th of April when I noticed our RSpec tests were failing due to a non public_ip output when using baked Amis and Spots.
I know some attributes are expected to change over time and I already implemented a workaround but I wanted to give you a heads up so you guys are aware of this just in case there's something new on the AWS side ...
The text was updated successfully, but these errors were encountered: