Multi Cloud Network Architecture

Building Networking Skills in the age of the Cloud

Multi Cloud Network Architecture

Getting Started with GitHub for Infrastructure Architects

Getting Started with GitHub
Share on linkedin
LinkedIn
Share on twitter
Twitter
Share on email
Email

This post has a simple objective:

to get infrastructure engineers and architects who are not using appropriate version control today to adopt a path of least resistance and get some form of version control up and running as quickly as possible. It is not a best practice post. Rather, it’s a “bare minimum” that should be done.

I believe that by taking the steps below, you will have a working tool that can be part of your IaC workflow and a new skill which I am sure will grow with curiosity over time.

Getting Started with GitHub for Fools, I mean Infrastructure Architects

I’ve been using GitHub for some time now. 

I’m sure seasoned developers will have better habits and practices than me. 

However, I am often working with network and infrastructure engineers who continue to manage their scripts and code in folders on their hard drive (as I also once did). We’re not used to using tools such as Git and sometimes these things can just seem like one more thing to learn that we’ll try and get to some day.

A client recently asked me to show them how to get a basic repository up and running for some IaC testing they had going on, so I figured I’d turn it into a blog post.

Here’s how to get started with GitHub in under 10 minutes in the easiest possible way.

In this post I propose installing the GitHub desktop app. The Git CLI is a better way to go in the longterm, however to get up and running fast and adopt better coding practices I chose the path of least resistance. I’ll do a follow up post on installing and using the CLI for workflows.

1. Create an account on GitHub

First up, create that account. I won’t go into more detail here as it’s pretty self explanatory. Just go to https://github.com/ and follow the instructions.

2. Download GitHub Desktop

Importantly, if you want to get started fast, download the desktop app for GitHub. You can always move to the CLI later once you get comfortable with the whole process.

Go here and do as they say: https://desktop.github.com/

3. Create your first Repository

Back to GitHub, you’re going to need somewhere to put your code. 

New project = New Repository

  • Click on create a new repository
  • Give it a cool name. This should be unique under your account
  • Make it private if that’s important to you. Otherwise, share the joy.
  • Adding a readme is good practice. Reminds you why you created this repository in the first place (Who, what, when and why)
  • Depending on what coding you’re doing, you may not want everything to sync up. In the case of Terraform, specify the types of files the repository should ignore (.tfstate, etc). GitHub has made this really easy so just choose the predefined Terraform template.

4. Create an empty file

In the case of a simple Terraform example, go ahead and create your main.tf file. You can leave it empty, but I always like to add a bit of text so I’m sure I’m in the right place when I clone it locally.

5. Open the file with GitHub Desktop

A really easy way to get your file accessed locally is to open it with the GitHub desktop. This manages the whole communication sync (or rather commit and push) from your local machine to the GitHub repository.

6. Open the file in Visual Code

Go now to the GitHub Desktop app and ensure you are in the right current repository. If you are using Visual Studio Code, you can go ahead and click to open it in a new window.

Be sure to trust the author (if you do indeed trust the author, that is).

7. Write your code

Ensure it’s the right file by checking the remark you made on GitHub when you created the file. 

Now get working. Throw some good Terraform code in there and do cool stuff. Save as you go!

8. Commit and Push your code

Now for the cool stuff. Version control.

You’ve made some changes to your file. You’re happy with them and you want to save them. Save your code in VSCode and jump to the GitHub Desktop app.

Click on fetch origin to show your changes made since the last commit. If you like what you see, go ahead and Commit to Main.

9. Verify on GitHub.com

Thanks for taking the time to read.

Share if you liked it
Share on linkedin
LinkedIn
Share on twitter
Twitter
Share on email
Email
0 0 votes
Article Rating
Subscribe
Notify of
guest
2 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
trackback

[…] If you need some help on using GitHub, check out my post here. […]

trackback

[…] GitHub or similar repository. Yes, you can code directly from a folder on your desktop, but I strongly advise getting into the habit of using version control. Check out my blog post here for getting up and running : link […]

20 year veteran of the networking industry currently specialising in Cloud Networking and Security.

CCIE #16661 (R&S, SP)

Disclaimer

I am currently an employee of Aviatrix. All opinions, views and statements are my own and do not reflect that of my employer. Any errors are mine and mine alone. Any ignorance is mine, though I do believe my parents and the public school system should shoulder some of that blame. 

Recent Posts

Archives