azurerm_managed_application

Manages a Managed Application.

Example Usage

provider "azurerm" {
  features {}
}

data "azurerm_client_config" "current" {}

data "azurerm_role_definition" "builtin" {
  name = "Contributor"
}

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

resource "azurerm_managed_application_definition" "example" {
  name                = "examplemanagedapplicationdefinition"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  lock_level          = "ReadOnly"
  package_file_uri    = "https://github.com/Azure/azure-managedapp-samples/raw/master/Managed Application Sample Packages/201-managed-storage-account/managedstorage.zip"
  display_name        = "TestManagedAppDefinition"
  description         = "Test Managed App Definition"

  authorization {
    service_principal_id = data.azurerm_client_config.current.object_id
    role_definition_id   = split("/", data.azurerm_role_definition.builtin.id)[length(split("/", data.azurerm_role_definition.builtin.id)) - 1]
  }
}

resource "azurerm_managed_application" "example" {
  name                        = "example-managedapplication"
  location                    = azurerm_resource_group.example.location
  resource_group_name         = azurerm_resource_group.example.name
  kind                        = "ServiceCatalog"
  managed_resource_group_name = "infrastructureGroup"
  application_definition_id   = azurerm_managed_application_definition.example.id

  parameter_values = jsonencode({
    location = {
      value = azurerm_resource_group.example.location
    },
    storageAccountNamePrefix = {
      value = "storeNamePrefix"
    },
    storageAccountType = {
      value = "Standard_LRS"
    }
  })
}

Argument Reference

The following arguments are supported:


The plan block exports 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

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

terraform import azurerm_managed_application.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Solutions/applications/app1