Skip to main content
terraform modules
  1. projects/

terraform modules

Table of Contents

Here is a list of all my current terraform modules. They are mainly focused for Azure and Databricks.

Azure Resource prefixes
#

Release

My resource-prefixes terraform module for azurerm provides, you guessed it, Azure resource prefixes as outputs.

Check it out on the terraform registry.

Usage
#

If you want to use this module to be consistent with naming:

module "prefixes" {
  source  = "nietarne/resource-prefixes/azurerm"
}

locals {
    resource_group_name = "${module.prefixes.resource_group}-myproject-dev"
}

CAF Naming
#

Release

My caf-naming terraform module for azurerm provides a nice consistent way to create names for Azure resources. You provide the naming scheme you want (or use the default one), provide the required variables and then you can easily reference names through the outputs of the module.

Check it out on the terraform registry.

Default naming convention: {prefix}-{company_abbreviation}-{project}-{environment}-{instance_number}

The prefix of a resource is always included. To get the prefixes, this module uses my resource prefix module to get the correct prefixes.

See caf naming components for more info.

Usage
#

To use the default naming convention, copy paste the following into your terraform config. After that, run terraform init

module "caf-naming" {
  source  = "nietarne/caf-naming/azurerm"

  company_abbreviation = "comp"
  project              = "blogsite"
  environment          = "dev"
}

If you want to check the generated name of a resource:

output "resourcegroupname" {
    value = module.caf-naming.resource_group[0]
}
Warning! The module outputs lists of names, this way you can generate multiple names (think of instance numbers)