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

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

package com.pulumi.aws.datazone.kotlin

import com.pulumi.aws.datazone.kotlin.outputs.UserProfileDetail
import com.pulumi.aws.datazone.kotlin.outputs.UserProfileTimeouts
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
import com.pulumi.aws.datazone.kotlin.outputs.UserProfileDetail.Companion.toKotlin as userProfileDetailToKotlin
import com.pulumi.aws.datazone.kotlin.outputs.UserProfileTimeouts.Companion.toKotlin as userProfileTimeoutsToKotlin

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

    public var args: UserProfileArgs = UserProfileArgs()

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

/**
 * Resource for managing an AWS DataZone User Profile.
 * ## Example Usage
 * ### Basic Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const example = new aws.datazone.UserProfile("example", {
 *     userIdentifier: exampleAwsIamUser.arn,
 *     domainIdentifier: exampleAwsDatazoneDomain.id,
 *     userType: "IAM_USER",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * example = aws.datazone.UserProfile("example",
 *     user_identifier=example_aws_iam_user["arn"],
 *     domain_identifier=example_aws_datazone_domain["id"],
 *     user_type="IAM_USER")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Aws.DataZone.UserProfile("example", new()
 *     {
 *         UserIdentifier = exampleAwsIamUser.Arn,
 *         DomainIdentifier = exampleAwsDatazoneDomain.Id,
 *         UserType = "IAM_USER",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/datazone"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := datazone.NewUserProfile(ctx, "example", &datazone.UserProfileArgs{
 * 			UserIdentifier:   pulumi.Any(exampleAwsIamUser.Arn),
 * 			DomainIdentifier: pulumi.Any(exampleAwsDatazoneDomain.Id),
 * 			UserType:         pulumi.String("IAM_USER"),
 * 		})
 * 		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.aws.datazone.UserProfile;
 * import com.pulumi.aws.datazone.UserProfileArgs;
 * 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 UserProfile("example", UserProfileArgs.builder()
 *             .userIdentifier(exampleAwsIamUser.arn())
 *             .domainIdentifier(exampleAwsDatazoneDomain.id())
 *             .userType("IAM_USER")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: aws:datazone:UserProfile
 *     properties:
 *       userIdentifier: ${exampleAwsIamUser.arn}
 *       domainIdentifier: ${exampleAwsDatazoneDomain.id}
 *       userType: IAM_USER
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import DataZone User Profile using the `user_identifier,domain_identifier,type`. For example:
 * ```sh
 * $ pulumi import aws:datazone/userProfile:UserProfile example arn:aws:iam::123456789012:user/example,dzd_54nakfrg9k6suo,IAM
 * ```
 */
public class UserProfile internal constructor(
    override val javaResource: com.pulumi.aws.datazone.UserProfile,
) : KotlinCustomResource(javaResource, UserProfileMapper) {
    /**
     * Details about the user profile.
     */
    public val details: Output>
        get() = javaResource.details().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    userProfileDetailToKotlin(args0)
                })
            })
        })

    /**
     * The domain identifier.
     */
    public val domainIdentifier: Output
        get() = javaResource.domainIdentifier().applyValue({ args0 -> args0 })

    /**
     * The user profile status.
     */
    public val status: Output
        get() = javaResource.status().applyValue({ args0 -> args0 })

    public val timeouts: Output?
        get() = javaResource.timeouts().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    userProfileTimeoutsToKotlin(args0)
                })
            }).orElse(null)
        })

    /**
     * The user profile type.
     */
    public val type: Output
        get() = javaResource.type().applyValue({ args0 -> args0 })

    /**
     * The user identifier.
     * The following arguments are optional:
     */
    public val userIdentifier: Output
        get() = javaResource.userIdentifier().applyValue({ args0 -> args0 })

    /**
     * The user type.
     */
    public val userType: Output
        get() = javaResource.userType().applyValue({ args0 -> args0 })
}

public object UserProfileMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.aws.datazone.UserProfile::class == javaResource::class

    override fun map(javaResource: Resource): UserProfile = UserProfile(
        javaResource as
            com.pulumi.aws.datazone.UserProfile,
    )
}

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy