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

com.pulumi.vault.identity.kotlin.EntityAlias.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.6.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.vault.identity.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 [EntityAlias].
 */
@PulumiTagMarker
public class EntityAliasResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: EntityAliasArgs = EntityAliasArgs()

    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 EntityAliasArgsBuilder.() -> Unit) {
        val builder = EntityAliasArgsBuilder()
        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(): EntityAlias {
        val builtJavaResource = com.pulumi.vault.identity.EntityAlias(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return EntityAlias(builtJavaResource)
    }
}

/**
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as vault from "@pulumi/vault";
 * const test = new vault.identity.EntityAlias("test", {
 *     name: "user_1",
 *     mountAccessor: "token_1f2bd5",
 *     canonicalId: "49877D63-07AD-4B85-BDA8-B61626C477E8",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_vault as vault
 * test = vault.identity.EntityAlias("test",
 *     name="user_1",
 *     mount_accessor="token_1f2bd5",
 *     canonical_id="49877D63-07AD-4B85-BDA8-B61626C477E8")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Vault = Pulumi.Vault;
 * return await Deployment.RunAsync(() =>
 * {
 *     var test = new Vault.Identity.EntityAlias("test", new()
 *     {
 *         Name = "user_1",
 *         MountAccessor = "token_1f2bd5",
 *         CanonicalId = "49877D63-07AD-4B85-BDA8-B61626C477E8",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault/identity"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := identity.NewEntityAlias(ctx, "test", &identity.EntityAliasArgs{
 * 			Name:          pulumi.String("user_1"),
 * 			MountAccessor: pulumi.String("token_1f2bd5"),
 * 			CanonicalId:   pulumi.String("49877D63-07AD-4B85-BDA8-B61626C477E8"),
 * 		})
 * 		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.vault.identity.EntityAlias;
 * import com.pulumi.vault.identity.EntityAliasArgs;
 * 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 test = new EntityAlias("test", EntityAliasArgs.builder()
 *             .name("user_1")
 *             .mountAccessor("token_1f2bd5")
 *             .canonicalId("49877D63-07AD-4B85-BDA8-B61626C477E8")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   test:
 *     type: vault:identity:EntityAlias
 *     properties:
 *       name: user_1
 *       mountAccessor: token_1f2bd5
 *       canonicalId: 49877D63-07AD-4B85-BDA8-B61626C477E8
 * ```
 * 
 * ## Import
 * Identity entity alias can be imported using the `id`, e.g.
 * ```sh
 * $ pulumi import vault:identity/entityAlias:EntityAlias test "3856fb4d-3c91-dcaf-2401-68f446796bfb"
 * ```
 */
public class EntityAlias internal constructor(
    override val javaResource: com.pulumi.vault.identity.EntityAlias,
) : KotlinCustomResource(javaResource, EntityAliasMapper) {
    /**
     * Entity ID to which this alias belongs to.
     */
    public val canonicalId: Output
        get() = javaResource.canonicalId().applyValue({ args0 -> args0 })

    /**
     * Custom metadata to be associated with this alias.
     */
    public val customMetadata: Output>?
        get() = javaResource.customMetadata().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 -> args0.key.to(args0.value) }).toMap()
            }).orElse(null)
        })

    /**
     * Accessor of the mount to which the alias should belong to.
     */
    public val mountAccessor: Output
        get() = javaResource.mountAccessor().applyValue({ args0 -> args0 })

    /**
     * Name of the alias. Name should be the identifier of the client in the authentication source. For example, if the alias belongs to userpass backend, the name should be a valid username within userpass backend. If alias belongs to GitHub, it should be the GitHub username.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The namespace to provision the resource in.
     * The value should not contain leading or trailing forward slashes.
     * The `namespace` is always relative to the provider's configured [namespace](https://www.terraform.io/docs/providers/vault/index.html#namespace).
     * *Available only for Vault Enterprise*.
     */
    public val namespace: Output?
        get() = javaResource.namespace().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
}

public object EntityAliasMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.vault.identity.EntityAlias::class == javaResource::class

    override fun map(javaResource: Resource): EntityAlias = EntityAlias(
        javaResource as
            com.pulumi.vault.identity.EntityAlias,
    )
}

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy