Skip to main content

Creating an Infrastructure repository

Learn how to create a GitHub repository to host infrastructure tools and configurations. Then configure repository settings, enable branch protection, and add collaborators.

1 Create a GitHub repository

Create an empty GitHub repository to host infrastructure tools and configuration, and clone it to your host computer into a directory below your $HOME directory in the directory tree, for example, /Users/morpheus/src/infrastructure.

2 Setup basic repository settings

We recommend the following GitHub repository settings.

  1. Under "Features", ensure "Issues" are enabled. We will use Issues with Atmos GitHub Actions for Terraform.
  2. Under "Pull Requests", disable both "Allow merge commits" and "Allow rebase merging". We do this to create a clean commit history. Otherwise, the git history on the main branch will contain individual commits from each feature branch, which will result in a history which may contain "dirty" commits.
  3. Under "Pull Requests", check "Always suggest updating pull request branches"
  4. Under "Pull Requests", check "Automatically delete head branches"

3 Enable branch protection

  1. Under branches, select "Add branch ruleset"
  2. Name this ruleset whatever you'd like. For example, "Protected Branches"
  3. Under "Bypass list", add your admin team. This team is able to skip the rules were are about to add, so this the bypass list should be sparingly granted
  4. Under "Target branches", select "Add target" and "Include all default branches"
  5. Then check the following rules:
    • Restrict deletions
    • Require a pull request before merging
    • Block force pushes

4 Add collaborators and teams

Now add in your collaborators and teams. Under "Collaborators and teams", click "Add Teams". Generally most teams should have "Write" access, and "Admin" access should be granted sparingly.

For engagements with Cloud Posse, please grant Cloud Posse "Write" access.

5 Import the Reference Architecture

With the GitHub repository prepared, we are now ready to import the Cloud Posse reference architecture.

Where do I get these files?

The contents of this repository are supplied as part of our Quickstart or Jumpstart packages. For the remainder of this guide, we will assume you have access to the reference architecture configurations. Learn More

What comes next?

With your repository set up, we need to address some of the prerequisites for your workstation. This includes building the toolbox image on your workstation.

Next Step