Project: Create a Project That is Aware of the Workspace
In this lesson, we will try to implement a Terraform project that is aware of the workspace.
We'll cover the following
Problem Statement#
Part #1#
Create a project that is aware of the workspace. The project creates an sqs queue and s3 bucket and uses the workspace name in the name of the sqs queue and s3 bucket. Apply your project to a workspace called dev
and a workspace called prod
.
Part #2#
Remove the sqs queue and apply it to both workspaces so that the queue is removed.
Part #3#
Destroy all of the resources you have created.
Running the project#
Click the RUN button to run the following command.
terraform init
I leave it up to you to figure out other commands you would need to run the project.
Coding exercise#
Try to solve the above problem. If you can’t solve it, don’t give up. In the next lesson, we will discuss the solution in detail.
Good Luck!
Part #1#
Try to implement project part 1 here:
/
- main.tf
Part #2#
Try to implement the project part 2 here:
/
- main.tf
Part #3#
For project part 3, you only have to run the commands to destroy all the resources you have created.