Skip to content

PeanuBudget's infrastructure. IaC deployed to Azure with Terraform and GitHub Actions

License

Notifications You must be signed in to change notification settings

GiuseppeTT/peanubudget-infrastructure

Repository files navigation

PeanuBudget: Infrastructure

Description

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.

I'm completely lost, where should I start?

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.

How to ...

... Set up the project using Dev Containers

You can quickly set up the project for development using Dev Containers by following these steps in VSCode:

  1. Open VSCode
  2. Install the Dev Containers extension
  3. Open the command palette (press F1 key), select the Git: Clone command (you may need to type it) and clone this repository https://github.com/GiuseppeTT/peanubudget-infrastructure.git
  4. Create the .env file to set up the necessary environment variables by using the .env.example file as a guide
  5. Open the command palette (press F1 key) and select the Dev 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 the Dev Containers: Rebuild Container Without Cache command from the command palette (press F1 key).

Note: You may need to install docker first.

Note: You can check more instructions on the Dev Containers documentation.

... Deploy

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.

... Perform local operations

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.

Repository structure

.
├── .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)

About

PeanuBudget's infrastructure. IaC deployed to Azure with Terraform and GitHub Actions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published