Skip to content

Set up GitHub repository for IaC

GitHub is used to host the Terraform code for your infrastructure.

Set up an infrastructure repository for your team. An infrastructure repository contains only Terraform code. Keep your application code in separate application repositories. For more information, see Repository types.

Create a GitHub repository for infrastructure

Create a new empty repository for your team. Use the name of your team followed by -iac, for example barnehageplass-iac (see how to create a new repository).

Checkout the repository locally on your machine (see how to clone a repository).

Initialize with a .gitignore file to avoid checking in Terraform cache files and so on:

.gitignore
.DS_Store

**/.terraform/*
**.tfstate
*.tfstate.*

Next step

Follow Set up environment to create configuration files for your first environment.