This directory contains the Terraform configuration files for setting up the infrastructure for the Researcher project. The infrastructure is divided into several modules, each responsible for a specific part of the architecture.
-
main.tf: This file defines the main Terraform configuration, including the backend configuration for storing the Terraform state in an S3 bucket. It also includes the module declarations for Cognito, S3, and Aurora.
-
data.tf: Contains data sources to fetch information about the current AWS caller identity and region.
-
config.tf: Specifies the required providers and configures the AWS provider with necessary credentials and region.
-
networking.tf: Defines the networking resources, including VPC, subnets, security groups, internet gateway, and route tables.
-
variables.tf: Declares the input variables used across the Terraform configuration, such as AWS credentials, region, and database details.
Located in modules/aurora
, this module is responsible for setting up the Aurora database cluster.
-
user_db.tf: (Currently commented out) Defines the AWS RDS Aurora cluster configuration, including engine type, scaling configuration, and security settings.
-
variables.tf: Declares variables specific to the Aurora module, such as database name, username, password, subnet group name, and security group IDs.
Located in modules/s3
, this module manages the S3 bucket configuration.
-
researcher.tf: Configures the S3 bucket with versioning, server-side encryption, lifecycle rules, and ownership controls.
-
output.tf: Outputs the bucket name, ARN, and ID for use in other parts of the infrastructure.
Located in modules/cognito
, this module sets up the Cognito user pool and client.
-
researcher_user_pool.tf: Configures the Cognito user pool with alias attributes, password policy, and verification settings.
-
researcher_user_pool_client.tf: Sets up the Cognito user pool client with authentication flows.
-
output.tf: Outputs the user pool ID, ARN, and client ID for integration with other services.
- output.tf: Provides outputs for the Cognito user pool and client IDs, which can be used by other components or services that need to interact with the Cognito service.
- Ensure you have Terraform installed and configured with your AWS credentials.
- Initialize the Terraform configuration:
terraform init
- Plan the infrastructure changes:
terraform plan
- Apply the changes to set up the infrastructure:
terraform apply
- Ensure that the AWS credentials provided have the necessary permissions to create and manage the resources defined in this configuration.
- The Aurora module's RDS cluster resource is currently commented out. Uncomment and configure it as needed for your environment.
This setup is designed for the Researcher project and may need adjustments for other environments or projects.