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

com.pulumi.azure.lighthouse.kotlin.DefinitionArgs.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.lighthouse.kotlin

import com.pulumi.azure.lighthouse.DefinitionArgs.builder
import com.pulumi.azure.lighthouse.kotlin.inputs.DefinitionAuthorizationArgs
import com.pulumi.azure.lighthouse.kotlin.inputs.DefinitionAuthorizationArgsBuilder
import com.pulumi.azure.lighthouse.kotlin.inputs.DefinitionEligibleAuthorizationArgs
import com.pulumi.azure.lighthouse.kotlin.inputs.DefinitionEligibleAuthorizationArgsBuilder
import com.pulumi.azure.lighthouse.kotlin.inputs.DefinitionPlanArgs
import com.pulumi.azure.lighthouse.kotlin.inputs.DefinitionPlanArgsBuilder
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 [Lighthouse](https://docs.microsoft.com/azure/lighthouse) Definition.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const contributor = azure.authorization.getRoleDefinition({
 *     roleDefinitionId: "b24988ac-6180-42a0-ab88-20f7382dd24c",
 * });
 * const example = new azure.lighthouse.Definition("example", {
 *     name: "Sample definition",
 *     description: "This is a lighthouse definition created IaC",
 *     managingTenantId: "00000000-0000-0000-0000-000000000000",
 *     scope: "/subscriptions/00000000-0000-0000-0000-000000000000",
 *     authorizations: [{
 *         principalId: "00000000-0000-0000-0000-000000000000",
 *         roleDefinitionId: contributor.then(contributor => contributor.roleDefinitionId),
 *         principalDisplayName: "Tier 1 Support",
 *     }],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * contributor = azure.authorization.get_role_definition(role_definition_id="b24988ac-6180-42a0-ab88-20f7382dd24c")
 * example = azure.lighthouse.Definition("example",
 *     name="Sample definition",
 *     description="This is a lighthouse definition created IaC",
 *     managing_tenant_id="00000000-0000-0000-0000-000000000000",
 *     scope="/subscriptions/00000000-0000-0000-0000-000000000000",
 *     authorizations=[azure.lighthouse.DefinitionAuthorizationArgs(
 *         principal_id="00000000-0000-0000-0000-000000000000",
 *         role_definition_id=contributor.role_definition_id,
 *         principal_display_name="Tier 1 Support",
 *     )])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var contributor = Azure.Authorization.GetRoleDefinition.Invoke(new()
 *     {
 *         RoleDefinitionId = "b24988ac-6180-42a0-ab88-20f7382dd24c",
 *     });
 *     var example = new Azure.Lighthouse.Definition("example", new()
 *     {
 *         Name = "Sample definition",
 *         Description = "This is a lighthouse definition created IaC",
 *         ManagingTenantId = "00000000-0000-0000-0000-000000000000",
 *         Scope = "/subscriptions/00000000-0000-0000-0000-000000000000",
 *         Authorizations = new[]
 *         {
 *             new Azure.Lighthouse.Inputs.DefinitionAuthorizationArgs
 *             {
 *                 PrincipalId = "00000000-0000-0000-0000-000000000000",
 *                 RoleDefinitionId = contributor.Apply(getRoleDefinitionResult => getRoleDefinitionResult.RoleDefinitionId),
 *                 PrincipalDisplayName = "Tier 1 Support",
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/lighthouse"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		contributor, err := authorization.LookupRoleDefinition(ctx, &authorization.LookupRoleDefinitionArgs{
 * 			RoleDefinitionId: pulumi.StringRef("b24988ac-6180-42a0-ab88-20f7382dd24c"),
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = lighthouse.NewDefinition(ctx, "example", &lighthouse.DefinitionArgs{
 * 			Name:             pulumi.String("Sample definition"),
 * 			Description:      pulumi.String("This is a lighthouse definition created IaC"),
 * 			ManagingTenantId: pulumi.String("00000000-0000-0000-0000-000000000000"),
 * 			Scope:            pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000"),
 * 			Authorizations: lighthouse.DefinitionAuthorizationArray{
 * 				&lighthouse.DefinitionAuthorizationArgs{
 * 					PrincipalId:          pulumi.String("00000000-0000-0000-0000-000000000000"),
 * 					RoleDefinitionId:     pulumi.String(contributor.RoleDefinitionId),
 * 					PrincipalDisplayName: pulumi.String("Tier 1 Support"),
 * 				},
 * 			},
 * 		})
 * 		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.authorization.AuthorizationFunctions;
 * import com.pulumi.azure.authorization.inputs.GetRoleDefinitionArgs;
 * import com.pulumi.azure.lighthouse.Definition;
 * import com.pulumi.azure.lighthouse.DefinitionArgs;
 * import com.pulumi.azure.lighthouse.inputs.DefinitionAuthorizationArgs;
 * 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 contributor = AuthorizationFunctions.getRoleDefinition(GetRoleDefinitionArgs.builder()
 *             .roleDefinitionId("b24988ac-6180-42a0-ab88-20f7382dd24c")
 *             .build());
 *         var example = new Definition("example", DefinitionArgs.builder()
 *             .name("Sample definition")
 *             .description("This is a lighthouse definition created IaC")
 *             .managingTenantId("00000000-0000-0000-0000-000000000000")
 *             .scope("/subscriptions/00000000-0000-0000-0000-000000000000")
 *             .authorizations(DefinitionAuthorizationArgs.builder()
 *                 .principalId("00000000-0000-0000-0000-000000000000")
 *                 .roleDefinitionId(contributor.applyValue(getRoleDefinitionResult -> getRoleDefinitionResult.roleDefinitionId()))
 *                 .principalDisplayName("Tier 1 Support")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:lighthouse:Definition
 *     properties:
 *       name: Sample definition
 *       description: This is a lighthouse definition created IaC
 *       managingTenantId: 00000000-0000-0000-0000-000000000000
 *       scope: /subscriptions/00000000-0000-0000-0000-000000000000
 *       authorizations:
 *         - principalId: 00000000-0000-0000-0000-000000000000
 *           roleDefinitionId: ${contributor.roleDefinitionId}
 *           principalDisplayName: Tier 1 Support
 * variables:
 *   contributor:
 *     fn::invoke:
 *       Function: azure:authorization:getRoleDefinition
 *       Arguments:
 *         roleDefinitionId: b24988ac-6180-42a0-ab88-20f7382dd24c
 * ```
 * 
 * ## Import
 * Lighthouse Definitions can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:lighthouse/definition:Definition example /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ManagedServices/registrationDefinitions/00000000-0000-0000-0000-000000000000
 * ```
 * @property authorizations An `authorization` block as defined below.
 * @property description A description of the Lighthouse Definition.
 * @property eligibleAuthorizations An `eligible_authorization` block as defined below.
 * @property lighthouseDefinitionId A unique UUID/GUID which identifies this lighthouse definition - one will be generated if not specified. Changing this forces a new resource to be created.
 * @property managingTenantId The ID of the managing tenant. Changing this forces a new resource to be created.
 * @property name The name of the Lighthouse Definition. Changing this forces a new resource to be created.
 * @property plan A `plan` block as defined below.
 * @property scope The ID of the managed subscription. Changing this forces a new resource to be created.
 */
public data class DefinitionArgs(
    public val authorizations: Output>? = null,
    public val description: Output? = null,
    public val eligibleAuthorizations: Output>? = null,
    public val lighthouseDefinitionId: Output? = null,
    public val managingTenantId: Output? = null,
    public val name: Output? = null,
    public val plan: Output? = null,
    public val scope: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.lighthouse.DefinitionArgs =
        com.pulumi.azure.lighthouse.DefinitionArgs.builder()
            .authorizations(
                authorizations?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .description(description?.applyValue({ args0 -> args0 }))
            .eligibleAuthorizations(
                eligibleAuthorizations?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .lighthouseDefinitionId(lighthouseDefinitionId?.applyValue({ args0 -> args0 }))
            .managingTenantId(managingTenantId?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .plan(plan?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .scope(scope?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [DefinitionArgs].
 */
@PulumiTagMarker
public class DefinitionArgsBuilder internal constructor() {
    private var authorizations: Output>? = null

    private var description: Output? = null

    private var eligibleAuthorizations: Output>? = null

    private var lighthouseDefinitionId: Output? = null

    private var managingTenantId: Output? = null

    private var name: Output? = null

    private var plan: Output? = null

    private var scope: Output? = null

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

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

    /**
     * @param values An `authorization` block as defined below.
     */
    @JvmName("wiaumrhdejkvfjma")
    public suspend fun authorizations(values: List>) {
        this.authorizations = Output.all(values)
    }

    /**
     * @param value A description of the Lighthouse Definition.
     */
    @JvmName("jfiwbahxxrhpnowv")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

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

    @JvmName("ittctpbyaybedcfr")
    public suspend fun eligibleAuthorizations(
        vararg
        values: Output,
    ) {
        this.eligibleAuthorizations = Output.all(values.asList())
    }

    /**
     * @param values An `eligible_authorization` block as defined below.
     */
    @JvmName("ayabugmsqoxyyixo")
    public suspend
    fun eligibleAuthorizations(values: List>) {
        this.eligibleAuthorizations = Output.all(values)
    }

    /**
     * @param value A unique UUID/GUID which identifies this lighthouse definition - one will be generated if not specified. Changing this forces a new resource to be created.
     */
    @JvmName("kwyrpmelmhukoniv")
    public suspend fun lighthouseDefinitionId(`value`: Output) {
        this.lighthouseDefinitionId = value
    }

    /**
     * @param value The ID of the managing tenant. Changing this forces a new resource to be created.
     */
    @JvmName("dookesvxmcutxgfw")
    public suspend fun managingTenantId(`value`: Output) {
        this.managingTenantId = value
    }

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

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

    /**
     * @param value The ID of the managed subscription. Changing this forces a new resource to be created.
     */
    @JvmName("bxwriwxsmyvsvdcy")
    public suspend fun scope(`value`: Output) {
        this.scope = value
    }

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

    /**
     * @param argument An `authorization` block as defined below.
     */
    @JvmName("bmdxojjfdqdayken")
    public suspend
    fun authorizations(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            DefinitionAuthorizationArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.authorizations = mapped
    }

    /**
     * @param argument An `authorization` block as defined below.
     */
    @JvmName("dusgnhchyohollbq")
    public suspend fun authorizations(
        vararg
        argument: suspend DefinitionAuthorizationArgsBuilder.() -> Unit,
    ) {
        val toBeMapped = argument.toList().map {
            DefinitionAuthorizationArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.authorizations = mapped
    }

    /**
     * @param argument An `authorization` block as defined below.
     */
    @JvmName("fihntxybtymrbvxu")
    public suspend
    fun authorizations(argument: suspend DefinitionAuthorizationArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            DefinitionAuthorizationArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.authorizations = mapped
    }

    /**
     * @param values An `authorization` block as defined below.
     */
    @JvmName("rovpwcaomxshmpgp")
    public suspend fun authorizations(vararg values: DefinitionAuthorizationArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.authorizations = mapped
    }

    /**
     * @param value A description of the Lighthouse Definition.
     */
    @JvmName("shmmvtepeunfhqsb")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

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

    /**
     * @param argument An `eligible_authorization` block as defined below.
     */
    @JvmName("ksrraldtyqicansa")
    public suspend
    fun eligibleAuthorizations(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            DefinitionEligibleAuthorizationArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.eligibleAuthorizations = mapped
    }

    /**
     * @param argument An `eligible_authorization` block as defined below.
     */
    @JvmName("hxllrwjooxesgqgh")
    public suspend fun eligibleAuthorizations(
        vararg
        argument: suspend DefinitionEligibleAuthorizationArgsBuilder.() -> Unit,
    ) {
        val toBeMapped = argument.toList().map {
            DefinitionEligibleAuthorizationArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.eligibleAuthorizations = mapped
    }

    /**
     * @param argument An `eligible_authorization` block as defined below.
     */
    @JvmName("bgphuyaenfyxheme")
    public suspend
    fun eligibleAuthorizations(argument: suspend DefinitionEligibleAuthorizationArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            DefinitionEligibleAuthorizationArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.eligibleAuthorizations = mapped
    }

    /**
     * @param values An `eligible_authorization` block as defined below.
     */
    @JvmName("tfaapitvufgwfqun")
    public suspend fun eligibleAuthorizations(vararg values: DefinitionEligibleAuthorizationArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.eligibleAuthorizations = mapped
    }

    /**
     * @param value A unique UUID/GUID which identifies this lighthouse definition - one will be generated if not specified. Changing this forces a new resource to be created.
     */
    @JvmName("bndqtwoppbdvhkwq")
    public suspend fun lighthouseDefinitionId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.lighthouseDefinitionId = mapped
    }

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

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

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

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

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

    internal fun build(): DefinitionArgs = DefinitionArgs(
        authorizations = authorizations,
        description = description,
        eligibleAuthorizations = eligibleAuthorizations,
        lighthouseDefinitionId = lighthouseDefinitionId,
        managingTenantId = managingTenantId,
        name = name,
        plan = plan,
        scope = scope,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy