This project sets up the necessary infrastructure for the project required by Spot2. The infrastructure is deployed in AWS and uses the following services:
- Amazon Elastic Container Service
- Amazon Elastic Container Registry
- AWS Glue
- Amazon EC2
- Lambda
- Amazon S3
- Amazon RDS
- AWS Identity and Access Management
- Amazon Virtual Private Cloud
- AWS Secrets Manager
- AWS CLI configured
- Terraform installed
- AWS account with necessary permissions
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.
-
Clone the repository:
git clone https://github.com/ilich96/spot2-api-infrastructure.git
-
Navigate to the project directory:
cd spot2-api-infrastructure
-
Initialize Terraform:
terraform init
-
Review the planned changes::
terraform plan
-
Apply the Terraform configuration:
terraform apply
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.