Infrastructure as Code example

IoC examples using Azure

View on GitHub
Home Github basics part 1 Terraform basics part 1 Terraform Examples Github collaboration

Part one: Github basics

Starting from scratch, in the end of this you will end up with a development environment on your computer. Ready to deploy infrastructure.

Step 1: Fork this github project

Result:

   This will give you your own copy of this project
   It allows you to freely experiment with changes without affecting the original project.

Step 2: Clone this project

Result:

    This will create a local copy on your computer and sync between the two locations

Step 3: The files listed in .gitignore will not be added to git

example: terraform.tfvars

# local file, that is'nt under versioncontrol
#Define application name, used to prefix all resources with your unique name
app_name = "<insert_your_unique_name"

Step 4: Open project in VS Code


Step 5: Do a change

File: azure-variable.tf

# remove the following line
default     = "S3cr3tP@ssw0rd"

File: terraform.tfvars

# add the following line
linux_admin_password = "<your secret pwd>"

Note: The password should be stored in a Vault, but that is not covered by this introduction

Result:

    The password is now moved to a file that is only stored on your PC and the changed file azure-variable.tf is ready to be pushed to git.

Step 6: Commit


Step 7: Push your changes to github