1. Packages
  2. AWS Classic
  3. API Docs
  4. memorydb
  5. User

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.45.0 published on Tuesday, Jul 16, 2024 by Pulumi

aws.memorydb.User

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.45.0 published on Tuesday, Jul 16, 2024 by Pulumi

    Provides a MemoryDB User.

    More information about users and ACL-s can be found in the MemoryDB User Guide.

    Note: All arguments including the username and passwords will be stored in the raw state as plain-text.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    import * as random from "@pulumi/random";
    
    const example = new random.index.Password("example", {length: 16});
    const exampleUser = new aws.memorydb.User("example", {
        userName: "my-user",
        accessString: "on ~* &* +@all",
        authenticationMode: {
            type: "password",
            passwords: [example.result],
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    import pulumi_random as random
    
    example = random.index.Password("example", length=16)
    example_user = aws.memorydb.User("example",
        user_name="my-user",
        access_string="on ~* &* +@all",
        authentication_mode={
            "type": "password",
            "passwords": [example["result"]],
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/memorydb"
    	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := random.NewPassword(ctx, "example", &random.PasswordArgs{
    			Length: 16,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = memorydb.NewUser(ctx, "example", &memorydb.UserArgs{
    			UserName:     pulumi.String("my-user"),
    			AccessString: pulumi.String("on ~* &* +@all"),
    			AuthenticationMode: &memorydb.UserAuthenticationModeArgs{
    				Type: pulumi.String("password"),
    				Passwords: pulumi.StringArray{
    					example.Result,
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    using Random = Pulumi.Random;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Random.Index.Password("example", new()
        {
            Length = 16,
        });
    
        var exampleUser = new Aws.MemoryDb.User("example", new()
        {
            UserName = "my-user",
            AccessString = "on ~* &* +@all",
            AuthenticationMode = new Aws.MemoryDb.Inputs.UserAuthenticationModeArgs
            {
                Type = "password",
                Passwords = new[]
                {
                    example.Result,
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.random.password;
    import com.pulumi.random.PasswordArgs;
    import com.pulumi.aws.memorydb.User;
    import com.pulumi.aws.memorydb.UserArgs;
    import com.pulumi.aws.memorydb.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 example = new Password("example", PasswordArgs.builder()
                .length(16)
                .build());
    
            var exampleUser = new User("exampleUser", UserArgs.builder()
                .userName("my-user")
                .accessString("on ~* &* +@all")
                .authenticationMode(UserAuthenticationModeArgs.builder()
                    .type("password")
                    .passwords(example.result())
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: random:password
        properties:
          length: 16
      exampleUser:
        type: aws:memorydb:User
        name: example
        properties:
          userName: my-user
          accessString: on ~* &* +@all
          authenticationMode:
            type: password
            passwords:
              - ${example.result}
    

    Create User Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new User(name: string, args: UserArgs, opts?: CustomResourceOptions);
    @overload
    def User(resource_name: str,
             args: UserArgs,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def User(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             access_string: Optional[str] = None,
             authentication_mode: Optional[UserAuthenticationModeArgs] = None,
             user_name: Optional[str] = None,
             tags: Optional[Mapping[str, str]] = None)
    func NewUser(ctx *Context, name string, args UserArgs, opts ...ResourceOption) (*User, error)
    public User(string name, UserArgs args, CustomResourceOptions? opts = null)
    public User(String name, UserArgs args)
    public User(String name, UserArgs args, CustomResourceOptions options)
    
    type: aws:memorydb:User
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args UserArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args UserArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args UserArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UserArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UserArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var exampleuserResourceResourceFromMemorydbuser = new Aws.MemoryDb.User("exampleuserResourceResourceFromMemorydbuser", new()
    {
        AccessString = "string",
        AuthenticationMode = new Aws.MemoryDb.Inputs.UserAuthenticationModeArgs
        {
            Type = "string",
            PasswordCount = 0,
            Passwords = new[]
            {
                "string",
            },
        },
        UserName = "string",
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := memorydb.NewUser(ctx, "exampleuserResourceResourceFromMemorydbuser", &memorydb.UserArgs{
    	AccessString: pulumi.String("string"),
    	AuthenticationMode: &memorydb.UserAuthenticationModeArgs{
    		Type:          pulumi.String("string"),
    		PasswordCount: pulumi.Int(0),
    		Passwords: pulumi.StringArray{
    			pulumi.String("string"),
    		},
    	},
    	UserName: pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var exampleuserResourceResourceFromMemorydbuser = new User("exampleuserResourceResourceFromMemorydbuser", UserArgs.builder()
        .accessString("string")
        .authenticationMode(UserAuthenticationModeArgs.builder()
            .type("string")
            .passwordCount(0)
            .passwords("string")
            .build())
        .userName("string")
        .tags(Map.of("string", "string"))
        .build());
    
    exampleuser_resource_resource_from_memorydbuser = aws.memorydb.User("exampleuserResourceResourceFromMemorydbuser",
        access_string="string",
        authentication_mode={
            "type": "string",
            "passwordCount": 0,
            "passwords": ["string"],
        },
        user_name="string",
        tags={
            "string": "string",
        })
    
    const exampleuserResourceResourceFromMemorydbuser = new aws.memorydb.User("exampleuserResourceResourceFromMemorydbuser", {
        accessString: "string",
        authenticationMode: {
            type: "string",
            passwordCount: 0,
            passwords: ["string"],
        },
        userName: "string",
        tags: {
            string: "string",
        },
    });
    
    type: aws:memorydb:User
    properties:
        accessString: string
        authenticationMode:
            passwordCount: 0
            passwords:
                - string
            type: string
        tags:
            string: string
        userName: string
    

    User Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The User resource accepts the following input properties:

    AccessString string
    Access permissions string used for this user.
    AuthenticationMode UserAuthenticationMode
    Denotes the user's authentication properties. Detailed below.
    UserName string

    Name of the MemoryDB user. Up to 40 characters.

    The following arguments are optional:

    Tags Dictionary<string, string>
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    AccessString string
    Access permissions string used for this user.
    AuthenticationMode UserAuthenticationModeArgs
    Denotes the user's authentication properties. Detailed below.
    UserName string

    Name of the MemoryDB user. Up to 40 characters.

    The following arguments are optional:

    Tags map[string]string
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    accessString String
    Access permissions string used for this user.
    authenticationMode UserAuthenticationMode
    Denotes the user's authentication properties. Detailed below.
    userName String

    Name of the MemoryDB user. Up to 40 characters.

    The following arguments are optional:

    tags Map<String,String>
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    accessString string
    Access permissions string used for this user.
    authenticationMode UserAuthenticationMode
    Denotes the user's authentication properties. Detailed below.
    userName string

    Name of the MemoryDB user. Up to 40 characters.

    The following arguments are optional:

    tags {[key: string]: string}
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    access_string str
    Access permissions string used for this user.
    authentication_mode UserAuthenticationModeArgs
    Denotes the user's authentication properties. Detailed below.
    user_name str

    Name of the MemoryDB user. Up to 40 characters.

    The following arguments are optional:

    tags Mapping[str, str]
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    accessString String
    Access permissions string used for this user.
    authenticationMode Property Map
    Denotes the user's authentication properties. Detailed below.
    userName String

    Name of the MemoryDB user. Up to 40 characters.

    The following arguments are optional:

    tags Map<String>
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the User resource produces the following output properties:

    Arn string
    ARN of the user.
    Id string
    The provider-assigned unique ID for this managed resource.
    MinimumEngineVersion string
    Minimum engine version supported for the user.
    TagsAll Dictionary<string, string>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Arn string
    ARN of the user.
    Id string
    The provider-assigned unique ID for this managed resource.
    MinimumEngineVersion string
    Minimum engine version supported for the user.
    TagsAll map[string]string
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn String
    ARN of the user.
    id String
    The provider-assigned unique ID for this managed resource.
    minimumEngineVersion String
    Minimum engine version supported for the user.
    tagsAll Map<String,String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn string
    ARN of the user.
    id string
    The provider-assigned unique ID for this managed resource.
    minimumEngineVersion string
    Minimum engine version supported for the user.
    tagsAll {[key: string]: string}
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn str
    ARN of the user.
    id str
    The provider-assigned unique ID for this managed resource.
    minimum_engine_version str
    Minimum engine version supported for the user.
    tags_all Mapping[str, str]
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    arn String
    ARN of the user.
    id String
    The provider-assigned unique ID for this managed resource.
    minimumEngineVersion String
    Minimum engine version supported for the user.
    tagsAll Map<String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    Look up Existing User Resource

    Get an existing User resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: UserState, opts?: CustomResourceOptions): User
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            access_string: Optional[str] = None,
            arn: Optional[str] = None,
            authentication_mode: Optional[UserAuthenticationModeArgs] = None,
            minimum_engine_version: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            tags_all: Optional[Mapping[str, str]] = None,
            user_name: Optional[str] = None) -> User
    func GetUser(ctx *Context, name string, id IDInput, state *UserState, opts ...ResourceOption) (*User, error)
    public static User Get(string name, Input<string> id, UserState? state, CustomResourceOptions? opts = null)
    public static User get(String name, Output<String> id, UserState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AccessString string
    Access permissions string used for this user.
    Arn string
    ARN of the user.
    AuthenticationMode UserAuthenticationMode
    Denotes the user's authentication properties. Detailed below.
    MinimumEngineVersion string
    Minimum engine version supported for the user.
    Tags Dictionary<string, string>
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll Dictionary<string, string>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    UserName string

    Name of the MemoryDB user. Up to 40 characters.

    The following arguments are optional:

    AccessString string
    Access permissions string used for this user.
    Arn string
    ARN of the user.
    AuthenticationMode UserAuthenticationModeArgs
    Denotes the user's authentication properties. Detailed below.
    MinimumEngineVersion string
    Minimum engine version supported for the user.
    Tags map[string]string
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll map[string]string
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    UserName string

    Name of the MemoryDB user. Up to 40 characters.

    The following arguments are optional:

    accessString String
    Access permissions string used for this user.
    arn String
    ARN of the user.
    authenticationMode UserAuthenticationMode
    Denotes the user's authentication properties. Detailed below.
    minimumEngineVersion String
    Minimum engine version supported for the user.
    tags Map<String,String>
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String,String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    userName String

    Name of the MemoryDB user. Up to 40 characters.

    The following arguments are optional:

    accessString string
    Access permissions string used for this user.
    arn string
    ARN of the user.
    authenticationMode UserAuthenticationMode
    Denotes the user's authentication properties. Detailed below.
    minimumEngineVersion string
    Minimum engine version supported for the user.
    tags {[key: string]: string}
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll {[key: string]: string}
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    userName string

    Name of the MemoryDB user. Up to 40 characters.

    The following arguments are optional:

    access_string str
    Access permissions string used for this user.
    arn str
    ARN of the user.
    authentication_mode UserAuthenticationModeArgs
    Denotes the user's authentication properties. Detailed below.
    minimum_engine_version str
    Minimum engine version supported for the user.
    tags Mapping[str, str]
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tags_all Mapping[str, str]
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    user_name str

    Name of the MemoryDB user. Up to 40 characters.

    The following arguments are optional:

    accessString String
    Access permissions string used for this user.
    arn String
    ARN of the user.
    authenticationMode Property Map
    Denotes the user's authentication properties. Detailed below.
    minimumEngineVersion String
    Minimum engine version supported for the user.
    tags Map<String>
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Deprecated: Please use tags instead.

    userName String

    Name of the MemoryDB user. Up to 40 characters.

    The following arguments are optional:

    Supporting Types

    UserAuthenticationMode, UserAuthenticationModeArgs

    Type string
    Specifies the authentication type. Valid values are: password or iam.
    PasswordCount int
    Number of passwords belonging to the user if type is set to password.
    Passwords List<string>
    Set of passwords used for authentication if type is set to password. You can create up to two passwords for each user.
    Type string
    Specifies the authentication type. Valid values are: password or iam.
    PasswordCount int
    Number of passwords belonging to the user if type is set to password.
    Passwords []string
    Set of passwords used for authentication if type is set to password. You can create up to two passwords for each user.
    type String
    Specifies the authentication type. Valid values are: password or iam.
    passwordCount Integer
    Number of passwords belonging to the user if type is set to password.
    passwords List<String>
    Set of passwords used for authentication if type is set to password. You can create up to two passwords for each user.
    type string
    Specifies the authentication type. Valid values are: password or iam.
    passwordCount number
    Number of passwords belonging to the user if type is set to password.
    passwords string[]
    Set of passwords used for authentication if type is set to password. You can create up to two passwords for each user.
    type str
    Specifies the authentication type. Valid values are: password or iam.
    password_count int
    Number of passwords belonging to the user if type is set to password.
    passwords Sequence[str]
    Set of passwords used for authentication if type is set to password. You can create up to two passwords for each user.
    type String
    Specifies the authentication type. Valid values are: password or iam.
    passwordCount Number
    Number of passwords belonging to the user if type is set to password.
    passwords List<String>
    Set of passwords used for authentication if type is set to password. You can create up to two passwords for each user.

    Import

    Using pulumi import, import a user using the user_name. For example:

    $ pulumi import aws:memorydb/user:User example my-user
    

    The passwords are not available for imported resources, as this information cannot be read back from the MemoryDB API.

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.45.0 published on Tuesday, Jul 16, 2024 by Pulumi