diff --git a/examples/managed-application/application-with-parameter_values/main.tf b/examples/managed-application/application-with-parameter_values/main.tf new file mode 100644 index 000000000000..28ed5674a78e --- /dev/null +++ b/examples/managed-application/application-with-parameter_values/main.tf @@ -0,0 +1,129 @@ +# Copyright (c) HashiCorp, Inc. +# SPDX-License-Identifier: MPL-2.0 + +provider "azurerm" { + features {} +} + +data "azurerm_client_config" "current" {} + +data "azurerm_role_definition" "builtin" { + name = "Contributor" +} + +resource "azurerm_resource_group" "example" { + name = "${var.prefix}-resources" + location = var.location +} + +resource "azurerm_managed_application_definition" "example" { + name = "${var.prefix}managedappdef" + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name + lock_level = "ReadOnly" + display_name = "ExampleManagedAppDefinition" + description = "Example Managed App Definition" + package_enabled = true + + create_ui_definition = < **NOTE:** `parameters` only supports values with `string` or `secureString` type. If the template has other parameter types, please use `parameter_values` instead. + * `parameter_values` - (Optional) The parameter values to pass to the Managed Application. This field is a JSON object that allows you to assign parameters to this Managed Application. -* `plan` - (Optional) One `plan` block as defined below. +* `plan` - (Optional) One `plan` block as defined below. Changing this forces a new resource to be created. * `tags` - (Optional) A mapping of tags to assign to the resource. @@ -87,15 +89,15 @@ The following arguments are supported: The `plan` block exports the following: -* `name` - (Required) Specifies the name of the plan from the marketplace. +* `name` - (Required) Specifies the name of the plan from the marketplace. Changing this forces a new resource to be created. -* `product` - (Required) Specifies the product of the plan from the marketplace. +* `product` - (Required) Specifies the product of the plan from the marketplace. Changing this forces a new resource to be created. -* `publisher` - (Required) Specifies the publisher of the plan. +* `publisher` - (Required) Specifies the publisher of the plan. Changing this forces a new resource to be created. -* `version` - (Required) Specifies the version of the plan from the marketplace. +* `version` - (Required) Specifies the version of the plan from the marketplace. Changing this forces a new resource to be created. -* `promotion_code` - (Optional) Specifies the promotion code to use with the plan. +* `promotion_code` - (Optional) Specifies the promotion code to use with the plan. Changing this forces a new resource to be created. ~> **NOTE:** When `plan` is specified, legal terms must be accepted for this item on this subscription before creating the Managed Application. The `azurerm_marketplace_agreement` resource or AZ CLI tool can be used to do this.