NOTE: This project uses VSCode Remote Containers for local development.
The initial docker build
takes 105.5s. Once launched run the command task
to start terratest
for all three parts of the code challenge; which takes 1m35s.
One of our applications runs on a server with no fixed public IP. Instead, we have a pipeline that runs terraform periodically and updates the firewall rule, allowing access from this application to our primary cloud provider.
Code a terraform module that outputs the outgoing IP address of this server.
Note: You can assume that the pipeline runs from the same server as the application.
http://ipv4.icanhazip.com is a simple site run by CloudFlare that returns your external IP address and nothing else. I used the http data source to make an HTTP GET request to the given URL and exports information about the response. Nothing else was needed to complete this task. I didn't move the code into a module because it would have just been a variable, the data source, and the output.
Create a terraform module that echos a string. Your main file should call the module twice with the following input, respectively:
- "I am message one"
- "I am message two"
Execute the modules in order and print the messages with double quotes.
Write any terraform code with a minimum of three resources including tests.
-
resource "docker_container" "echo"
-
resource "local_file" "hello_world"
-
resource "docker_container" "database"
-
resource "postgresql_database" "test"
sd