This repository holds the source code for the infrastructure of the PeanuBudget project. The infrastructure is hosted at Azure and is set up with Terraform. Its deployment is done with GitHub Actions.
You can find more information about the PeanuBudget project at the index repository.
If you want to understand the infrastructure, check the main.tf
file.
If you want to understand the big picture, check the index repository.
If you are new to Terraform, the Get Started - Azure tutorial from HashiCorp (be sure to read the Store Remote State section) is a great place to start.
You can quickly set up the project for development using Dev Containers by following these steps in VSCode:
- Open VSCode
- Install the Dev Containers extension
- Open the command palette (press
F1
key), select theGit: Clone
command (you may need to type it) and clone this repository https://github.com/GiuseppeTT/peanubudget-infrastructure.git - Create the
.env
file to set up the necessary environment variables by using the.env.example
file as a guide - Open the command palette (press
F1
key) and select theDev Containers: Open Folder in Container...
command (you may need to type it)
After that, the project will be all set up.
Note: You may need to rebuild the container if you ever change the
.env
file again. You can do that with theDev Containers: Rebuild Container Without Cache
command from the command palette (pressF1
key).
Note: You may need to install docker first.
Note: You can check more instructions on the Dev Containers documentation.
There is no manual deployment. The infrastructure is automatically deployed to Azure every time a commit is pushed to main (only possible through pull requests). You can check the CI/CD workflow responsible for that at the .github/workflows/deploy-infrastructure.yaml
file.
There is a list of useful scripts for local operations in the script/
folder. Assuming you are at the project root folder, you can execute the script script-name.sh
with the . script/script-name.sh
command. Just make sure to read the script file before executing it as there may be additional instructions.
.
├── .devcontainer/ # Devcontainer's files
├── .git/ # [Git ignored] [Auto generated] Git's files
├── .github/workflows/ # GitHub Actions's workflows (CI / CD)
├── .terraform/ # [Git ignored] [Auto generated] Terraform's files
├── script/ # Useful scripts for performing local operations
├── .env # [Git ignored] List of environment variables (mainly for secrets)
├── .env.example # Example of .env file
├── .gitignore # List of files ignored by git
├── .terraform.lock.hcl # [Auto generated] Terraform's lock file
├── LICENSE # Project's license
├── README.md # This very file you are reading
├── main.tf # Terraform's code for cloud resources
├── outputs.tf # Terraform's code for outputs
├── terraform.tf # Terraform's code for configurations (providers and workspace)
└── variables.tf # Terraform's code for variables (input)