diff --git a/4-gitlab-ci/README.md b/4-gitlab-ci/README.md index 6243d98..acd6d0b 100644 --- a/4-gitlab-ci/README.md +++ b/4-gitlab-ci/README.md @@ -1,6 +1,6 @@ ## Introduction -First off this lab is entirely optional and also not for the faint hearted. Gitlab CI is currently introducing components to replace the current templates and openTofu will be updated to that as soon as they are supported in self managed runners. If you're not comfortable experimenting and cleaning things up in AWS manually **don't do this lab**. For this I recommend using the terraform template. +First off this lab is entirely optional and also not for the faint hearted. Gitlab CI is currently introducing components to replace the current templates and openTofu will be updated to that as soon as they are supported in self managed runners. If you're not comfortable experimenting and cleaning things up in AWS manually **don't do this lab**. For this lab I recommend using the terraform template, I'll update this once the tofu templates are ready. First things first lets get some things setup. Make sure you have a free account on [https://gitlab.com](https://gitlab.com) @@ -106,6 +106,15 @@ deploy: action: start ``` -6. Click commit and your build _should_ begin +6. You'll need to manually click deploy in the pipeline view +7. Click commit and your build _should_ begin -![Build Pipeline](./img/build.png) \ No newline at end of file +![Build Pipeline](./img/build.png) + +#### Clean Up + +You should be able to run the following from your local directory as the state file is configured to be remote. + +```bash +tofu destroy +``` \ No newline at end of file diff --git a/5-estimating-costs/README.md b/5-estimating-costs/README.md deleted file mode 100644 index b1bba07..0000000 --- a/5-estimating-costs/README.md +++ /dev/null @@ -1,3 +0,0 @@ -https://www.infracost.io/docs/ - - diff --git a/README.md b/README.md index 0356f30..023053b 100644 --- a/README.md +++ b/README.md @@ -1 +1,36 @@ -Terraform and Tofu Labs for AWS \ No newline at end of file +![Terraform/OpenTofu Labs](./img/terraform-tofu-labs.png) + +## Terraform and OpenTofu Labs for AWS + +Welcome to the Terraform/Tofu labs for AWS. This set of labs aims to teach you the basics of terraform/tofu, to get you started on your journey. It focuses on deploying resources to AWS (Amazon Web Services) and keeps costs at a minimum. + +> [!Note] +> Don't forget to do the clean up steps after the labs to shut down the infrastructure. + +#### Requirements +- You'll need an AWS account from [https://aws.amazon.com](https://aws.amazon.com) +- If you want to do lab 4 you'll need an account at [https://gitlab.com](https://gitlab.com) + +It's recommended that you are familiar with the linux command line and bash, however you can just copy and past from the tutorials + +### Labs + +- [Lab 1](./1-getting-started/README.md) - Will get you setup with the tooling and show you the basic commands +- [Lab 2](./2-simple-example/README.md) - Will introduce you to variables +- [Lab 3](./3-remote-states/README.md) - Will help you create and setup remote states using dynamoDB and S3 +- [Lab 4](./4-gitlab-ci/README.md) - Will walk you through setting up a Gitlab CI/CD pipeline with Terraform (tofu coming soon) + +### Links + +- [Terraform](https://terraform.io) +- [OpenTofu](https://opentofu.org/) + +### Trouble Shooting + +#### No Space left on device +If you experience and issue like below on your CloudShell you'll need to delete any **unused** ```terraform.tfstate``` and ```terraform.tfstate.backup``` in previous directories. + +![no space left on disk](./img/no-space.png) + +> [!Note] +> Make sure you have run terraform destroy before deleting on-disk state files, otherwise you'll need to manually delete resources in the AWS console to avoid charges! \ No newline at end of file diff --git a/img/terraform-tofu-labs.png b/img/terraform-tofu-labs.png new file mode 100644 index 0000000..b871dd8 Binary files /dev/null and b/img/terraform-tofu-labs.png differ