Skip to content

Repository with q.beyond designed Azure-archetypes, including policies

License

Notifications You must be signed in to change notification settings

qbeyond/terraform-azurerm-archetype-lib

Repository files navigation

Archetype Library

GitHub tag License


This repository is our central library of custom policy (set) definitions. Policies defined here will be usable by CAF archetypes. Via this Module, named archetype-lib, all q.beyond archetype-, policy-, policy set- and roledefinitions and policy assignments will be summarized in one folder with all the azurerm compatible definitions and assignments. That folder will contain the external and the q.beyond definitions and assignments. The planned usecase is to hand the output merged_library of this Module to the CAF-Module, as it can only handle one Folder as input containing definitions and assignments.

Upgrade

As this repository uses Semantic versioning upgrading minor or patch releases shouldn't be a problem. Upgrading major Releases need additional steps. Check the Upgrade Guide or Changelog for more information.

Root Repository Structure

  • archetypes is a folder just containing archetype definitions: no subfolders, the name serves as description
  • The main categories used by archetypes: policy_definition, role_definitions
    • they each contain folders named by the corresponding topics of the policies and roles
      • they each can contain a folder with tests for themselves
      • they each contain their needed policy-, policy set- and roledefinitions and policy assignments
  • .tf files that that make up the archetype-lib module
  • folder for examples
    • contains folders of examples on how to use this module. Each example is described in this README under "Examples"

Examples

Basic

First, the given template is adding this Module as archetype_lib. The Path of the library that is supposed to be summarized with the q.beyond library is set as the value of cutomer_lib. The output ´file_names´ can be used to manualy check whether all files that are supposed to be included in the merged library are included, as it outputs the names of all files that were added. The output of merged_library is supposed to be the input for the CAF-Module for the parameter named archetype_lib

module "archetype_lib" {
  source       = "qbeyond/archetype-lib/azurerm"
  customer_lib = "${path.root}/example_lib"
}

output "file_names" {
  value = module.archetype_lib.file_names
}

output "merged_library" {
  value = module.archetype_lib.merged_library
}

Requirements

Name Version
local ~>2.4.0

Inputs

Name Description Type Default Required
customer_lib Path to the customer libary folder containing definition files that are supposed to be used by the CAF-Module. This module picks all CAF compatible definitions from the given folder and its subdirectories. string n/a yes

Outputs

Name Description
file_names Outputs the files which were added to the library.
merged_library Path to where the library containing both libraries can be found. This output can be given to the CAF-Module.
  ## Resource types
  | Type | Used |
  |------|-------|
    | [local_file](https://registry.terraform.io/providers/hashicorp/local/latest/docs/resources/file) | 1 |
  **`Used` only includes resource blocks.** `for_each` and `count` meta arguments, as well as resource blocks of modules are not considered.

Modules

No modules.

    ## Resources by Files
        ### main.tf
        | Name | Type |
        |------|------|
              | [local_file.copied_files](https://registry.terraform.io/providers/hashicorp/local/latest/docs/resources/file) | resource |

About

Repository with q.beyond designed Azure-archetypes, including policies

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages