azurerm_gallery_application_version

Manages a Gallery Application Version.

Example Usage

resource "azurerm_resource_group" "example" {
  name     = "example-rg"
  location = "West Europe"
}

resource "azurerm_shared_image_gallery" "example" {
  name                = "examplegallery"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location
}

resource "azurerm_gallery_application" "example" {
  name              = "example-app"
  gallery_id        = azurerm_shared_image_gallery.example.id
  location          = azurerm_resource_group.example.location
  supported_os_type = "Linux"
}

resource "azurerm_storage_account" "example" {
  name                     = "examplestorage"
  resource_group_name      = azurerm_resource_group.example.name
  location                 = azurerm_resource_group.example.location
  account_tier             = "Standard"
  account_replication_type = "LRS"
}

resource "azurerm_storage_container" "example" {
  name                  = "example-container"
  storage_account_name  = azurerm_storage_account.example.name
  container_access_type = "blob"
}

resource "azurerm_storage_blob" "example" {
  name                   = "scripts"
  storage_account_name   = azurerm_storage_account.example.name
  storage_container_name = azurerm_storage_container.example.name
  type                   = "Block"
  source_content         = "[scripts file content]"
}

resource "azurerm_gallery_application_version" "example" {
  name                   = "0.0.1"
  gallery_application_id = azurerm_gallery_application.example.id
  location               = azurerm_gallery_application.example.location

  manage_action {
    install = "[install command]"
    remove  = "[remove command]"
  }

  source {
    media_link = azurerm_storage_blob.example.id
  }

  target_region {
    name                   = azurerm_gallery_application.example.location
    regional_replica_count = 1
  }
}

Arguments Reference

The following arguments are supported:



A manage_action block supports the following:


A source block supports the following:


A target_region block supports the following:

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

Import

Gallery Application Versions can be imported using the resource id, e.g.

terraform import azurerm_gallery_application_version.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/galleries/gallery1/applications/galleryApplication1/versions/galleryApplicationVersion1