Skip to content

azurermManagedApplicationDefinition

Manages a Managed Application Definition.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
new azurerm.provider.AzurermProvider(this, "azurerm", {
  features: [{}],
});
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "example-resources",
  }
);
const dataAzurermClientConfigCurrent =
  new azurerm.dataAzurermClientConfig.DataAzurermClientConfig(
    this,
    "current",
    {}
  );
const azurermManagedApplicationDefinitionExample =
  new azurerm.managedApplicationDefinition.ManagedApplicationDefinition(
    this,
    "example_3",
    {
      authorization: [
        {
          role_definition_id: "a094b430-dad3-424d-ae58-13f72fd72591",
          service_principal_id: dataAzurermClientConfigCurrent.objectId,
        },
      ],
      description: "Test Managed Application Definition",
      display_name: "TestManagedApplicationDefinition",
      location: azurermResourceGroupExample.location,
      lock_level: "ReadOnly",
      name: "examplemanagedapplicationdefinition",
      package_file_uri:
        "https://github.com/Azure/azure-managedapp-samples/raw/master/Managed Application Sample Packages/201-managed-storage-account/managedstorage.zip",
      resource_group_name: azurermResourceGroupExample.name,
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermManagedApplicationDefinitionExample.overrideLogicalId("example");

Argument Reference

The following arguments are supported:

  • name - (Required) Specifies the name of the Managed Application Definition. Changing this forces a new resource to be created.

  • resourceGroupName - (Required) The name of the Resource Group where the Managed Application Definition should exist. Changing this forces a new resource to be created.

  • location - (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

  • lockLevel - (Required) Specifies the managed application lock level. Valid values include canNotDelete, none, readOnly. Changing this forces a new resource to be created.

  • authorization - (Optional) One or more authorization block defined below.

  • createUiDefinition - (Optional) Specifies the createUiDefinition JSON for the backing template with microsoftSolutions/applications resource.

  • displayName - (Required) Specifies the managed application definition display name.

  • description - (Optional) Specifies the managed application definition description.

  • packageEnabled - (Optional) Is the package enabled? Defaults to true.

  • mainTemplate - (Optional) Specifies the inline main template JSON which has resources to be provisioned.

  • packageFileUri - (Optional) Specifies the managed application definition package file Uri.

  • tags - (Optional) A mapping of tags to assign to the resource.

-> NOTE: If either createUiDefinition or mainTemplate is set they both must be set.


An authorization block supports the following:

  • roleDefinitionId - (Required) Specifies a role definition identifier for the provider. This role will define all the permissions that the provider must have on the managed application's container resource group. This role definition cannot have permission to delete the resource group.

  • servicePrincipalId - (Required) Specifies a service principal identifier for the provider. This is the identity that the provider will use to call ARM to manage the managed application resources.


Attributes Reference

The following attributes are exported:

  • id - The ID of the Managed Application Definition.

Timeouts

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

  • create - (Defaults to 30 minutes) Used when creating the Managed Application Definition.
  • update - (Defaults to 30 minutes) Used when updating the Managed Application Definition.
  • read - (Defaults to 5 minutes) Used when retrieving the Managed Application Definition.
  • delete - (Defaults to 30 minutes) Used when deleting the Managed Application Definition.

Import

Managed Application Definition can be imported using the resourceId, e.g.

terraform import azurerm_managed_application_definition.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Solutions/applicationDefinitions/appDefinition1