Skip to content

Infrastructure Setup and Management

Sayali Oak edited this page Jun 24, 2024 · 1 revision

Objective

Our goal is to have a single shell script or Pulumi script that can:

  1. Create the entire infrastructure in the AWS cloud and/or on-premise.
  2. Deploy the required PostgreSQL database image.
  3. Install it locally if needed.
  4. Create the schema.
  5. Populate the tables with sample data.
  6. Run all unit test cases to ensure code integrity.

Schema Management and Testing

Whenever there are changes to any schema, it is mandatory to run all unit tests to ensure existing code remains unaffected. The clients for this database are our microservices, which perform CRUD operations on various entities. Therefore, maintaining the integrity and consistency of the schema across all environments is crucial.

Environments and Regions

We have two regions with multiple environments:

  • N. Virginia
    • Dev
    • Test
    • Stage
    • Prod
  • Ireland
    • Dev
    • Prod

In each of these environments, the database instances must have the exact same schema.

Infrastructure as Code with Pulumi

We will use Pulumi scripts to set up our AWS infrastructure. Specifically, we will use managed Aurora with PostgreSQL DB in all these environments.

Continuous Integration and Continuous Deployment (CI/CD)

Eventually, we aim to establish CI/CD pipelines to automate the movement of our code:

  • From GitHub to AWS.
  • From AWS to the appropriate environment.

By setting up these pipelines, we ensure smooth and automated deployments, enhancing efficiency and reducing the possibility of manual errors. This approach will streamline our infrastructure management, maintain consistency, and support efficient development and deployment processes.

Clone this wiki locally