All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.blueprint.kotlin.AssignmentArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.14.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.blueprint.kotlin

import com.pulumi.azure.blueprint.AssignmentArgs.builder
import com.pulumi.azure.blueprint.kotlin.inputs.AssignmentIdentityArgs
import com.pulumi.azure.blueprint.kotlin.inputs.AssignmentIdentityArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Manages a Blueprint Assignment resource
 * > **NOTE:** Azure Blueprints are in Preview and potentially subject to breaking change without notice.
 * > **NOTE:** Azure Blueprint Assignments can only be applied to Subscriptions.  Assignments to Management Groups is not currently supported by the service or by this provider.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const current = azure.core.getClientConfig({});
 * const example = azure.core.getSubscription({});
 * const exampleGetDefinition = example.then(example => azure.blueprint.getDefinition({
 *     name: "exampleBlueprint",
 *     scopeId: example.id,
 * }));
 * const exampleGetPublishedVersion = Promise.all([exampleGetDefinition, exampleGetDefinition]).then(([exampleGetDefinition, exampleGetDefinition1]) => azure.blueprint.getPublishedVersion({
 *     scopeId: exampleGetDefinition.scopeId,
 *     blueprintName: exampleGetDefinition1.name,
 *     version: "v1.0.0",
 * }));
 * const exampleResourceGroup = new azure.core.ResourceGroup("example", {
 *     name: "exampleRG-bp",
 *     location: "West Europe",
 *     tags: {
 *         Environment: "example",
 *     },
 * });
 * const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("example", {
 *     resourceGroupName: exampleResourceGroup.name,
 *     location: exampleResourceGroup.location,
 *     name: "bp-user-example",
 * });
 * const operator = new azure.authorization.Assignment("operator", {
 *     scope: example.then(example => example.id),
 *     roleDefinitionName: "Blueprint Operator",
 *     principalId: exampleUserAssignedIdentity.principalId,
 * });
 * const owner = new azure.authorization.Assignment("owner", {
 *     scope: example.then(example => example.id),
 *     roleDefinitionName: "Owner",
 *     principalId: exampleUserAssignedIdentity.principalId,
 * });
 * const exampleAssignment = new azure.blueprint.Assignment("example", {
 *     name: "testAccBPAssignment",
 *     targetSubscriptionId: example.then(example => example.id),
 *     versionId: exampleGetPublishedVersion.then(exampleGetPublishedVersion => exampleGetPublishedVersion.id),
 *     location: exampleResourceGroup.location,
 *     lockMode: "AllResourcesDoNotDelete",
 *     lockExcludePrincipals: [current.then(current => current.objectId)],
 *     identity: {
 *         type: "UserAssigned",
 *         identityIds: [exampleUserAssignedIdentity.id],
 *     },
 *     resourceGroups: `    {
 *       "ResourceGroup": {
 *         "name": "exampleRG-bp"
 *       }
 *     }
 * `,
 *     parameterValues: `    {
 *       "allowedlocationsforresourcegroups_listOfAllowedLocations": {
 *         "value": ["westus", "westus2", "eastus", "centralus", "centraluseuap", "southcentralus", "northcentralus", "westcentralus", "eastus2", "eastus2euap", "brazilsouth", "brazilus", "northeurope", "westeurope", "eastasia", "southeastasia", "japanwest", "japaneast", "koreacentral", "koreasouth", "indiasouth", "indiawest", "indiacentral", "australiaeast", "australiasoutheast", "canadacentral", "canadaeast", "uknorth", "uksouth2", "uksouth", "ukwest", "francecentral", "francesouth", "australiacentral", "australiacentral2", "uaecentral", "uaenorth", "southafricanorth", "southafricawest", "switzerlandnorth", "switzerlandwest", "germanynorth", "germanywestcentral", "norwayeast", "norwaywest"]
 *       }
 *     }
 * `,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * current = azure.core.get_client_config()
 * example = azure.core.get_subscription()
 * example_get_definition = azure.blueprint.get_definition(name="exampleBlueprint",
 *     scope_id=example.id)
 * example_get_published_version = azure.blueprint.get_published_version(scope_id=example_get_definition.scope_id,
 *     blueprint_name=example_get_definition.name,
 *     version="v1.0.0")
 * example_resource_group = azure.core.ResourceGroup("example",
 *     name="exampleRG-bp",
 *     location="West Europe",
 *     tags={
 *         "Environment": "example",
 *     })
 * example_user_assigned_identity = azure.authorization.UserAssignedIdentity("example",
 *     resource_group_name=example_resource_group.name,
 *     location=example_resource_group.location,
 *     name="bp-user-example")
 * operator = azure.authorization.Assignment("operator",
 *     scope=example.id,
 *     role_definition_name="Blueprint Operator",
 *     principal_id=example_user_assigned_identity.principal_id)
 * owner = azure.authorization.Assignment("owner",
 *     scope=example.id,
 *     role_definition_name="Owner",
 *     principal_id=example_user_assigned_identity.principal_id)
 * example_assignment = azure.blueprint.Assignment("example",
 *     name="testAccBPAssignment",
 *     target_subscription_id=example.id,
 *     version_id=example_get_published_version.id,
 *     location=example_resource_group.location,
 *     lock_mode="AllResourcesDoNotDelete",
 *     lock_exclude_principals=[current.object_id],
 *     identity=azure.blueprint.AssignmentIdentityArgs(
 *         type="UserAssigned",
 *         identity_ids=[example_user_assigned_identity.id],
 *     ),
 *     resource_groups="""    {
 *       "ResourceGroup": {
 *         "name": "exampleRG-bp"
 *       }
 *     }
 * """,
 *     parameter_values="""    {
 *       "allowedlocationsforresourcegroups_listOfAllowedLocations": {
 *         "value": ["westus", "westus2", "eastus", "centralus", "centraluseuap", "southcentralus", "northcentralus", "westcentralus", "eastus2", "eastus2euap", "brazilsouth", "brazilus", "northeurope", "westeurope", "eastasia", "southeastasia", "japanwest", "japaneast", "koreacentral", "koreasouth", "indiasouth", "indiawest", "indiacentral", "australiaeast", "australiasoutheast", "canadacentral", "canadaeast", "uknorth", "uksouth2", "uksouth", "ukwest", "francecentral", "francesouth", "australiacentral", "australiacentral2", "uaecentral", "uaenorth", "southafricanorth", "southafricawest", "switzerlandnorth", "switzerlandwest", "germanynorth", "germanywestcentral", "norwayeast", "norwaywest"]
 *       }
 *     }
 * """)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var current = Azure.Core.GetClientConfig.Invoke();
 *     var example = Azure.Core.GetSubscription.Invoke();
 *     var exampleGetDefinition = Azure.Blueprint.GetDefinition.Invoke(new()
 *     {
 *         Name = "exampleBlueprint",
 *         ScopeId = example.Apply(getSubscriptionResult => getSubscriptionResult.Id),
 *     });
 *     var exampleGetPublishedVersion = Azure.Blueprint.GetPublishedVersion.Invoke(new()
 *     {
 *         ScopeId = exampleGetDefinition.Apply(getDefinitionResult => getDefinitionResult.ScopeId),
 *         BlueprintName = exampleGetDefinition.Apply(getDefinitionResult => getDefinitionResult.Name),
 *         Version = "v1.0.0",
 *     });
 *     var exampleResourceGroup = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "exampleRG-bp",
 *         Location = "West Europe",
 *         Tags =
 *         {
 *             { "Environment", "example" },
 *         },
 *     });
 *     var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("example", new()
 *     {
 *         ResourceGroupName = exampleResourceGroup.Name,
 *         Location = exampleResourceGroup.Location,
 *         Name = "bp-user-example",
 *     });
 *     var @operator = new Azure.Authorization.Assignment("operator", new()
 *     {
 *         Scope = example.Apply(getSubscriptionResult => getSubscriptionResult.Id),
 *         RoleDefinitionName = "Blueprint Operator",
 *         PrincipalId = exampleUserAssignedIdentity.PrincipalId,
 *     });
 *     var owner = new Azure.Authorization.Assignment("owner", new()
 *     {
 *         Scope = example.Apply(getSubscriptionResult => getSubscriptionResult.Id),
 *         RoleDefinitionName = "Owner",
 *         PrincipalId = exampleUserAssignedIdentity.PrincipalId,
 *     });
 *     var exampleAssignment = new Azure.Blueprint.Assignment("example", new()
 *     {
 *         Name = "testAccBPAssignment",
 *         TargetSubscriptionId = example.Apply(getSubscriptionResult => getSubscriptionResult.Id),
 *         VersionId = exampleGetPublishedVersion.Apply(getPublishedVersionResult => getPublishedVersionResult.Id),
 *         Location = exampleResourceGroup.Location,
 *         LockMode = "AllResourcesDoNotDelete",
 *         LockExcludePrincipals = new[]
 *         {
 *             current.Apply(getClientConfigResult => getClientConfigResult.ObjectId),
 *         },
 *         Identity = new Azure.Blueprint.Inputs.AssignmentIdentityArgs
 *         {
 *             Type = "UserAssigned",
 *             IdentityIds = new[]
 *             {
 *                 exampleUserAssignedIdentity.Id,
 *             },
 *         },
 *         ResourceGroups = @"    {
 *       ""ResourceGroup"": {
 *         ""name"": ""exampleRG-bp""
 *       }
 *     }
 * ",
 *         ParameterValues = @"    {
 *       ""allowedlocationsforresourcegroups_listOfAllowedLocations"": {
 *         ""value"": [""westus"", ""westus2"", ""eastus"", ""centralus"", ""centraluseuap"", ""southcentralus"", ""northcentralus"", ""westcentralus"", ""eastus2"", ""eastus2euap"", ""brazilsouth"", ""brazilus"", ""northeurope"", ""westeurope"", ""eastasia"", ""southeastasia"", ""japanwest"", ""japaneast"", ""koreacentral"", ""koreasouth"", ""indiasouth"", ""indiawest"", ""indiacentral"", ""australiaeast"", ""australiasoutheast"", ""canadacentral"", ""canadaeast"", ""uknorth"", ""uksouth2"", ""uksouth"", ""ukwest"", ""francecentral"", ""francesouth"", ""australiacentral"", ""australiacentral2"", ""uaecentral"", ""uaenorth"", ""southafricanorth"", ""southafricawest"", ""switzerlandnorth"", ""switzerlandwest"", ""germanynorth"", ""germanywestcentral"", ""norwayeast"", ""norwaywest""]
 *       }
 *     }
 * ",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/blueprint"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		current, err := core.GetClientConfig(ctx, nil, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		example, err := core.LookupSubscription(ctx, nil, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleGetDefinition, err := blueprint.GetDefinition(ctx, &blueprint.GetDefinitionArgs{
 * 			Name:    "exampleBlueprint",
 * 			ScopeId: example.Id,
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleGetPublishedVersion, err := blueprint.GetPublishedVersion(ctx, &blueprint.GetPublishedVersionArgs{
 * 			ScopeId:       exampleGetDefinition.ScopeId,
 * 			BlueprintName: exampleGetDefinition.Name,
 * 			Version:       "v1.0.0",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleResourceGroup, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("exampleRG-bp"),
 * 			Location: pulumi.String("West Europe"),
 * 			Tags: pulumi.StringMap{
 * 				"Environment": pulumi.String("example"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "example", &authorization.UserAssignedIdentityArgs{
 * 			ResourceGroupName: exampleResourceGroup.Name,
 * 			Location:          exampleResourceGroup.Location,
 * 			Name:              pulumi.String("bp-user-example"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = authorization.NewAssignment(ctx, "operator", &authorization.AssignmentArgs{
 * 			Scope:              pulumi.String(example.Id),
 * 			RoleDefinitionName: pulumi.String("Blueprint Operator"),
 * 			PrincipalId:        exampleUserAssignedIdentity.PrincipalId,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = authorization.NewAssignment(ctx, "owner", &authorization.AssignmentArgs{
 * 			Scope:              pulumi.String(example.Id),
 * 			RoleDefinitionName: pulumi.String("Owner"),
 * 			PrincipalId:        exampleUserAssignedIdentity.PrincipalId,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = blueprint.NewAssignment(ctx, "example", &blueprint.AssignmentArgs{
 * 			Name:                 pulumi.String("testAccBPAssignment"),
 * 			TargetSubscriptionId: pulumi.String(example.Id),
 * 			VersionId:            pulumi.String(exampleGetPublishedVersion.Id),
 * 			Location:             exampleResourceGroup.Location,
 * 			LockMode:             pulumi.String("AllResourcesDoNotDelete"),
 * 			LockExcludePrincipals: pulumi.StringArray{
 * 				pulumi.String(current.ObjectId),
 * 			},
 * 			Identity: &blueprint.AssignmentIdentityArgs{
 * 				Type: pulumi.String("UserAssigned"),
 * 				IdentityIds: pulumi.StringArray{
 * 					exampleUserAssignedIdentity.ID(),
 * 				},
 * 			},
 * 			ResourceGroups: pulumi.String(`    {
 *       "ResourceGroup": {
 *         "name": "exampleRG-bp"
 *       }
 *     }
 * `),
 * 			ParameterValues: pulumi.String(`    {
 *       "allowedlocationsforresourcegroups_listOfAllowedLocations": {
 *         "value": ["westus", "westus2", "eastus", "centralus", "centraluseuap", "southcentralus", "northcentralus", "westcentralus", "eastus2", "eastus2euap", "brazilsouth", "brazilus", "northeurope", "westeurope", "eastasia", "southeastasia", "japanwest", "japaneast", "koreacentral", "koreasouth", "indiasouth", "indiawest", "indiacentral", "australiaeast", "australiasoutheast", "canadacentral", "canadaeast", "uknorth", "uksouth2", "uksouth", "ukwest", "francecentral", "francesouth", "australiacentral", "australiacentral2", "uaecentral", "uaenorth", "southafricanorth", "southafricawest", "switzerlandnorth", "switzerlandwest", "germanynorth", "germanywestcentral", "norwayeast", "norwaywest"]
 *       }
 *     }
 * `),
 * 		})
 * 		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.core.CoreFunctions;
 * import com.pulumi.azure.core.inputs.GetSubscriptionArgs;
 * import com.pulumi.azure.blueprint.BlueprintFunctions;
 * import com.pulumi.azure.blueprint.inputs.GetDefinitionArgs;
 * import com.pulumi.azure.blueprint.inputs.GetPublishedVersionArgs;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.authorization.UserAssignedIdentity;
 * import com.pulumi.azure.authorization.UserAssignedIdentityArgs;
 * import com.pulumi.azure.authorization.Assignment;
 * import com.pulumi.azure.authorization.AssignmentArgs;
 * import com.pulumi.azure.blueprint.Assignment;
 * import com.pulumi.azure.blueprint.AssignmentArgs;
 * import com.pulumi.azure.blueprint.inputs.AssignmentIdentityArgs;
 * 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 current = CoreFunctions.getClientConfig();
 *         final var example = CoreFunctions.getSubscription();
 *         final var exampleGetDefinition = BlueprintFunctions.getDefinition(GetDefinitionArgs.builder()
 *             .name("exampleBlueprint")
 *             .scopeId(example.applyValue(getSubscriptionResult -> getSubscriptionResult.id()))
 *             .build());
 *         final var exampleGetPublishedVersion = BlueprintFunctions.getPublishedVersion(GetPublishedVersionArgs.builder()
 *             .scopeId(exampleGetDefinition.applyValue(getDefinitionResult -> getDefinitionResult.scopeId()))
 *             .blueprintName(exampleGetDefinition.applyValue(getDefinitionResult -> getDefinitionResult.name()))
 *             .version("v1.0.0")
 *             .build());
 *         var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
 *             .name("exampleRG-bp")
 *             .location("West Europe")
 *             .tags(Map.of("Environment", "example"))
 *             .build());
 *         var exampleUserAssignedIdentity = new UserAssignedIdentity("exampleUserAssignedIdentity", UserAssignedIdentityArgs.builder()
 *             .resourceGroupName(exampleResourceGroup.name())
 *             .location(exampleResourceGroup.location())
 *             .name("bp-user-example")
 *             .build());
 *         var operator = new Assignment("operator", AssignmentArgs.builder()
 *             .scope(example.applyValue(getSubscriptionResult -> getSubscriptionResult.id()))
 *             .roleDefinitionName("Blueprint Operator")
 *             .principalId(exampleUserAssignedIdentity.principalId())
 *             .build());
 *         var owner = new Assignment("owner", AssignmentArgs.builder()
 *             .scope(example.applyValue(getSubscriptionResult -> getSubscriptionResult.id()))
 *             .roleDefinitionName("Owner")
 *             .principalId(exampleUserAssignedIdentity.principalId())
 *             .build());
 *         var exampleAssignment = new Assignment("exampleAssignment", AssignmentArgs.builder()
 *             .name("testAccBPAssignment")
 *             .targetSubscriptionId(example.applyValue(getSubscriptionResult -> getSubscriptionResult.id()))
 *             .versionId(exampleGetPublishedVersion.applyValue(getPublishedVersionResult -> getPublishedVersionResult.id()))
 *             .location(exampleResourceGroup.location())
 *             .lockMode("AllResourcesDoNotDelete")
 *             .lockExcludePrincipals(current.applyValue(getClientConfigResult -> getClientConfigResult.objectId()))
 *             .identity(AssignmentIdentityArgs.builder()
 *                 .type("UserAssigned")
 *                 .identityIds(exampleUserAssignedIdentity.id())
 *                 .build())
 *             .resourceGroups("""
 *     {
 *       "ResourceGroup": {
 *         "name": "exampleRG-bp"
 *       }
 *     }
 *             """)
 *             .parameterValues("""
 *     {
 *       "allowedlocationsforresourcegroups_listOfAllowedLocations": {
 *         "value": ["westus", "westus2", "eastus", "centralus", "centraluseuap", "southcentralus", "northcentralus", "westcentralus", "eastus2", "eastus2euap", "brazilsouth", "brazilus", "northeurope", "westeurope", "eastasia", "southeastasia", "japanwest", "japaneast", "koreacentral", "koreasouth", "indiasouth", "indiawest", "indiacentral", "australiaeast", "australiasoutheast", "canadacentral", "canadaeast", "uknorth", "uksouth2", "uksouth", "ukwest", "francecentral", "francesouth", "australiacentral", "australiacentral2", "uaecentral", "uaenorth", "southafricanorth", "southafricawest", "switzerlandnorth", "switzerlandwest", "germanynorth", "germanywestcentral", "norwayeast", "norwaywest"]
 *       }
 *     }
 *             """)
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   exampleResourceGroup:
 *     type: azure:core:ResourceGroup
 *     name: example
 *     properties:
 *       name: exampleRG-bp
 *       location: West Europe
 *       tags:
 *         Environment: example
 *   exampleUserAssignedIdentity:
 *     type: azure:authorization:UserAssignedIdentity
 *     name: example
 *     properties:
 *       resourceGroupName: ${exampleResourceGroup.name}
 *       location: ${exampleResourceGroup.location}
 *       name: bp-user-example
 *   operator:
 *     type: azure:authorization:Assignment
 *     properties:
 *       scope: ${example.id}
 *       roleDefinitionName: Blueprint Operator
 *       principalId: ${exampleUserAssignedIdentity.principalId}
 *   owner:
 *     type: azure:authorization:Assignment
 *     properties:
 *       scope: ${example.id}
 *       roleDefinitionName: Owner
 *       principalId: ${exampleUserAssignedIdentity.principalId}
 *   exampleAssignment:
 *     type: azure:blueprint:Assignment
 *     name: example
 *     properties:
 *       name: testAccBPAssignment
 *       targetSubscriptionId: ${example.id}
 *       versionId: ${exampleGetPublishedVersion.id}
 *       location: ${exampleResourceGroup.location}
 *       lockMode: AllResourcesDoNotDelete
 *       lockExcludePrincipals:
 *         - ${current.objectId}
 *       identity:
 *         type: UserAssigned
 *         identityIds:
 *           - ${exampleUserAssignedIdentity.id}
 *       resourceGroups: |2
 *             {
 *               "ResourceGroup": {
 *                 "name": "exampleRG-bp"
 *               }
 *             }
 *       parameterValues: |2
 *             {
 *               "allowedlocationsforresourcegroups_listOfAllowedLocations": {
 *                 "value": ["westus", "westus2", "eastus", "centralus", "centraluseuap", "southcentralus", "northcentralus", "westcentralus", "eastus2", "eastus2euap", "brazilsouth", "brazilus", "northeurope", "westeurope", "eastasia", "southeastasia", "japanwest", "japaneast", "koreacentral", "koreasouth", "indiasouth", "indiawest", "indiacentral", "australiaeast", "australiasoutheast", "canadacentral", "canadaeast", "uknorth", "uksouth2", "uksouth", "ukwest", "francecentral", "francesouth", "australiacentral", "australiacentral2", "uaecentral", "uaenorth", "southafricanorth", "southafricawest", "switzerlandnorth", "switzerlandwest", "germanynorth", "germanywestcentral", "norwayeast", "norwaywest"]
 *               }
 *             }
 * variables:
 *   current:
 *     fn::invoke:
 *       Function: azure:core:getClientConfig
 *       Arguments: {}
 *   example:
 *     fn::invoke:
 *       Function: azure:core:getSubscription
 *       Arguments: {}
 *   exampleGetDefinition:
 *     fn::invoke:
 *       Function: azure:blueprint:getDefinition
 *       Arguments:
 *         name: exampleBlueprint
 *         scopeId: ${example.id}
 *   exampleGetPublishedVersion:
 *     fn::invoke:
 *       Function: azure:blueprint:getPublishedVersion
 *       Arguments:
 *         scopeId: ${exampleGetDefinition.scopeId}
 *         blueprintName: ${exampleGetDefinition.name}
 *         version: v1.0.0
 * ```
 * 
 * ## Import
 * Azure Blueprint Assignments can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:blueprint/assignment:Assignment example "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint"
 * ```
 * @property identity An `identity` block as defined below.
 * @property location The Azure location of the Assignment. Changing this forces a new resource to be created.
 * @property lockExcludeActions a list of up to 200 actions that are permitted to bypass the locks applied by the Blueprint.
 * @property lockExcludePrincipals a list of up to 5 Principal IDs that are permitted to bypass the locks applied by the Blueprint.
 * @property lockMode The locking mode of the Blueprint Assignment. One of `None` (Default), `AllResourcesReadOnly`, or `AllResourcesDoNotDelete`. Defaults to `None`.
 * @property name The name of the Blueprint Assignment. Changing this forces a new resource to be created.
 * @property parameterValues a JSON string to supply Blueprint Assignment parameter values.
 * > **NOTE:** Improperly formatted JSON, or missing values required by a Blueprint will cause the assignment to fail.
 * @property resourceGroups a JSON string to supply the Blueprint Resource Group information.
 * > **NOTE:** Improperly formatted JSON, or missing values required by a Blueprint will cause the assignment to fail.
 * @property targetSubscriptionId The Subscription ID the Blueprint Published Version is to be applied to. Changing this forces a new resource to be created.
 * @property versionId The ID of the Published Version of the blueprint to be assigned.
 */
public data class AssignmentArgs(
    public val identity: Output? = null,
    public val location: Output? = null,
    public val lockExcludeActions: Output>? = null,
    public val lockExcludePrincipals: Output>? = null,
    public val lockMode: Output? = null,
    public val name: Output? = null,
    public val parameterValues: Output? = null,
    public val resourceGroups: Output? = null,
    public val targetSubscriptionId: Output? = null,
    public val versionId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.blueprint.AssignmentArgs =
        com.pulumi.azure.blueprint.AssignmentArgs.builder()
            .identity(identity?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .location(location?.applyValue({ args0 -> args0 }))
            .lockExcludeActions(lockExcludeActions?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .lockExcludePrincipals(lockExcludePrincipals?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .lockMode(lockMode?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .parameterValues(parameterValues?.applyValue({ args0 -> args0 }))
            .resourceGroups(resourceGroups?.applyValue({ args0 -> args0 }))
            .targetSubscriptionId(targetSubscriptionId?.applyValue({ args0 -> args0 }))
            .versionId(versionId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [AssignmentArgs].
 */
@PulumiTagMarker
public class AssignmentArgsBuilder internal constructor() {
    private var identity: Output? = null

    private var location: Output? = null

    private var lockExcludeActions: Output>? = null

    private var lockExcludePrincipals: Output>? = null

    private var lockMode: Output? = null

    private var name: Output? = null

    private var parameterValues: Output? = null

    private var resourceGroups: Output? = null

    private var targetSubscriptionId: Output? = null

    private var versionId: Output? = null

    /**
     * @param value An `identity` block as defined below.
     */
    @JvmName("iofiuebtpagacxsy")
    public suspend fun identity(`value`: Output) {
        this.identity = value
    }

    /**
     * @param value The Azure location of the Assignment. Changing this forces a new resource to be created.
     */
    @JvmName("pvsxwvncgwxmwktv")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value a list of up to 200 actions that are permitted to bypass the locks applied by the Blueprint.
     */
    @JvmName("vtgosqivdwdxkbnh")
    public suspend fun lockExcludeActions(`value`: Output>) {
        this.lockExcludeActions = value
    }

    @JvmName("xbriapyhmaxwxndd")
    public suspend fun lockExcludeActions(vararg values: Output) {
        this.lockExcludeActions = Output.all(values.asList())
    }

    /**
     * @param values a list of up to 200 actions that are permitted to bypass the locks applied by the Blueprint.
     */
    @JvmName("vwfcguccfeumdnqy")
    public suspend fun lockExcludeActions(values: List>) {
        this.lockExcludeActions = Output.all(values)
    }

    /**
     * @param value a list of up to 5 Principal IDs that are permitted to bypass the locks applied by the Blueprint.
     */
    @JvmName("xtyguqwcfmqiihlh")
    public suspend fun lockExcludePrincipals(`value`: Output>) {
        this.lockExcludePrincipals = value
    }

    @JvmName("vdywifwoyyscnjtt")
    public suspend fun lockExcludePrincipals(vararg values: Output) {
        this.lockExcludePrincipals = Output.all(values.asList())
    }

    /**
     * @param values a list of up to 5 Principal IDs that are permitted to bypass the locks applied by the Blueprint.
     */
    @JvmName("qcteqhnyjrshydap")
    public suspend fun lockExcludePrincipals(values: List>) {
        this.lockExcludePrincipals = Output.all(values)
    }

    /**
     * @param value The locking mode of the Blueprint Assignment. One of `None` (Default), `AllResourcesReadOnly`, or `AllResourcesDoNotDelete`. Defaults to `None`.
     */
    @JvmName("gejulbitfkxqdyqv")
    public suspend fun lockMode(`value`: Output) {
        this.lockMode = value
    }

    /**
     * @param value The name of the Blueprint Assignment. Changing this forces a new resource to be created.
     */
    @JvmName("vpjhafqqllacycji")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value a JSON string to supply Blueprint Assignment parameter values.
     * > **NOTE:** Improperly formatted JSON, or missing values required by a Blueprint will cause the assignment to fail.
     */
    @JvmName("jcdsuchsehxxflqn")
    public suspend fun parameterValues(`value`: Output) {
        this.parameterValues = value
    }

    /**
     * @param value a JSON string to supply the Blueprint Resource Group information.
     * > **NOTE:** Improperly formatted JSON, or missing values required by a Blueprint will cause the assignment to fail.
     */
    @JvmName("fllbbqgfbjcqrnqd")
    public suspend fun resourceGroups(`value`: Output) {
        this.resourceGroups = value
    }

    /**
     * @param value The Subscription ID the Blueprint Published Version is to be applied to. Changing this forces a new resource to be created.
     */
    @JvmName("mhjcvwrqwwyvlivo")
    public suspend fun targetSubscriptionId(`value`: Output) {
        this.targetSubscriptionId = value
    }

    /**
     * @param value The ID of the Published Version of the blueprint to be assigned.
     */
    @JvmName("bssghykqginyjgic")
    public suspend fun versionId(`value`: Output) {
        this.versionId = value
    }

    /**
     * @param value An `identity` block as defined below.
     */
    @JvmName("fqachhtiheneplxp")
    public suspend fun identity(`value`: AssignmentIdentityArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.identity = mapped
    }

    /**
     * @param argument An `identity` block as defined below.
     */
    @JvmName("thtbeetkdwvlqwmy")
    public suspend fun identity(argument: suspend AssignmentIdentityArgsBuilder.() -> Unit) {
        val toBeMapped = AssignmentIdentityArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.identity = mapped
    }

    /**
     * @param value The Azure location of the Assignment. Changing this forces a new resource to be created.
     */
    @JvmName("fycgfvpwonhfmxyy")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value a list of up to 200 actions that are permitted to bypass the locks applied by the Blueprint.
     */
    @JvmName("satsurmiuynnnxqd")
    public suspend fun lockExcludeActions(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.lockExcludeActions = mapped
    }

    /**
     * @param values a list of up to 200 actions that are permitted to bypass the locks applied by the Blueprint.
     */
    @JvmName("gtjfkogsgehclgmy")
    public suspend fun lockExcludeActions(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.lockExcludeActions = mapped
    }

    /**
     * @param value a list of up to 5 Principal IDs that are permitted to bypass the locks applied by the Blueprint.
     */
    @JvmName("qelexhsmvvidosra")
    public suspend fun lockExcludePrincipals(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.lockExcludePrincipals = mapped
    }

    /**
     * @param values a list of up to 5 Principal IDs that are permitted to bypass the locks applied by the Blueprint.
     */
    @JvmName("lrewyhfswyhibpvo")
    public suspend fun lockExcludePrincipals(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.lockExcludePrincipals = mapped
    }

    /**
     * @param value The locking mode of the Blueprint Assignment. One of `None` (Default), `AllResourcesReadOnly`, or `AllResourcesDoNotDelete`. Defaults to `None`.
     */
    @JvmName("dnxuxkkvchtvkkxy")
    public suspend fun lockMode(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.lockMode = mapped
    }

    /**
     * @param value The name of the Blueprint Assignment. Changing this forces a new resource to be created.
     */
    @JvmName("dxgbmyyvtulkptmh")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value a JSON string to supply Blueprint Assignment parameter values.
     * > **NOTE:** Improperly formatted JSON, or missing values required by a Blueprint will cause the assignment to fail.
     */
    @JvmName("pktdaehrvyhpfevl")
    public suspend fun parameterValues(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.parameterValues = mapped
    }

    /**
     * @param value a JSON string to supply the Blueprint Resource Group information.
     * > **NOTE:** Improperly formatted JSON, or missing values required by a Blueprint will cause the assignment to fail.
     */
    @JvmName("ifuiuewgdatftuls")
    public suspend fun resourceGroups(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroups = mapped
    }

    /**
     * @param value The Subscription ID the Blueprint Published Version is to be applied to. Changing this forces a new resource to be created.
     */
    @JvmName("ogpydyvdxabibaqr")
    public suspend fun targetSubscriptionId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.targetSubscriptionId = mapped
    }

    /**
     * @param value The ID of the Published Version of the blueprint to be assigned.
     */
    @JvmName("fxqshbpdiqwfxswo")
    public suspend fun versionId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.versionId = mapped
    }

    internal fun build(): AssignmentArgs = AssignmentArgs(
        identity = identity,
        location = location,
        lockExcludeActions = lockExcludeActions,
        lockExcludePrincipals = lockExcludePrincipals,
        lockMode = lockMode,
        name = name,
        parameterValues = parameterValues,
        resourceGroups = resourceGroups,
        targetSubscriptionId = targetSubscriptionId,
        versionId = versionId,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy