Skip to content

JinLee794/Bastion-E2E

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maintained by @JinLee794

Azure Bastion End-to-End

This repo shows an example file/folder structure you can use with Terragrunt to keep your Terraform code DRY. For background information, check out the Keep your Terraform code DRY section of the Terragrunt documentation.

Be sure to read through the Terragrunt documentation on DRY Architectures to understand the features of Terragrunt used in this folder organization.

Note: This code is solely for demonstration purposes. This is not production-ready code, so use at your own risk. If you are interested in battle-tested, production-ready Terraform code, check out Gruntwork.

How do you deploy the infrastructure in this repo?

Pre-requisites

  1. Install Terraform version 1.1.7 and Terragrunt version v0.36.0 or newer.
  2. Configure your remote state backend values within the common.hcl configuration files
  3. Configure your Azure credentials using one of the supported authentication mechanisms.
  4. Fill in details relevant to your subscription in the following files:

Deploying a single module

  1. cd into the module's folder (e.g. cd Live/nonprod/ES_JINLE/Network/resource-group).
  2. Run terragrunt plan to see the changes you're about to apply.
  3. If the plan looks good, run terragrunt apply.

Deploying all modules in a layer

  1. cd into the layer folder (e.g. cd Live/nonprod/ES_JINLE/Network).
  2. Run terragrunt run-all plan to see all the changes you're about to apply.
  3. If the plan looks good, run terragrunt run-all apply.

How is the code in this repo organized?

The code in this repo uses the following folder hierarchy:

Live
 └ environment
    └ subscription
       └ layer
         └ resource
Modules
 └ module

Where:

  • environment: At the top level is the nonprod or prod grouping to accommodate for multi-subscription Azure environments, while assuming each subscription will be designated for either production on non-production workloads.

  • subscription: Within each environment, there will be an Azure subscription name to directly reflect the resource organization structure on both Azure and in code.

  • layer: Within each subscription, there will be one or more "layers", such as Compute, Network, etc. These are logical groupings of resources that also share a common attribute file (layer.hcl) to further allow you to keep your code 'DRY'. Such a structure allows quick and easy configuration for numerous resources all at a centralized location.

  • resource: Within each environment, you deploy all the resources for that environment, such as Windows VM Instances, Virtual Network, Subnets, Network Security Groups, Bastions, and so on. Note that the Terraform code for most of these resources lives in the /Modules/ directory.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages