An open API service indexing awesome lists of open source software.

https://github.com/libre-devops/terraform-azurerm-shared-image

A module used to add a shared image to an Azure Compute Gallery
https://github.com/libre-devops/terraform-azurerm-shared-image

Last synced: 2 months ago
JSON representation

A module used to add a shared image to an Azure Compute Gallery

Awesome Lists containing this project

README

        

```hcl
module "rg" {
source = "registry.terraform.io/libre-devops/rg/azurerm"

rg_name = "rg-${var.short}-${var.loc}-${terraform.workspace}-build" // rg-ldo-euw-dev-build
location = local.location // compares var.loc with the var.regions var to match a long-hand name, in this case, "euw", so "westeurope"
tags = local.tags

# lock_level = "CanNotDelete" // Do not set this value to skip lock
}

module "gallery" {
source = "registry.terraform.io/libre-devops/compute-gallery/azurerm"

rg_name = module.rg.rg_name
location = module.rg.rg_location
tags = module.rg.rg_tags

gallery_name = "gal${var.short}${var.loc}${terraform.workspace}01"
description = "A basic description"
}

module "image" {
source = "registry.terraform.io/libre-devops/shared-image/azurerm"

rg_name = module.rg.rg_name
location = module.rg.rg_location
tags = module.rg.rg_tags

images = {
img01 = {
gallery_name = module.gallery.gallery_name
is_image_specialised = false
image_hyper_v_generation = "V2"
image_os_type = "Linux"

identifier = {
publisher = "LibreDevOps"
offer = "Image2"
sku = "Latest"
}

create_image_version = true
image_version_number = formatdate("YYYY.MM", timestamp())
exclude_from_latest = false

image_version_target_region = {
image_replication_zone_location = "westeurope"
}
}
}
}
```
## Requirements

No requirements.

## Providers

| Name | Version |
|------|---------|
| [azurerm](#provider\_azurerm) | n/a |

## Modules

No modules.

## Resources

| Name | Type |
|------|------|
| [azurerm_shared_image.shared_image](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/shared_image) | resource |
| [azurerm_shared_image_version.shared_image_version](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/shared_image_version) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [create\_image\_version](#input\_create\_image\_version) | Whether the for\_each block for an image version is to be executed | `bool` | `false` | no |
| [images](#input\_images) | The images block | `any` | n/a | yes |
| [location](#input\_location) | The location for this resource to be put in | `string` | n/a | yes |
| [rg\_name](#input\_rg\_name) | The name of the resource group, this module does not create a resource group, it is expecting the value of a resource group already exists | `string` | n/a | yes |
| [tags](#input\_tags) | A map of the tags to use on the resources that are deployed with this module. | `map(string)` |

{
"source": "terraform"
}
| no |

## Outputs

| Name | Description |
|------|-------------|
| [shared\_image\_gallery\_name](#output\_shared\_image\_gallery\_name) | The name of the shared image gallery |
| [shared\_image\_id](#output\_shared\_image\_id) | The id of the shared image |
| [shared\_image\_name](#output\_shared\_image\_name) | The name of the shared image |