Azure Bootstrap

Source code & Installation

The source code of this kit module can be found hereopen in new window

Run the following command to install the kit module:

collie kit import azure/bootstrap
1

This documentation is intended as a reference documentation for cloud foundation or platform engineers using this module.

Terraform State Storage

This module includes configuration to set up a state backend using Azure blob storage. You can activate this by configuring the terraform_state_storage variable.

Like all bootstrap modules published on collie hub, you will need to deploy this module twice to complete the bootstrap process. Please see the bootstrap tutorialopen in new window for more info.

If you're not using terraform_state_storage, please configure your own backend in platform.hcl

Platform Engineers Group

This module sets up an AAD group for managing platform engineers. This is required in conjunction with enabling access to terraform state storage but can also be used to grant administrative access to Azure resources.

UPN handling for AAD Guest users

Useful if you need to translate emails into UPNs (User Principal Names) as necessary, especially for guest users. You can add this code block to your terragrunt.hcl file instead of using inputs."

locals {
upn_domain = "#EXT#@devmeshithesheep.onmicrosoft.com"
  platform_engineers_emails = [
    "meshi@meshithesheep.io" # #TODO change, enter PLATFORM ENGINEERS here
  ]

# change the upn_domain value above
  platform_engineers_members = [
    for x in local.platform_engineers_emails : {
      email = x
      upn   = "${replace(x, "@", "_")}${local.upn_domain}"
    }
  ]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14

Requirements

NameVersion
terraform>= 1.0
azuread~> 2.41.0
azurerm~> 3.71.0

Modules

NameSourceVersion
terraform_state./terraform-staten/a

Resources

NameType
azuread_app_role_assignment.cloudfoundation_deploy-approleopen in new windowresource
azuread_app_role_assignment.cloudfoundation_deploy-directoryopen in new windowresource
azuread_application.cloudfoundation_deployopen in new windowresource
azuread_group.platform_engineersopen in new windowresource
azuread_service_principal.cloudfoundation_deployopen in new windowresource
azuread_service_principal_password.cloudfoundation_deployopen in new windowresource
azurerm_role_assignment.cloudfoundation_deployopen in new windowresource
azurerm_role_assignment.tfstates_engineersopen in new windowresource
azurerm_role_definition.cloudfoundation_deployopen in new windowresource
time_rotating.key_rotationopen in new windowresource
azuread_application_published_app_ids.well_knownopen in new windowdata source
azuread_client_config.currentopen in new windowdata source
azuread_service_principal.msgraphopen in new windowdata source
azuread_users.platform_engineers_membersopen in new windowdata source
azurerm_management_group.rootopen in new windowdata source
azurerm_subscription.currentopen in new windowdata source

Inputs

NameDescriptionTypeDefaultRequired
aad_tenant_idId of the AAD Tenant. This is also the simultaneously the id of the root management group.stringn/ayes
platform_engineers_membersSet up a group of platform engineers. If enabled, this group will receive access to terraform_state_storage
list(object({
email = string,
upn = string,
}))
n/ayes
service_principal_namename of the Service Principal used to perform all deployments in this platformstring"cloudfoundation_tf_deploy_user"no
terraform_state_storageConfigure this object to enable setting up a terraform state store in Azure Storage.
object({
location = string,
name = string,
config_file_path = string
})
nullno

Outputs

NameDescription
client_idn/a
client_principal_idn/a
client_secretn/a
documentation_mdn/a
platform_engineers_azuread_group_idn/a