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

com.pulumi.azure.armmsi.kotlin.FederatedIdentityCredential.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.armmsi.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

/**
 * Builder for [FederatedIdentityCredential].
 */
@PulumiTagMarker
public class FederatedIdentityCredentialResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: FederatedIdentityCredentialArgs = FederatedIdentityCredentialArgs()

    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 FederatedIdentityCredentialArgsBuilder.() -> Unit) {
        val builder = FederatedIdentityCredentialArgsBuilder()
        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(): FederatedIdentityCredential {
        val builtJavaResource =
            com.pulumi.azure.armmsi.FederatedIdentityCredential(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return FederatedIdentityCredential(builtJavaResource)
    }
}

/**
 * Manages a Federated Identity Credential.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example",
 *     location: "West Europe",
 * });
 * const exampleUserAssignedIdentity = new azure.authorization.UserAssignedIdentity("example", {
 *     location: example.location,
 *     name: "example",
 *     resourceGroupName: example.name,
 * });
 * const exampleFederatedIdentityCredential = new azure.armmsi.FederatedIdentityCredential("example", {
 *     name: "example",
 *     resourceGroupName: example.name,
 *     audience: "foo",
 *     issuer: "https://foo",
 *     parentId: exampleUserAssignedIdentity.id,
 *     subject: "foo",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example",
 *     location="West Europe")
 * example_user_assigned_identity = azure.authorization.UserAssignedIdentity("example",
 *     location=example.location,
 *     name="example",
 *     resource_group_name=example.name)
 * example_federated_identity_credential = azure.armmsi.FederatedIdentityCredential("example",
 *     name="example",
 *     resource_group_name=example.name,
 *     audience="foo",
 *     issuer="https://foo",
 *     parent_id=example_user_assigned_identity.id,
 *     subject="foo")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example",
 *         Location = "West Europe",
 *     });
 *     var exampleUserAssignedIdentity = new Azure.Authorization.UserAssignedIdentity("example", new()
 *     {
 *         Location = example.Location,
 *         Name = "example",
 *         ResourceGroupName = example.Name,
 *     });
 *     var exampleFederatedIdentityCredential = new Azure.ArmMsi.FederatedIdentityCredential("example", new()
 *     {
 *         Name = "example",
 *         ResourceGroupName = example.Name,
 *         Audience = "foo",
 *         Issuer = "https://foo",
 *         ParentId = exampleUserAssignedIdentity.Id,
 *         Subject = "foo",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/armmsi"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/authorization"
 * 	"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 {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleUserAssignedIdentity, err := authorization.NewUserAssignedIdentity(ctx, "example", &authorization.UserAssignedIdentityArgs{
 * 			Location:          example.Location,
 * 			Name:              pulumi.String("example"),
 * 			ResourceGroupName: example.Name,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = armmsi.NewFederatedIdentityCredential(ctx, "example", &armmsi.FederatedIdentityCredentialArgs{
 * 			Name:              pulumi.String("example"),
 * 			ResourceGroupName: example.Name,
 * 			Audience:          pulumi.String("foo"),
 * 			Issuer:            pulumi.String("https://foo"),
 * 			ParentId:          exampleUserAssignedIdentity.ID(),
 * 			Subject:           pulumi.String("foo"),
 * 		})
 * 		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.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.authorization.UserAssignedIdentity;
 * import com.pulumi.azure.authorization.UserAssignedIdentityArgs;
 * import com.pulumi.azure.armmsi.FederatedIdentityCredential;
 * import com.pulumi.azure.armmsi.FederatedIdentityCredentialArgs;
 * 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) {
 *         var example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example")
 *             .location("West Europe")
 *             .build());
 *         var exampleUserAssignedIdentity = new UserAssignedIdentity("exampleUserAssignedIdentity", UserAssignedIdentityArgs.builder()
 *             .location(example.location())
 *             .name("example")
 *             .resourceGroupName(example.name())
 *             .build());
 *         var exampleFederatedIdentityCredential = new FederatedIdentityCredential("exampleFederatedIdentityCredential", FederatedIdentityCredentialArgs.builder()
 *             .name("example")
 *             .resourceGroupName(example.name())
 *             .audience("foo")
 *             .issuer("https://foo")
 *             .parentId(exampleUserAssignedIdentity.id())
 *             .subject("foo")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example
 *       location: West Europe
 *   exampleUserAssignedIdentity:
 *     type: azure:authorization:UserAssignedIdentity
 *     name: example
 *     properties:
 *       location: ${example.location}
 *       name: example
 *       resourceGroupName: ${example.name}
 *   exampleFederatedIdentityCredential:
 *     type: azure:armmsi:FederatedIdentityCredential
 *     name: example
 *     properties:
 *       name: example
 *       resourceGroupName: ${example.name}
 *       audience: foo
 *       issuer: https://foo
 *       parentId: ${exampleUserAssignedIdentity.id}
 *       subject: foo
 * ```
 * 
 * ## Import
 * An existing Federated Identity Credential can be imported into Terraform using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:armmsi/federatedIdentityCredential:FederatedIdentityCredential example /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{parentIdentityName}/federatedIdentityCredentials/{resourceName}
 * ```
 */
public class FederatedIdentityCredential internal constructor(
    override val javaResource: com.pulumi.azure.armmsi.FederatedIdentityCredential,
) : KotlinCustomResource(javaResource, FederatedIdentityCredentialMapper) {
    /**
     * Specifies the audience for this Federated Identity Credential.
     */
    public val audience: Output
        get() = javaResource.audience().applyValue({ args0 -> args0 })

    /**
     * Specifies the issuer of this Federated Identity Credential.
     */
    public val issuer: Output
        get() = javaResource.issuer().applyValue({ args0 -> args0 })

    /**
     * Specifies the name of this Federated Identity Credential. Changing this forces a new resource to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Specifies parent ID of User Assigned Identity for this Federated Identity Credential. Changing this forces a new Federated Identity Credential to be created.
     */
    public val parentId: Output
        get() = javaResource.parentId().applyValue({ args0 -> args0 })

    /**
     * Specifies the name of the Resource Group within which this Federated Identity Credential should exist. Changing this forces a new Federated Identity Credential to be created.
     */
    public val resourceGroupName: Output
        get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })

    /**
     * Specifies the subject for this Federated Identity Credential.
     */
    public val subject: Output
        get() = javaResource.subject().applyValue({ args0 -> args0 })
}

public object FederatedIdentityCredentialMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.armmsi.FederatedIdentityCredential::class == javaResource::class

    override fun map(javaResource: Resource): FederatedIdentityCredential =
        FederatedIdentityCredential(
            javaResource as
                com.pulumi.azure.armmsi.FederatedIdentityCredential,
        )
}

/**
 * @see [FederatedIdentityCredential].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [FederatedIdentityCredential].
 */
public suspend fun federatedIdentityCredential(
    name: String,
    block: suspend FederatedIdentityCredentialResourceBuilder.() -> Unit,
): FederatedIdentityCredential {
    val builder = FederatedIdentityCredentialResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [FederatedIdentityCredential].
 * @param name The _unique_ name of the resulting resource.
 */
public fun federatedIdentityCredential(name: String): FederatedIdentityCredential {
    val builder = FederatedIdentityCredentialResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy