Skip to content

A template to set up foundational infrastructure for your application in AWS

License

Notifications You must be signed in to change notification settings

navapbc/template-infra

Folders and files

NameName
Last commit message
Last commit date
Mar 14, 2024
Feb 20, 2024
Jan 19, 2024
Feb 23, 2024
Mar 14, 2024
Feb 20, 2024
Dec 8, 2023
Dec 21, 2023
Feb 7, 2023
Nov 9, 2023
Sep 20, 2023
Mar 6, 2023
Feb 7, 2023
Jul 27, 2023
Jun 22, 2022
Dec 14, 2023
Dec 8, 2023
Aug 2, 2023
Aug 2, 2023
Dec 8, 2023
Jun 30, 2023

Repository files navigation

Template repository for application infrastructure

Overview

This is a template repository to set up foundational infrastructure for your application in AWS. This template includes setup for:

  • Team workflows - templates for pull requests (PRs), architecture decision records (ADRs), and Makefiles.
  • Account level foundational infrastructure - infrastructure for terraform backends, including an S3 bucket and DynamoDB table for storing and managing terraform state files.
  • Application infrastructure - the infrastructure you need to set up a basic web app, such as a image container repository, load balancer, web service, and database.
  • CI for infra - GitHub action that performs infra code checks, including linting, validation, and security compliance checks.
  • CD / Deployments - infrastructure for continuous deployment, including: AWS account access for Github actions, scripts for building and publishing release artifacts, and a Github action for automated deployments from the main branch.
  • Documentation - technical documentation for the decisions that went into all the defaults that come with the template.

The template infra is intended to work with multiple application templates. See template-application-flask and template-application-nextjs.

Installation

To get started using the template infrastructure on your project, run the following command in your project's directory to execute the download and install script, which clones the template repository, copies the template files to your repository, and removes any files that are only relevant to the template itself:

curl https://raw.githubusercontent.com/navapbc/template-infra/main/template-only-bin/download-and-install-template.sh | bash -s

Now you're ready to set up the various pieces of your infrastructure.

Application Requirements

This template assumes that you have an application to deploy. See application requirements for more information on what is needed to use the infrastructure template. If you're using one of the Platform application templates, these requirements are already met.

Setup

After downloading and installing the template into your project:

  1. Follow the steps in infra/README.md to setup the infrastructure for your application.
  2. After setting up AWS resources, you can set up GitHub Actions workflows.
  3. After configuring GitHub Actions, you can set up continuous deployment.
  4. At any point, set up your team workflow.

Updates

There are multiple ways to receive template updates on your project. For most updates, you can simply run the update-template.sh script

curl https://raw.githubusercontent.com/navapbc/template-infra/main/template-only-bin/update-template.sh | bash -s

If the update fails the simplest option may be to re-run the installation script above and manually review the changes.

Remember: Make sure to read the release notes in case there are breaking changes you need to address.

Renamed applications

If you renamed your application from infra/app to something else like infra/foo, then first rename your app back to infra/app before applying the updates e.g.

mv foo app
mv infra/foo infra/app
curl https://raw.githubusercontent.com/navapbc/template-infra/main/template-only-bin/update-template.sh | bash -s
mv infra/app infra/foo
mv app foo