continue lab 2 fix webserver user_data and switch to nginx
This commit is contained in:
parent
4e0325b7cc
commit
5a4c16b8b2
7 changed files with 14 additions and 3 deletions
BIN
.DS_Store
vendored
BIN
.DS_Store
vendored
Binary file not shown.
BIN
1-getting-started/img/.DS_Store
vendored
BIN
1-getting-started/img/.DS_Store
vendored
Binary file not shown.
BIN
2-simple-example/.DS_Store
vendored
Normal file
BIN
2-simple-example/.DS_Store
vendored
Normal file
Binary file not shown.
|
@ -16,7 +16,8 @@ resource "aws_instance" "test_ami" {
|
||||||
|
|
||||||
user_data = <<-EOF
|
user_data = <<-EOF
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
sudo service apache2 start
|
sudo dnf install -y nginx
|
||||||
|
sudo systemctl start nginx
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -42,7 +43,16 @@ tofu plan
|
||||||
tofu apply
|
tofu apply
|
||||||
```
|
```
|
||||||
|
|
||||||
Answer yes
|
Answer yes at the apply prompt and you should end up with a screen like this:
|
||||||
|
|
||||||
|
![Tofu apply output](./img/lab-2-tofu-apply.png)
|
||||||
|
|
||||||
|
Embedded in there you'll see something liek this ```instance_public_ip``` thats out new output, copy the value and head to ```http://<YOUT_VALUE>/``` and you should get a very similar looking default nginx page.
|
||||||
|
|
||||||
|
![Default nginx page](./img/webpage.png)
|
||||||
|
(I'm of course in dark mode, don't worry if yours is white with black text!)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
2. Validate
|
2. Validate
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@ resource "aws_instance" "test_ami" {
|
||||||
|
|
||||||
user_data = <<-EOF
|
user_data = <<-EOF
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
sudo service apache2 start
|
sudo dnf install -y nginx
|
||||||
|
sudo systemctl start nginx
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
BIN
2-simple-example/img/lab-2-tofu-apply.png
Normal file
BIN
2-simple-example/img/lab-2-tofu-apply.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 250 KiB |
BIN
2-simple-example/img/webpage.png
Normal file
BIN
2-simple-example/img/webpage.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 241 KiB |
Loading…
Reference in a new issue