Skip to content

claranet/terraform-azurerm-shared-image-gallery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure Shared Image Gallery

Changelog Notice Apache V2 License OpenTofu Registry

Azure module to deploy a Azure Shared Image Gallery.

Global versioning rule for Claranet Azure modules

Module version Terraform version AzureRM version
>= 7.x.x 1.3.x >= 3.0
>= 6.x.x 1.x >= 3.0
>= 5.x.x 0.15.x >= 2.0
>= 4.x.x 0.13.x / 0.14.x >= 2.0
>= 3.x.x 0.12.x >= 2.0
>= 2.x.x 0.12.x < 2.0
< 2.x.x 0.11.x < 2.0

Contributing

If you want to contribute to this repository, feel free to use our pre-commit git hook configuration which will help you automatically update and format some files for you by enforcing our Terraform code module best-practices.

More details are available in the CONTRIBUTING.md file.

Usage

This module is optimized to work with the Claranet terraform-wrapper tool which set some terraform variables in the environment needed by this module. More details about variables set by the terraform-wrapper available in the documentation.

module "azure_region" {
  source  = "claranet/regions/azurerm"
  version = "x.x.x"

  azure_region = var.azure_region
}

module "rg" {
  source  = "claranet/rg/azurerm"
  version = "x.x.x"

  location    = module.azure_region.location
  client_name = var.client_name
  environment = var.environment
  stack       = var.stack
}

module "run" {
  source  = "claranet/run/azurerm"
  version = "x.x.x"

  client_name         = var.client_name
  environment         = var.environment
  stack               = var.stack
  location            = module.azure_region.location
  location_short      = module.azure_region.location_short
  resource_group_name = module.rg.resource_group_name
}

module "shared_image_gallery" {
  source  = "claranet/shared-image-gallery/azurerm"
  version = "x.x.x"

  location            = module.azure_region.location
  location_short      = module.azure_region.location_short
  resource_group_name = module.rg.resource_group_name

  client_name = var.client_name
  environment = var.environment
  stack       = var.stack

  shared_images_definitions = [
    {
      name = "Debian11"
      identifier = {
        offer     = "Debian"
        publisher = "Claranet"
        sku       = "11"
      }
      os_type     = "Linux"
      description = "Claranet's Debian 11 custom image."
    },
    {
      name = "Debian12"
      identifier = {
        offer     = "Debian"
        publisher = "Claranet"
        sku       = "12"
      }
      os_type     = "Linux"
      description = "Claranet's Debian 12 custom image."
    },

  ]
  extra_tags = {
    foo = "bar"
  }
}

Providers

Name Version
azurecaf ~> 1.2, >= 1.2.22
azurerm ~> 3.74

Modules

No modules.

Resources

Name Type
azurerm_shared_image.shared_image resource
azurerm_shared_image_gallery.shared_image_gallery resource
azurecaf_name.shared_image_gallery data source

Inputs

Name Description Type Default Required
client_name Client name/account used in naming. string n/a yes
community_gallery Configure the Shared Image Gallery as a Community Gallery.
object({
eula = string
prefix = string
publisher_email = string
publisher_uri = string
})
null no
custom_name Custom Azure Shared Image Gallery, generated if not set string "" no
default_tags_enabled Option to enable or disable default tags. bool true no
environment Project environment. string n/a yes
extra_tags Additional tags to add on resources. map(string) {} no
location Azure region to use. string n/a yes
location_short Short string for Azure location. string n/a yes
name_prefix Optional prefix for the generated name string "" no
name_suffix Optional suffix for the generated name string "" no
resource_group_name Name of the resource group. string n/a yes
shared_image_gallery_description A description for this Shared Image Gallery. string null no
shared_images_definitions Create Shared Image Definition.
list(object({
name = string
identifier = object({
offer = string
publisher = string
sku = string
})
os_type = string
description = optional(string)
disk_types_not_allowed = optional(list(string))
end_of_life_date = optional(string)
eula = optional(string)
specialized = optional(bool)
architecture = optional(string, "x64")
hyper_v_generation = optional(string, "V1")
max_recommended_vcpu_count = optional(number)
min_recommended_vcpu_count = optional(number)
max_recommended_memory_in_gb = optional(number)
min_recommended_memory_in_gb = optional(number)
privacy_statement_uri = optional(string)
release_note_uri = optional(string)
trusted_launch_enabled = optional(bool)
confidential_vm_supported = optional(bool)
confidential_vm_enabled = optional(bool)
accelerated_network_support_enabled = optional(bool)
tags = optional(map(string))
}))
[] no
stack Project stack name. string n/a yes

Outputs

Name Description
id Azure Shared Image Gallery ID
name Azure Shared Image Gallery name
shared_image_gallery Azure Shared Image Gallery output object
shared_images_definitions Azure Shared Images definitions

Related documentation

Microsoft Azure documentation: xxxx