Spot2 Infrastructure

Introduction

This project sets up the necessary infrastructure for the project required by Spot2. The infrastructure is deployed in AWS and uses the following services:

Architecture Diagram

image

Prerequisites

  • AWS CLI configured
  • Terraform installed
  • AWS account with necessary permissions

Configuration

You need the following environment variables:

  • TF_VAR_region
  • TF_VAR_ecr_name
  • TF_VAR_ecs_cluster_name
  • TF_VAR_ecs_service_name
  • TF_VAR_ecs_image_name
  • TF_VAR_container_name
  • TF_VAR_container_port
  • TF_VAR_aws_service_discovery_name
  • TF_VAR_alb_name
  • TF_VAR_vpc_name
  • TF_VAR_s3_bucket_name
  • TF_VAR_rds_master_username

They are used in Terraform.

Installation

  1. Clone the repository:

    git clone https://github.com/ilich96/spot2-api-infrastructure.git
  2. Navigate to the project directory:

    cd spot2-api-infrastructure
  3. Initialize Terraform:

    terraform init
  4. Review the planned changes::

    terraform plan
  5. Apply the Terraform configuration:

    terraform apply

Next steps

The infrastructure will be ready for using. But you need to make some steps manually to integrate with the api.

  • Run the create_schema lambda created. It creates the necessary table in RDS.
  • Run the transform-and-load-job ETL job created. It inserts all data in the table created previously.