Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.azure.management.kotlin.GroupTemplateDeployment.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.management.kotlin
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
/**
* Builder for [GroupTemplateDeployment].
*/
@PulumiTagMarker
public class GroupTemplateDeploymentResourceBuilder internal constructor() {
public var name: String? = null
public var args: GroupTemplateDeploymentArgs = GroupTemplateDeploymentArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend GroupTemplateDeploymentArgsBuilder.() -> Unit) {
val builder = GroupTemplateDeploymentArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): GroupTemplateDeployment {
val builtJavaResource =
com.pulumi.azure.management.GroupTemplateDeployment(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return GroupTemplateDeployment(builtJavaResource)
}
}
/**
* Manages a Template Deployment at a Management Group Scope.
* > **Note:** Deleting a Deployment at the Management Group Scope will not delete any resources created by the deployment.
* > **Note:** Deployments to a Management Group are always Incrementally applied. Existing resources that are not part of the template will not be removed.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = azure.management.getGroup({
* name: "00000000-0000-0000-0000-000000000000",
* });
* const exampleGroupTemplateDeployment = new azure.management.GroupTemplateDeployment("example", {
* name: "example",
* location: "West Europe",
* managementGroupId: example.then(example => example.id),
* templateContent: `{
* "schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
* "contentVersion": "1.0.0.0",
* "parameters": {
* "policyAssignmentName": {
* "type": "string",
* "defaultValue": "[guid(parameters('policyDefinitionID'), resourceGroup().name)]",
* "metadata": {
* "description": "Specifies the name of the policy assignment, can be used defined or an idempotent name as the defaultValue provides."
* }
* },
* "policyDefinitionID": {
* "type": "string",
* "metadata": {
* "description": "Specifies the ID of the policy definition or policy set definition being assigned."
* }
* }
* },
* "resources": [
* {
* "type": "Microsoft.Authorization/policyAssignments",
* "name": "[parameters('policyAssignmentName')]",
* "apiVersion": "2019-09-01",
* "properties": {
* "scope": "[subscriptionResourceId('Microsoft.Resources/resourceGroups', resourceGroup().name)]",
* "policyDefinitionId": "[parameters('policyDefinitionID')]"
* }
* }
* ]
* }
* `,
* parametersContent: `{
* "schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
* "contentVersion": "1.0.0.0",
* "parameters": {
* "policyDefinitionID": {
* "value": "/providers/Microsoft.Authorization/policyDefinitions/0a914e76-4921-4c19-b460-a2d36003525a"
* }
* }
* }
* `,
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.management.get_group(name="00000000-0000-0000-0000-000000000000")
* example_group_template_deployment = azure.management.GroupTemplateDeployment("example",
* name="example",
* location="West Europe",
* management_group_id=example.id,
* template_content="""{
* "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
* "contentVersion": "1.0.0.0",
* "parameters": {
* "policyAssignmentName": {
* "type": "string",
* "defaultValue": "[guid(parameters('policyDefinitionID'), resourceGroup().name)]",
* "metadata": {
* "description": "Specifies the name of the policy assignment, can be used defined or an idempotent name as the defaultValue provides."
* }
* },
* "policyDefinitionID": {
* "type": "string",
* "metadata": {
* "description": "Specifies the ID of the policy definition or policy set definition being assigned."
* }
* }
* },
* "resources": [
* {
* "type": "Microsoft.Authorization/policyAssignments",
* "name": "[parameters('policyAssignmentName')]",
* "apiVersion": "2019-09-01",
* "properties": {
* "scope": "[subscriptionResourceId('Microsoft.Resources/resourceGroups', resourceGroup().name)]",
* "policyDefinitionId": "[parameters('policyDefinitionID')]"
* }
* }
* ]
* }
* """,
* parameters_content="""{
* "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
* "contentVersion": "1.0.0.0",
* "parameters": {
* "policyDefinitionID": {
* "value": "/providers/Microsoft.Authorization/policyDefinitions/0a914e76-4921-4c19-b460-a2d36003525a"
* }
* }
* }
* """)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = Azure.Management.GetGroup.Invoke(new()
* {
* Name = "00000000-0000-0000-0000-000000000000",
* });
* var exampleGroupTemplateDeployment = new Azure.Management.GroupTemplateDeployment("example", new()
* {
* Name = "example",
* Location = "West Europe",
* ManagementGroupId = example.Apply(getGroupResult => getGroupResult.Id),
* TemplateContent = @"{
* ""$schema"": ""https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#"",
* ""contentVersion"": ""1.0.0.0"",
* ""parameters"": {
* ""policyAssignmentName"": {
* ""type"": ""string"",
* ""defaultValue"": ""[guid(parameters('policyDefinitionID'), resourceGroup().name)]"",
* ""metadata"": {
* ""description"": ""Specifies the name of the policy assignment, can be used defined or an idempotent name as the defaultValue provides.""
* }
* },
* ""policyDefinitionID"": {
* ""type"": ""string"",
* ""metadata"": {
* ""description"": ""Specifies the ID of the policy definition or policy set definition being assigned.""
* }
* }
* },
* ""resources"": [
* {
* ""type"": ""Microsoft.Authorization/policyAssignments"",
* ""name"": ""[parameters('policyAssignmentName')]"",
* ""apiVersion"": ""2019-09-01"",
* ""properties"": {
* ""scope"": ""[subscriptionResourceId('Microsoft.Resources/resourceGroups', resourceGroup().name)]"",
* ""policyDefinitionId"": ""[parameters('policyDefinitionID')]""
* }
* }
* ]
* }
* ",
* ParametersContent = @"{
* ""$schema"": ""https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#"",
* ""contentVersion"": ""1.0.0.0"",
* ""parameters"": {
* ""policyDefinitionID"": {
* ""value"": ""/providers/Microsoft.Authorization/policyDefinitions/0a914e76-4921-4c19-b460-a2d36003525a""
* }
* }
* }
* ",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := management.LookupGroup(ctx, &management.LookupGroupArgs{
* Name: pulumi.StringRef("00000000-0000-0000-0000-000000000000"),
* }, nil)
* if err != nil {
* return err
* }
* _, err = management.NewGroupTemplateDeployment(ctx, "example", &management.GroupTemplateDeploymentArgs{
* Name: pulumi.String("example"),
* Location: pulumi.String("West Europe"),
* ManagementGroupId: pulumi.String(example.Id),
* TemplateContent: pulumi.String(`{
* "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
* "contentVersion": "1.0.0.0",
* "parameters": {
* "policyAssignmentName": {
* "type": "string",
* "defaultValue": "[guid(parameters('policyDefinitionID'), resourceGroup().name)]",
* "metadata": {
* "description": "Specifies the name of the policy assignment, can be used defined or an idempotent name as the defaultValue provides."
* }
* },
* "policyDefinitionID": {
* "type": "string",
* "metadata": {
* "description": "Specifies the ID of the policy definition or policy set definition being assigned."
* }
* }
* },
* "resources": [
* {
* "type": "Microsoft.Authorization/policyAssignments",
* "name": "[parameters('policyAssignmentName')]",
* "apiVersion": "2019-09-01",
* "properties": {
* "scope": "[subscriptionResourceId('Microsoft.Resources/resourceGroups', resourceGroup().name)]",
* "policyDefinitionId": "[parameters('policyDefinitionID')]"
* }
* }
* ]
* }
* `),
* ParametersContent: pulumi.String(`{
* "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
* "contentVersion": "1.0.0.0",
* "parameters": {
* "policyDefinitionID": {
* "value": "/providers/Microsoft.Authorization/policyDefinitions/0a914e76-4921-4c19-b460-a2d36003525a"
* }
* }
* }
* `),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.management.ManagementFunctions;
* import com.pulumi.azure.management.inputs.GetGroupArgs;
* import com.pulumi.azure.management.GroupTemplateDeployment;
* import com.pulumi.azure.management.GroupTemplateDeploymentArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var example = ManagementFunctions.getGroup(GetGroupArgs.builder()
* .name("00000000-0000-0000-0000-000000000000")
* .build());
* var exampleGroupTemplateDeployment = new GroupTemplateDeployment("exampleGroupTemplateDeployment", GroupTemplateDeploymentArgs.builder()
* .name("example")
* .location("West Europe")
* .managementGroupId(example.applyValue(getGroupResult -> getGroupResult.id()))
* .templateContent("""
* {
* "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
* "contentVersion": "1.0.0.0",
* "parameters": {
* "policyAssignmentName": {
* "type": "string",
* "defaultValue": "[guid(parameters('policyDefinitionID'), resourceGroup().name)]",
* "metadata": {
* "description": "Specifies the name of the policy assignment, can be used defined or an idempotent name as the defaultValue provides."
* }
* },
* "policyDefinitionID": {
* "type": "string",
* "metadata": {
* "description": "Specifies the ID of the policy definition or policy set definition being assigned."
* }
* }
* },
* "resources": [
* {
* "type": "Microsoft.Authorization/policyAssignments",
* "name": "[parameters('policyAssignmentName')]",
* "apiVersion": "2019-09-01",
* "properties": {
* "scope": "[subscriptionResourceId('Microsoft.Resources/resourceGroups', resourceGroup().name)]",
* "policyDefinitionId": "[parameters('policyDefinitionID')]"
* }
* }
* ]
* }
* """)
* .parametersContent("""
* {
* "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
* "contentVersion": "1.0.0.0",
* "parameters": {
* "policyDefinitionID": {
* "value": "/providers/Microsoft.Authorization/policyDefinitions/0a914e76-4921-4c19-b460-a2d36003525a"
* }
* }
* }
* """)
* .build());
* }
* }
* ```
* ```yaml
* resources:
* exampleGroupTemplateDeployment:
* type: azure:management:GroupTemplateDeployment
* name: example
* properties:
* name: example
* location: West Europe
* managementGroupId: ${example.id}
* templateContent: |
* {
* "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
* "contentVersion": "1.0.0.0",
* "parameters": {
* "policyAssignmentName": {
* "type": "string",
* "defaultValue": "[guid(parameters('policyDefinitionID'), resourceGroup().name)]",
* "metadata": {
* "description": "Specifies the name of the policy assignment, can be used defined or an idempotent name as the defaultValue provides."
* }
* },
* "policyDefinitionID": {
* "type": "string",
* "metadata": {
* "description": "Specifies the ID of the policy definition or policy set definition being assigned."
* }
* }
* },
* "resources": [
* {
* "type": "Microsoft.Authorization/policyAssignments",
* "name": "[parameters('policyAssignmentName')]",
* "apiVersion": "2019-09-01",
* "properties": {
* "scope": "[subscriptionResourceId('Microsoft.Resources/resourceGroups', resourceGroup().name)]",
* "policyDefinitionId": "[parameters('policyDefinitionID')]"
* }
* }
* ]
* }
* parametersContent: |
* {
* "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
* "contentVersion": "1.0.0.0",
* "parameters": {
* "policyDefinitionID": {
* "value": "/providers/Microsoft.Authorization/policyDefinitions/0a914e76-4921-4c19-b460-a2d36003525a"
* }
* }
* }
* variables:
* example:
* fn::invoke:
* Function: azure:management:getGroup
* Arguments:
* name: 00000000-0000-0000-0000-000000000000
* ```
*
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* import * as std from "@pulumi/std";
* const example = azure.management.getGroup({
* name: "00000000-0000-0000-0000-000000000000",
* });
* const exampleGroupTemplateDeployment = new azure.management.GroupTemplateDeployment("example", {
* name: "example",
* location: "West Europe",
* managementGroupId: example.then(example => example.id),
* templateContent: std.file({
* input: "templates/example-deploy-template.json",
* }).then(invoke => invoke.result),
* parametersContent: std.file({
* input: "templates/example-deploy-params.json",
* }).then(invoke => invoke.result),
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* import pulumi_std as std
* example = azure.management.get_group(name="00000000-0000-0000-0000-000000000000")
* example_group_template_deployment = azure.management.GroupTemplateDeployment("example",
* name="example",
* location="West Europe",
* management_group_id=example.id,
* template_content=std.file(input="templates/example-deploy-template.json").result,
* parameters_content=std.file(input="templates/example-deploy-params.json").result)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* using Std = Pulumi.Std;
* return await Deployment.RunAsync(() =>
* {
* var example = Azure.Management.GetGroup.Invoke(new()
* {
* Name = "00000000-0000-0000-0000-000000000000",
* });
* var exampleGroupTemplateDeployment = new Azure.Management.GroupTemplateDeployment("example", new()
* {
* Name = "example",
* Location = "West Europe",
* ManagementGroupId = example.Apply(getGroupResult => getGroupResult.Id),
* TemplateContent = Std.File.Invoke(new()
* {
* Input = "templates/example-deploy-template.json",
* }).Apply(invoke => invoke.Result),
* ParametersContent = Std.File.Invoke(new()
* {
* Input = "templates/example-deploy-params.json",
* }).Apply(invoke => invoke.Result),
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management"
* "github.com/pulumi/pulumi-std/sdk/go/std"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := management.LookupGroup(ctx, &management.LookupGroupArgs{
* Name: pulumi.StringRef("00000000-0000-0000-0000-000000000000"),
* }, nil)
* if err != nil {
* return err
* }
* invokeFile, err := std.File(ctx, &std.FileArgs{
* Input: "templates/example-deploy-template.json",
* }, nil)
* if err != nil {
* return err
* }
* invokeFile1, err := std.File(ctx, &std.FileArgs{
* Input: "templates/example-deploy-params.json",
* }, nil)
* if err != nil {
* return err
* }
* _, err = management.NewGroupTemplateDeployment(ctx, "example", &management.GroupTemplateDeploymentArgs{
* Name: pulumi.String("example"),
* Location: pulumi.String("West Europe"),
* ManagementGroupId: pulumi.String(example.Id),
* TemplateContent: pulumi.String(invokeFile.Result),
* ParametersContent: pulumi.String(invokeFile1.Result),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.management.ManagementFunctions;
* import com.pulumi.azure.management.inputs.GetGroupArgs;
* import com.pulumi.azure.management.GroupTemplateDeployment;
* import com.pulumi.azure.management.GroupTemplateDeploymentArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var example = ManagementFunctions.getGroup(GetGroupArgs.builder()
* .name("00000000-0000-0000-0000-000000000000")
* .build());
* var exampleGroupTemplateDeployment = new GroupTemplateDeployment("exampleGroupTemplateDeployment", GroupTemplateDeploymentArgs.builder()
* .name("example")
* .location("West Europe")
* .managementGroupId(example.applyValue(getGroupResult -> getGroupResult.id()))
* .templateContent(StdFunctions.file(FileArgs.builder()
* .input("templates/example-deploy-template.json")
* .build()).result())
* .parametersContent(StdFunctions.file(FileArgs.builder()
* .input("templates/example-deploy-params.json")
* .build()).result())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* exampleGroupTemplateDeployment:
* type: azure:management:GroupTemplateDeployment
* name: example
* properties:
* name: example
* location: West Europe
* managementGroupId: ${example.id}
* templateContent:
* fn::invoke:
* Function: std:file
* Arguments:
* input: templates/example-deploy-template.json
* Return: result
* parametersContent:
* fn::invoke:
* Function: std:file
* Arguments:
* input: templates/example-deploy-params.json
* Return: result
* variables:
* example:
* fn::invoke:
* Function: azure:management:getGroup
* Arguments:
* name: 00000000-0000-0000-0000-000000000000
* ```
*
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = azure.management.getGroup({
* name: "00000000-0000-0000-0000-000000000000",
* });
* const exampleGetTemplateSpecVersion = azure.core.getTemplateSpecVersion({
* name: "exampleTemplateForManagementGroup",
* resourceGroupName: "exampleResourceGroup",
* version: "v1.0.9",
* });
* const exampleGroupTemplateDeployment = new azure.management.GroupTemplateDeployment("example", {
* name: "example",
* location: "West Europe",
* managementGroupId: example.then(example => example.id),
* templateSpecVersionId: exampleGetTemplateSpecVersion.then(exampleGetTemplateSpecVersion => exampleGetTemplateSpecVersion.id),
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.management.get_group(name="00000000-0000-0000-0000-000000000000")
* example_get_template_spec_version = azure.core.get_template_spec_version(name="exampleTemplateForManagementGroup",
* resource_group_name="exampleResourceGroup",
* version="v1.0.9")
* example_group_template_deployment = azure.management.GroupTemplateDeployment("example",
* name="example",
* location="West Europe",
* management_group_id=example.id,
* template_spec_version_id=example_get_template_spec_version.id)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = Azure.Management.GetGroup.Invoke(new()
* {
* Name = "00000000-0000-0000-0000-000000000000",
* });
* var exampleGetTemplateSpecVersion = Azure.Core.GetTemplateSpecVersion.Invoke(new()
* {
* Name = "exampleTemplateForManagementGroup",
* ResourceGroupName = "exampleResourceGroup",
* Version = "v1.0.9",
* });
* var exampleGroupTemplateDeployment = new Azure.Management.GroupTemplateDeployment("example", new()
* {
* Name = "example",
* Location = "West Europe",
* ManagementGroupId = example.Apply(getGroupResult => getGroupResult.Id),
* TemplateSpecVersionId = exampleGetTemplateSpecVersion.Apply(getTemplateSpecVersionResult => getTemplateSpecVersionResult.Id),
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/management"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := management.LookupGroup(ctx, &management.LookupGroupArgs{
* Name: pulumi.StringRef("00000000-0000-0000-0000-000000000000"),
* }, nil)
* if err != nil {
* return err
* }
* exampleGetTemplateSpecVersion, err := core.GetTemplateSpecVersion(ctx, &core.GetTemplateSpecVersionArgs{
* Name: "exampleTemplateForManagementGroup",
* ResourceGroupName: "exampleResourceGroup",
* Version: "v1.0.9",
* }, nil)
* if err != nil {
* return err
* }
* _, err = management.NewGroupTemplateDeployment(ctx, "example", &management.GroupTemplateDeploymentArgs{
* Name: pulumi.String("example"),
* Location: pulumi.String("West Europe"),
* ManagementGroupId: pulumi.String(example.Id),
* TemplateSpecVersionId: pulumi.String(exampleGetTemplateSpecVersion.Id),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.management.ManagementFunctions;
* import com.pulumi.azure.management.inputs.GetGroupArgs;
* import com.pulumi.azure.core.CoreFunctions;
* import com.pulumi.azure.core.inputs.GetTemplateSpecVersionArgs;
* import com.pulumi.azure.management.GroupTemplateDeployment;
* import com.pulumi.azure.management.GroupTemplateDeploymentArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* final var example = ManagementFunctions.getGroup(GetGroupArgs.builder()
* .name("00000000-0000-0000-0000-000000000000")
* .build());
* final var exampleGetTemplateSpecVersion = CoreFunctions.getTemplateSpecVersion(GetTemplateSpecVersionArgs.builder()
* .name("exampleTemplateForManagementGroup")
* .resourceGroupName("exampleResourceGroup")
* .version("v1.0.9")
* .build());
* var exampleGroupTemplateDeployment = new GroupTemplateDeployment("exampleGroupTemplateDeployment", GroupTemplateDeploymentArgs.builder()
* .name("example")
* .location("West Europe")
* .managementGroupId(example.applyValue(getGroupResult -> getGroupResult.id()))
* .templateSpecVersionId(exampleGetTemplateSpecVersion.applyValue(getTemplateSpecVersionResult -> getTemplateSpecVersionResult.id()))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* exampleGroupTemplateDeployment:
* type: azure:management:GroupTemplateDeployment
* name: example
* properties:
* name: example
* location: West Europe
* managementGroupId: ${example.id}
* templateSpecVersionId: ${exampleGetTemplateSpecVersion.id}
* variables:
* example:
* fn::invoke:
* Function: azure:management:getGroup
* Arguments:
* name: 00000000-0000-0000-0000-000000000000
* exampleGetTemplateSpecVersion:
* fn::invoke:
* Function: azure:core:getTemplateSpecVersion
* Arguments:
* name: exampleTemplateForManagementGroup
* resourceGroupName: exampleResourceGroup
* version: v1.0.9
* ```
*
* ## Import
* Management Group Template Deployments can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:management/groupTemplateDeployment:GroupTemplateDeployment example /providers/Microsoft.Management/managementGroups/my-management-group-id/providers/Microsoft.Resources/deployments/deploy1
* ```
*/
public class GroupTemplateDeployment internal constructor(
override val javaResource: com.pulumi.azure.management.GroupTemplateDeployment,
) : KotlinCustomResource(javaResource, GroupTemplateDeploymentMapper) {
/**
* The Debug Level which should be used for this Resource Group Template Deployment. Possible values are `none`, `requestContent`, `responseContent` and `requestContent, responseContent`.
*/
public val debugLevel: Output?
get() = javaResource.debugLevel().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The Azure Region where the Template should exist. Changing this forces a new Template to be created.
*/
public val location: Output
get() = javaResource.location().applyValue({ args0 -> args0 })
/**
* The ID of the Management Group to apply the Deployment Template to. Changing this forces a new resource to be created.
*/
public val managementGroupId: Output
get() = javaResource.managementGroupId().applyValue({ args0 -> args0 })
/**
* The name which should be used for this Template Deployment. Changing this forces a new Template Deployment to be created.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The JSON Content of the Outputs of the ARM Template Deployment.
*/
public val outputContent: Output
get() = javaResource.outputContent().applyValue({ args0 -> args0 })
/**
* The contents of the ARM Template parameters file - containing a JSON list of parameters.
*/
public val parametersContent: Output
get() = javaResource.parametersContent().applyValue({ args0 -> args0 })
/**
* A mapping of tags which should be assigned to the Template.
*/
public val tags: Output>?
get() = javaResource.tags().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.key.to(args0.value)
}).toMap()
}).orElse(null)
})
/**
* The contents of the ARM Template which should be deployed into this Resource Group. Cannot be specified with `template_spec_version_id`.
*/
public val templateContent: Output
get() = javaResource.templateContent().applyValue({ args0 -> args0 })
/**
* The ID of the Template Spec Version to deploy. Cannot be specified with `template_content`.
*/
public val templateSpecVersionId: Output?
get() = javaResource.templateSpecVersionId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
}
public object GroupTemplateDeploymentMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.azure.management.GroupTemplateDeployment::class == javaResource::class
override fun map(javaResource: Resource): GroupTemplateDeployment =
GroupTemplateDeployment(javaResource as com.pulumi.azure.management.GroupTemplateDeployment)
}
/**
* @see [GroupTemplateDeployment].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [GroupTemplateDeployment].
*/
public suspend fun groupTemplateDeployment(
name: String,
block: suspend GroupTemplateDeploymentResourceBuilder.() -> Unit,
): GroupTemplateDeployment {
val builder = GroupTemplateDeploymentResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [GroupTemplateDeployment].
* @param name The _unique_ name of the resulting resource.
*/
public fun groupTemplateDeployment(name: String): GroupTemplateDeployment {
val builder = GroupTemplateDeploymentResourceBuilder()
builder.name(name)
return builder.build()
}