Closed G0d3r closed 1 year ago
To make sure I understand:
apply
to deploy an EC2 instance that says the text "Hello_World" via User Data and it worked.apply
, but this time, it didn't work?If so, did you set user_data_replace_on_change = true
in the aws_instance
resource as instructed in the book?
Sure, now it works! I couldn't find that in the book. Thank you for your help!
No problem!
Hello everyone! I have a question regarding this code. I fixed my last issue about running the EC2 and hello world string but when I want to change a small piece of code e.g form "Hello_World" to "Hello_World_1" then I don't have access for some reason to the instance for the printed public address. It looks like I make a change with the string as I wrote above I use terraform apply command and then when I see a newly created address I don't have access to that even if I do the same steps. I use the command: curl:8080
Even when I open my running updated EC2 instance and when I try to use a new IP address with the:8080 it also does not work.
It looks like I have to create a new instance from the very beginning e.g copy the same code and try to run a new instance. Then it works but any updates have a negative impact on that and cause it to stop running.
Do you have any ideas about what's going on?