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

com.pulumi.aws.elasticache.kotlin.UserArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.aws.elasticache.kotlin

import com.pulumi.aws.elasticache.UserArgs.builder
import com.pulumi.aws.elasticache.kotlin.inputs.UserAuthenticationModeArgs
import com.pulumi.aws.elasticache.kotlin.inputs.UserAuthenticationModeArgsBuilder
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.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Provides an ElastiCache user resource.
 * > **Note:** All arguments including the username and passwords will be stored in the raw state as plain-text.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const test = new aws.elasticache.User("test", {
 *     userId: "testUserId",
 *     userName: "testUserName",
 *     accessString: "on ~app::* -@all +@read +@hash +@bitmap +@geo -setbit -bitfield -hset -hsetnx -hmset -hincrby -hincrbyfloat -hdel -bitop -geoadd -georadius -georadiusbymember",
 *     engine: "REDIS",
 *     passwords: ["password123456789"],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * test = aws.elasticache.User("test",
 *     user_id="testUserId",
 *     user_name="testUserName",
 *     access_string="on ~app::* -@all +@read +@hash +@bitmap +@geo -setbit -bitfield -hset -hsetnx -hmset -hincrby -hincrbyfloat -hdel -bitop -geoadd -georadius -georadiusbymember",
 *     engine="REDIS",
 *     passwords=["password123456789"])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var test = new Aws.ElastiCache.User("test", new()
 *     {
 *         UserId = "testUserId",
 *         UserName = "testUserName",
 *         AccessString = "on ~app::* -@all +@read +@hash +@bitmap +@geo -setbit -bitfield -hset -hsetnx -hmset -hincrby -hincrbyfloat -hdel -bitop -geoadd -georadius -georadiusbymember",
 *         Engine = "REDIS",
 *         Passwords = new[]
 *         {
 *             "password123456789",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/elasticache"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := elasticache.NewUser(ctx, "test", &elasticache.UserArgs{
 * 			UserId:       pulumi.String("testUserId"),
 * 			UserName:     pulumi.String("testUserName"),
 * 			AccessString: pulumi.String("on ~app::* -@all +@read +@hash +@bitmap +@geo -setbit -bitfield -hset -hsetnx -hmset -hincrby -hincrbyfloat -hdel -bitop -geoadd -georadius -georadiusbymember"),
 * 			Engine:       pulumi.String("REDIS"),
 * 			Passwords: pulumi.StringArray{
 * 				pulumi.String("password123456789"),
 * 			},
 * 		})
 * 		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.elasticache.User;
 * import com.pulumi.aws.elasticache.UserArgs;
 * 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 User("test", UserArgs.builder()
 *             .userId("testUserId")
 *             .userName("testUserName")
 *             .accessString("on ~app::* -@all +@read +@hash +@bitmap +@geo -setbit -bitfield -hset -hsetnx -hmset -hincrby -hincrbyfloat -hdel -bitop -geoadd -georadius -georadiusbymember")
 *             .engine("REDIS")
 *             .passwords("password123456789")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   test:
 *     type: aws:elasticache:User
 *     properties:
 *       userId: testUserId
 *       userName: testUserName
 *       accessString: on ~app::* -@all +@read +@hash +@bitmap +@geo -setbit -bitfield -hset -hsetnx -hmset -hincrby -hincrbyfloat -hdel -bitop -geoadd -georadius -georadiusbymember
 *       engine: REDIS
 *       passwords:
 *         - password123456789
 * ```
 * 
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const test = new aws.elasticache.User("test", {
 *     userId: "testUserId",
 *     userName: "testUserName",
 *     accessString: "on ~* +@all",
 *     engine: "REDIS",
 *     authenticationMode: {
 *         type: "iam",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * test = aws.elasticache.User("test",
 *     user_id="testUserId",
 *     user_name="testUserName",
 *     access_string="on ~* +@all",
 *     engine="REDIS",
 *     authentication_mode={
 *         "type": "iam",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var test = new Aws.ElastiCache.User("test", new()
 *     {
 *         UserId = "testUserId",
 *         UserName = "testUserName",
 *         AccessString = "on ~* +@all",
 *         Engine = "REDIS",
 *         AuthenticationMode = new Aws.ElastiCache.Inputs.UserAuthenticationModeArgs
 *         {
 *             Type = "iam",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/elasticache"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := elasticache.NewUser(ctx, "test", &elasticache.UserArgs{
 * 			UserId:       pulumi.String("testUserId"),
 * 			UserName:     pulumi.String("testUserName"),
 * 			AccessString: pulumi.String("on ~* +@all"),
 * 			Engine:       pulumi.String("REDIS"),
 * 			AuthenticationMode: &elasticache.UserAuthenticationModeArgs{
 * 				Type: pulumi.String("iam"),
 * 			},
 * 		})
 * 		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.elasticache.User;
 * import com.pulumi.aws.elasticache.UserArgs;
 * import com.pulumi.aws.elasticache.inputs.UserAuthenticationModeArgs;
 * 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 User("test", UserArgs.builder()
 *             .userId("testUserId")
 *             .userName("testUserName")
 *             .accessString("on ~* +@all")
 *             .engine("REDIS")
 *             .authenticationMode(UserAuthenticationModeArgs.builder()
 *                 .type("iam")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   test:
 *     type: aws:elasticache:User
 *     properties:
 *       userId: testUserId
 *       userName: testUserName
 *       accessString: on ~* +@all
 *       engine: REDIS
 *       authenticationMode:
 *         type: iam
 * ```
 * 
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const test = new aws.elasticache.User("test", {
 *     userId: "testUserId",
 *     userName: "testUserName",
 *     accessString: "on ~* +@all",
 *     engine: "REDIS",
 *     authenticationMode: {
 *         type: "password",
 *         passwords: [
 *             "password1",
 *             "password2",
 *         ],
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * test = aws.elasticache.User("test",
 *     user_id="testUserId",
 *     user_name="testUserName",
 *     access_string="on ~* +@all",
 *     engine="REDIS",
 *     authentication_mode={
 *         "type": "password",
 *         "passwords": [
 *             "password1",
 *             "password2",
 *         ],
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var test = new Aws.ElastiCache.User("test", new()
 *     {
 *         UserId = "testUserId",
 *         UserName = "testUserName",
 *         AccessString = "on ~* +@all",
 *         Engine = "REDIS",
 *         AuthenticationMode = new Aws.ElastiCache.Inputs.UserAuthenticationModeArgs
 *         {
 *             Type = "password",
 *             Passwords = new[]
 *             {
 *                 "password1",
 *                 "password2",
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/elasticache"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := elasticache.NewUser(ctx, "test", &elasticache.UserArgs{
 * 			UserId:       pulumi.String("testUserId"),
 * 			UserName:     pulumi.String("testUserName"),
 * 			AccessString: pulumi.String("on ~* +@all"),
 * 			Engine:       pulumi.String("REDIS"),
 * 			AuthenticationMode: &elasticache.UserAuthenticationModeArgs{
 * 				Type: pulumi.String("password"),
 * 				Passwords: pulumi.StringArray{
 * 					pulumi.String("password1"),
 * 					pulumi.String("password2"),
 * 				},
 * 			},
 * 		})
 * 		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.elasticache.User;
 * import com.pulumi.aws.elasticache.UserArgs;
 * import com.pulumi.aws.elasticache.inputs.UserAuthenticationModeArgs;
 * 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 User("test", UserArgs.builder()
 *             .userId("testUserId")
 *             .userName("testUserName")
 *             .accessString("on ~* +@all")
 *             .engine("REDIS")
 *             .authenticationMode(UserAuthenticationModeArgs.builder()
 *                 .type("password")
 *                 .passwords(
 *                     "password1",
 *                     "password2")
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   test:
 *     type: aws:elasticache:User
 *     properties:
 *       userId: testUserId
 *       userName: testUserName
 *       accessString: on ~* +@all
 *       engine: REDIS
 *       authenticationMode:
 *         type: password
 *         passwords:
 *           - password1
 *           - password2
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import ElastiCache users using the `user_id`. For example:
 * ```sh
 * $ pulumi import aws:elasticache/user:User my_user userId1
 * ```
 * @property accessString Access permissions string used for this user. See [Specifying Permissions Using an Access String](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Clusters.RBAC.html#Access-string) for more details.
 * @property authenticationMode Denotes the user's authentication properties. Detailed below.
 * @property engine The current supported value is `REDIS`.
 * @property noPasswordRequired Indicates a password is not required for this user.
 * @property passwords Passwords used for this user. You can create up to two passwords for each user.
 * @property tags A list of tags to be added to this resource. A tag is a key-value pair.
 * @property userId The ID of the user.
 * @property userName The username of the user.
 * The following arguments are optional:
 */
public data class UserArgs(
    public val accessString: Output? = null,
    public val authenticationMode: Output? = null,
    public val engine: Output? = null,
    public val noPasswordRequired: Output? = null,
    public val passwords: Output>? = null,
    public val tags: Output>? = null,
    public val userId: Output? = null,
    public val userName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.aws.elasticache.UserArgs =
        com.pulumi.aws.elasticache.UserArgs.builder()
            .accessString(accessString?.applyValue({ args0 -> args0 }))
            .authenticationMode(
                authenticationMode?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .engine(engine?.applyValue({ args0 -> args0 }))
            .noPasswordRequired(noPasswordRequired?.applyValue({ args0 -> args0 }))
            .passwords(passwords?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .userId(userId?.applyValue({ args0 -> args0 }))
            .userName(userName?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [UserArgs].
 */
@PulumiTagMarker
public class UserArgsBuilder internal constructor() {
    private var accessString: Output? = null

    private var authenticationMode: Output? = null

    private var engine: Output? = null

    private var noPasswordRequired: Output? = null

    private var passwords: Output>? = null

    private var tags: Output>? = null

    private var userId: Output? = null

    private var userName: Output? = null

    /**
     * @param value Access permissions string used for this user. See [Specifying Permissions Using an Access String](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Clusters.RBAC.html#Access-string) for more details.
     */
    @JvmName("nuvflwkaofdmbake")
    public suspend fun accessString(`value`: Output) {
        this.accessString = value
    }

    /**
     * @param value Denotes the user's authentication properties. Detailed below.
     */
    @JvmName("ulytlkmupsntsdko")
    public suspend fun authenticationMode(`value`: Output) {
        this.authenticationMode = value
    }

    /**
     * @param value The current supported value is `REDIS`.
     */
    @JvmName("kqxbtxbjntkdkplj")
    public suspend fun engine(`value`: Output) {
        this.engine = value
    }

    /**
     * @param value Indicates a password is not required for this user.
     */
    @JvmName("hkwpqgrwmxplqipt")
    public suspend fun noPasswordRequired(`value`: Output) {
        this.noPasswordRequired = value
    }

    /**
     * @param value Passwords used for this user. You can create up to two passwords for each user.
     */
    @JvmName("cfgooxiukimxfvgk")
    public suspend fun passwords(`value`: Output>) {
        this.passwords = value
    }

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

    /**
     * @param values Passwords used for this user. You can create up to two passwords for each user.
     */
    @JvmName("weiktskfffjvwuyi")
    public suspend fun passwords(values: List>) {
        this.passwords = Output.all(values)
    }

    /**
     * @param value A list of tags to be added to this resource. A tag is a key-value pair.
     */
    @JvmName("mjkkthupmbjfhgua")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value The ID of the user.
     */
    @JvmName("pysipcivhbwughag")
    public suspend fun userId(`value`: Output) {
        this.userId = value
    }

    /**
     * @param value The username of the user.
     * The following arguments are optional:
     */
    @JvmName("wnrogtsopjfcwbrc")
    public suspend fun userName(`value`: Output) {
        this.userName = value
    }

    /**
     * @param value Access permissions string used for this user. See [Specifying Permissions Using an Access String](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Clusters.RBAC.html#Access-string) for more details.
     */
    @JvmName("rgkdcarkgjefwatd")
    public suspend fun accessString(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.accessString = mapped
    }

    /**
     * @param value Denotes the user's authentication properties. Detailed below.
     */
    @JvmName("cvyyvwypuncrgcpq")
    public suspend fun authenticationMode(`value`: UserAuthenticationModeArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.authenticationMode = mapped
    }

    /**
     * @param argument Denotes the user's authentication properties. Detailed below.
     */
    @JvmName("ugjgspmsdifyaflg")
    public suspend fun authenticationMode(argument: suspend UserAuthenticationModeArgsBuilder.() -> Unit) {
        val toBeMapped = UserAuthenticationModeArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.authenticationMode = mapped
    }

    /**
     * @param value The current supported value is `REDIS`.
     */
    @JvmName("wofhdubhwlwnsscf")
    public suspend fun engine(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.engine = mapped
    }

    /**
     * @param value Indicates a password is not required for this user.
     */
    @JvmName("pkegvvcuqviodoxm")
    public suspend fun noPasswordRequired(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.noPasswordRequired = mapped
    }

    /**
     * @param value Passwords used for this user. You can create up to two passwords for each user.
     */
    @JvmName("bjdxnihukgcldtyl")
    public suspend fun passwords(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.passwords = mapped
    }

    /**
     * @param values Passwords used for this user. You can create up to two passwords for each user.
     */
    @JvmName("gaockybpvyrlpufw")
    public suspend fun passwords(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.passwords = mapped
    }

    /**
     * @param value A list of tags to be added to this resource. A tag is a key-value pair.
     */
    @JvmName("xcdoeoemprwjltvg")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A list of tags to be added to this resource. A tag is a key-value pair.
     */
    @JvmName("sjscrlvenspjfrrn")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value The ID of the user.
     */
    @JvmName("rltgxbjephwpemvn")
    public suspend fun userId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.userId = mapped
    }

    /**
     * @param value The username of the user.
     * The following arguments are optional:
     */
    @JvmName("jbwkdvhagyfnyigp")
    public suspend fun userName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.userName = mapped
    }

    internal fun build(): UserArgs = UserArgs(
        accessString = accessString,
        authenticationMode = authenticationMode,
        engine = engine,
        noPasswordRequired = noPasswordRequired,
        passwords = passwords,
        tags = tags,
        userId = userId,
        userName = userName,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy