Book Image

Infrastructure as Code (IAC) Cookbook

By : Stephane Jourdan, Pierre Pomès
Book Image

Infrastructure as Code (IAC) Cookbook

By: Stephane Jourdan, Pierre Pomès

Overview of this book

Para 1: Infrastructure as code is transforming the way we solve infrastructural challenges. This book will show you how to make managing servers in the cloud faster, easier and more effective than ever before. With over 90 practical recipes for success, make the very most out of IAC.
Table of Contents (18 chapters)
Infrastructure as Code (IAC) Cookbook
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
Index

Managing GitHub with Terraform


There're many service providers to use with Terraform. GitHub is one of them, and we'll see how to manage members of an organization, various teams, and control repository access, right from our infrastructure code. That way, we have an automatic history log of who accesses what.

Getting ready

To step through this recipe, you will need the following:

  • A working Terraform installation

  • A GitHub account (with an API token)

  • An Internet connection

How to do it…

We want to manage a GitHub organization named ACME. Here are the users and their groups:

GitHub username

GitHub team name

Membership level

Team privacy

John

Documentation

member

closed

Jane

Engineering

admin

secret

Here's the policy we decided concerning the Git repository named infrastructure-repository:

GitHub team name

Repository permissions

Documentation

pull

Engineering

admin

Configuring GitHub

Let's start by creating a github provider, as we used an aws provider for AWS in the previous recipes...