Git Product home page Git Product logo

resource_group's Introduction

Build status

Creates one or multiple resource groups

Sets one or more resource groups, each of them in a specific Azure region.

Reference the module to a specific version (recommended):

module "resource_groups" {
    source                  = "git://github.com/aztfmod/resource_group.git?ref=v1.1"
  
    prefix                  = var.prefix
    resource_groups         = var.resource_groups
    tags                    = var.tags
}

Or get the latest version

module "resource_groups" {
    source                  = "git://github.com/aztfmod/resource_group.git?ref=latest"
  
    prefix                  = var.prefix
    resource_groups         = var.resource_groups
    tags                    = var.tags
}

Parameters

resource_groups

(Required) Object that describes the resource groups to be created with their geo. Global group of tags will be added to all RG, specific tags can be added per RG.

variable "resource_groups" {
  description = "(Required) Map of the resource groups to create"
}

Example of structure:

resource_groups = {
    apim          = { 
                    name     = "-apim-demo"
                    location = "southeastasia" 
    },
    networking    = {    
                    name     = "-networking-demo"
                    location = "eastasia" 
    },
    insights      = { 
                    name     = "-insights-demo"
                    location = "francecentral" 
                    tags     = {
                      project     = "Pattaya"
                      approver     = "Gunter"
                    }   
    },
}

prefix

(Optional) You can use a prefix to add to the list of resource groups you want to create

variable "prefix" {
    description = "(Optional) You can use a prefix to add to the list of resource groups you want to create"
}

Example

locals {
    prefix = "${random_string.prefix.result}-"
}

resource "random_string" "prefix" {
    length  = 4
    upper   = false
    special = false
}

tags

(Optional) Map of tags for the deployment

variable "tags" {
  description = "(Optional) map of base tags for the deployment"
}

Example

tags = {
    environment     = "DEV"
    owner           = "Arnaud"
    deploymentType  = "Terraform"
  }

Output

object

Returns the full set of created resource groups as a map, as follows:

object = {
  "apim" = {
    "id" = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tst-apim-demo"
    "location" = "southeastasia"
    "name" = "tst-apim-demo"
    "tags" = {
      "BusinessUnit" = "SHARED"
      "DR" = "NON-DR-ENABLED"
      "costCenter" = "1664"
      "deploymentType" = "Terraform"
      "environment" = "DEV"
      "owner" = "Arnaud"
    }
  }
  "networking" = {
    "id" = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tst-networking-demo"
    "location" = "eastasia"
    "name" = "tst-networking-demo"
    "tags" = {
      "BusinessUnit" = "SHARED"
      "DR" = "NON-DR-ENABLED"
      "costCenter" = "1664"
      "deploymentType" = "Terraform"
      "environment" = "DEV"
      "owner" = "Arnaud"
    }
  }
}

names

Kept for backward compatibility, might be removed in a future version.

Returns a map of:

  • key = key name (internal name) of the resource group
  • value = name of the resource group

ids

Kept for backward compatibility, might be removed in a future version.

Returns a map of:

  • key = key name (internal name) of the resource group
  • value = id of the resource group

resource_group's People

Contributors

arnaudlh avatar

Watchers

 avatar

Forkers

sangram9090

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.