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

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

package com.pulumi.vault.aws.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.List

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

    public var args: AuthBackendConfigIdentityArgs = AuthBackendConfigIdentityArgs()

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

/**
 * Manages an AWS auth backend identity configuration in a Vault server. This configuration defines how Vault interacts
 * with the identity store. See the [Vault documentation](https://www.vaultproject.io/docs/auth/aws.html) for more
 * information.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as vault from "@pulumi/vault";
 * const aws = new vault.AuthBackend("aws", {type: "aws"});
 * const example = new vault.aws.AuthBackendConfigIdentity("example", {
 *     backend: aws.path,
 *     iamAlias: "full_arn",
 *     iamMetadatas: [
 *         "canonical_arn",
 *         "account_id",
 *     ],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_vault as vault
 * aws = vault.AuthBackend("aws", type="aws")
 * example = vault.aws.AuthBackendConfigIdentity("example",
 *     backend=aws.path,
 *     iam_alias="full_arn",
 *     iam_metadatas=[
 *         "canonical_arn",
 *         "account_id",
 *     ])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Vault = Pulumi.Vault;
 * return await Deployment.RunAsync(() =>
 * {
 *     var aws = new Vault.AuthBackend("aws", new()
 *     {
 *         Type = "aws",
 *     });
 *     var example = new Vault.Aws.AuthBackendConfigIdentity("example", new()
 *     {
 *         Backend = aws.Path,
 *         IamAlias = "full_arn",
 *         IamMetadatas = new[]
 *         {
 *             "canonical_arn",
 *             "account_id",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault"
 * 	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault/aws"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		aws, err := vault.NewAuthBackend(ctx, "aws", &vault.AuthBackendArgs{
 * 			Type: pulumi.String("aws"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = aws.NewAuthBackendConfigIdentity(ctx, "example", &aws.AuthBackendConfigIdentityArgs{
 * 			Backend:  aws.Path,
 * 			IamAlias: pulumi.String("full_arn"),
 * 			IamMetadatas: pulumi.StringArray{
 * 				pulumi.String("canonical_arn"),
 * 				pulumi.String("account_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.vault.AuthBackend;
 * import com.pulumi.vault.AuthBackendArgs;
 * import com.pulumi.vault.aws.AuthBackendConfigIdentity;
 * import com.pulumi.vault.aws.AuthBackendConfigIdentityArgs;
 * 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 aws = new AuthBackend("aws", AuthBackendArgs.builder()
 *             .type("aws")
 *             .build());
 *         var example = new AuthBackendConfigIdentity("example", AuthBackendConfigIdentityArgs.builder()
 *             .backend(aws.path())
 *             .iamAlias("full_arn")
 *             .iamMetadatas(
 *                 "canonical_arn",
 *                 "account_id")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   aws:
 *     type: vault:AuthBackend
 *     properties:
 *       type: aws
 *   example:
 *     type: vault:aws:AuthBackendConfigIdentity
 *     properties:
 *       backend: ${aws.path}
 *       iamAlias: full_arn
 *       iamMetadatas:
 *         - canonical_arn
 *         - account_id
 * ```
 * 
 * ## Import
 * AWS auth backend identity config can be imported using `auth/`, the `backend` path, and `/config/identity` e.g.
 * ```sh
 * $ pulumi import vault:aws/authBackendConfigIdentity:AuthBackendConfigIdentity example auth/aws/config/identity
 * ```
 */
public class AuthBackendConfigIdentity internal constructor(
    override val javaResource: com.pulumi.vault.aws.AuthBackendConfigIdentity,
) : KotlinCustomResource(javaResource, AuthBackendConfigIdentityMapper) {
    /**
     * Unique name of the auth backend to configure.
     */
    public val backend: Output?
        get() = javaResource.backend().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * How to generate the identity alias when using the ec2 auth method. Valid choices are
     * `role_id`, `instance_id`, and `image_id`. Defaults to `role_id`
     */
    public val ec2Alias: Output?
        get() = javaResource.ec2Alias().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The metadata to include on the token returned by the `login` endpoint. This metadata will be
     * added to both audit logs, and on the `ec2_alias`
     */
    public val ec2Metadatas: Output>?
        get() = javaResource.ec2Metadatas().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * How to generate the identity alias when using the iam auth method. Valid choices are
     * `role_id`, `unique_id`, and `full_arn`. Defaults to `role_id`
     */
    public val iamAlias: Output?
        get() = javaResource.iamAlias().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The metadata to include on the token returned by the `login` endpoint. This metadata will be
     * added to both audit logs, and on the `iam_alias`
     */
    public val iamMetadatas: Output>?
        get() = javaResource.iamMetadatas().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * 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 AuthBackendConfigIdentityMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.vault.aws.AuthBackendConfigIdentity::class == javaResource::class

    override fun map(javaResource: Resource): AuthBackendConfigIdentity =
        AuthBackendConfigIdentity(javaResource as com.pulumi.vault.aws.AuthBackendConfigIdentity)
}

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy