Model/infrastructure/terraform
2023-07-05 14:57:50 +01:00
..
dev.tfvars first commit of the infrastructure repo, setting up 2023-07-05 14:57:50 +01:00
main.tf first commit of the infrastructure repo, setting up 2023-07-05 14:57:50 +01:00
README.md first commit of the infrastructure repo, setting up 2023-07-05 14:57:50 +01:00
secrets.tf first commit of the infrastructure repo, setting up 2023-07-05 14:57:50 +01:00
variables.tf first commit of the infrastructure repo, setting up 2023-07-05 14:57:50 +01:00

Infrastructure Terraform Repository

This repository manages the permanent infrastructure behind the assessment model. Key components to this include

  • Database
  • Blob storage (s3 buckets)

Terraform AWS Deployment

This project uses Terraform to create infrastructure in AWS. This README covers the steps necessary to deploy the resources.

Prerequisites

  • AWS CLI v2 installed and configured with profiles
  • Terraform v1.2.0 or higher

Deploying

The deployment process can be broken down into the following steps:

  1. Initialization: This downloads the necessary provider plugins for Terraform.
terraform init
  1. Planning: This step creates an execution plan, showing what changes Terraform will make to reach the desired state.
terraform plan -var-file=dev.tfvars

Note: replace dev.tfvars with your appropriate variables file. For a production deployment, this would be the prod.tfvars file.

  1. Apply: This step applies the desired changes to reach the desired infrastructure state.
terraform apply -var-file=dev.tfvars

Note: replace dev.tfvars with your appropriate variables file.

AWS Profiles

This project uses AWS profiles for managing different environments. Ensure you have your profiles set up in your AWS credentials file (~/.aws/credentials). Here is a sample:

[DevAdmin]
aws_access_key_id = YOUR_ACCESS_KEY
aws_secret_access_key = YOUR_SECRET_KEY

In the given example, DevAdmin is the profile for the development environment. Replace YOUR_ACCESS_KEY and YOUR_SECRET_KEY with your actual AWS credentials.