aws.elasticache.User
Explore with Pulumi AI
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
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"],
});
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"])
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
})
}
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",
},
});
});
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());
}
}
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
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",
},
});
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",
})
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
})
}
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",
},
});
});
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());
}
}
resources:
test:
type: aws:elasticache:User
properties:
userId: testUserId
userName: testUserName
accessString: on ~* +@all
engine: REDIS
authenticationMode:
type: iam
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",
],
},
});
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",
],
})
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
})
}
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",
},
},
});
});
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());
}
}
resources:
test:
type: aws:elasticache:User
properties:
userId: testUserId
userName: testUserName
accessString: on ~* +@all
engine: REDIS
authenticationMode:
type: password
passwords:
- password1
- password2
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,
engine: Optional[str] = None,
user_id: Optional[str] = None,
user_name: Optional[str] = None,
authentication_mode: Optional[UserAuthenticationModeArgs] = None,
no_password_required: Optional[bool] = None,
passwords: Optional[Sequence[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)
type: aws:elasticache: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 exampleuserResourceResourceFromElasticacheuser = new Aws.ElastiCache.User("exampleuserResourceResourceFromElasticacheuser", new()
{
AccessString = "string",
Engine = "string",
UserId = "string",
UserName = "string",
AuthenticationMode = new Aws.ElastiCache.Inputs.UserAuthenticationModeArgs
{
Type = "string",
PasswordCount = 0,
Passwords = new[]
{
"string",
},
},
NoPasswordRequired = false,
Passwords = new[]
{
"string",
},
Tags =
{
{ "string", "string" },
},
});
example, err := elasticache.NewUser(ctx, "exampleuserResourceResourceFromElasticacheuser", &elasticache.UserArgs{
AccessString: pulumi.String("string"),
Engine: pulumi.String("string"),
UserId: pulumi.String("string"),
UserName: pulumi.String("string"),
AuthenticationMode: &elasticache.UserAuthenticationModeArgs{
Type: pulumi.String("string"),
PasswordCount: pulumi.Int(0),
Passwords: pulumi.StringArray{
pulumi.String("string"),
},
},
NoPasswordRequired: pulumi.Bool(false),
Passwords: pulumi.StringArray{
pulumi.String("string"),
},
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var exampleuserResourceResourceFromElasticacheuser = new User("exampleuserResourceResourceFromElasticacheuser", UserArgs.builder()
.accessString("string")
.engine("string")
.userId("string")
.userName("string")
.authenticationMode(UserAuthenticationModeArgs.builder()
.type("string")
.passwordCount(0)
.passwords("string")
.build())
.noPasswordRequired(false)
.passwords("string")
.tags(Map.of("string", "string"))
.build());
exampleuser_resource_resource_from_elasticacheuser = aws.elasticache.User("exampleuserResourceResourceFromElasticacheuser",
access_string="string",
engine="string",
user_id="string",
user_name="string",
authentication_mode={
"type": "string",
"passwordCount": 0,
"passwords": ["string"],
},
no_password_required=False,
passwords=["string"],
tags={
"string": "string",
})
const exampleuserResourceResourceFromElasticacheuser = new aws.elasticache.User("exampleuserResourceResourceFromElasticacheuser", {
accessString: "string",
engine: "string",
userId: "string",
userName: "string",
authenticationMode: {
type: "string",
passwordCount: 0,
passwords: ["string"],
},
noPasswordRequired: false,
passwords: ["string"],
tags: {
string: "string",
},
});
type: aws:elasticache:User
properties:
accessString: string
authenticationMode:
passwordCount: 0
passwords:
- string
type: string
engine: string
noPasswordRequired: false
passwords:
- string
tags:
string: string
userId: 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:
- Access
String string - Access permissions string used for this user. See Specifying Permissions Using an Access String for more details.
- Engine string
- The current supported value is
REDIS
. - User
Id string - The ID of the user.
- User
Name string The username of the user.
The following arguments are optional:
- Authentication
Mode UserAuthentication Mode - Denotes the user's authentication properties. Detailed below.
- No
Password boolRequired - Indicates a password is not required for this user.
- Passwords List<string>
- Passwords used for this user. You can create up to two passwords for each user.
- Dictionary<string, string>
- A list of tags to be added to this resource. A tag is a key-value pair.
- Access
String string - Access permissions string used for this user. See Specifying Permissions Using an Access String for more details.
- Engine string
- The current supported value is
REDIS
. - User
Id string - The ID of the user.
- User
Name string The username of the user.
The following arguments are optional:
- Authentication
Mode UserAuthentication Mode Args - Denotes the user's authentication properties. Detailed below.
- No
Password boolRequired - Indicates a password is not required for this user.
- Passwords []string
- Passwords used for this user. You can create up to two passwords for each user.
- map[string]string
- A list of tags to be added to this resource. A tag is a key-value pair.
- access
String String - Access permissions string used for this user. See Specifying Permissions Using an Access String for more details.
- engine String
- The current supported value is
REDIS
. - user
Id String - The ID of the user.
- user
Name String The username of the user.
The following arguments are optional:
- authentication
Mode UserAuthentication Mode - Denotes the user's authentication properties. Detailed below.
- no
Password BooleanRequired - Indicates a password is not required for this user.
- passwords List<String>
- Passwords used for this user. You can create up to two passwords for each user.
- Map<String,String>
- A list of tags to be added to this resource. A tag is a key-value pair.
- access
String string - Access permissions string used for this user. See Specifying Permissions Using an Access String for more details.
- engine string
- The current supported value is
REDIS
. - user
Id string - The ID of the user.
- user
Name string The username of the user.
The following arguments are optional:
- authentication
Mode UserAuthentication Mode - Denotes the user's authentication properties. Detailed below.
- no
Password booleanRequired - Indicates a password is not required for this user.
- passwords string[]
- Passwords used for this user. You can create up to two passwords for each user.
- {[key: string]: string}
- A list of tags to be added to this resource. A tag is a key-value pair.
- access_
string str - Access permissions string used for this user. See Specifying Permissions Using an Access String for more details.
- engine str
- The current supported value is
REDIS
. - user_
id str - The ID of the user.
- user_
name str The username of the user.
The following arguments are optional:
- authentication_
mode UserAuthentication Mode Args - Denotes the user's authentication properties. Detailed below.
- no_
password_ boolrequired - Indicates a password is not required for this user.
- passwords Sequence[str]
- Passwords used for this user. You can create up to two passwords for each user.
- Mapping[str, str]
- A list of tags to be added to this resource. A tag is a key-value pair.
- access
String String - Access permissions string used for this user. See Specifying Permissions Using an Access String for more details.
- engine String
- The current supported value is
REDIS
. - user
Id String - The ID of the user.
- user
Name String The username of the user.
The following arguments are optional:
- authentication
Mode Property Map - Denotes the user's authentication properties. Detailed below.
- no
Password BooleanRequired - Indicates a password is not required for this user.
- passwords List<String>
- Passwords used for this user. You can create up to two passwords for each user.
- Map<String>
- A list of tags to be added to this resource. A tag is a key-value pair.
Outputs
All input properties are implicitly available as output properties. Additionally, the User resource produces the following output properties:
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,
engine: Optional[str] = None,
no_password_required: Optional[bool] = None,
passwords: Optional[Sequence[str]] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None,
user_id: Optional[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.
- Access
String string - Access permissions string used for this user. See Specifying Permissions Using an Access String for more details.
- Arn string
- The ARN of the created ElastiCache User.
- Authentication
Mode UserAuthentication Mode - Denotes the user's authentication properties. Detailed below.
- Engine string
- The current supported value is
REDIS
. - No
Password boolRequired - Indicates a password is not required for this user.
- Passwords List<string>
- Passwords used for this user. You can create up to two passwords for each user.
- Dictionary<string, string>
- A list of tags to be added to this resource. A tag is a key-value pair.
- Dictionary<string, string>
- User
Id string - The ID of the user.
- User
Name string The username of the user.
The following arguments are optional:
- Access
String string - Access permissions string used for this user. See Specifying Permissions Using an Access String for more details.
- Arn string
- The ARN of the created ElastiCache User.
- Authentication
Mode UserAuthentication Mode Args - Denotes the user's authentication properties. Detailed below.
- Engine string
- The current supported value is
REDIS
. - No
Password boolRequired - Indicates a password is not required for this user.
- Passwords []string
- Passwords used for this user. You can create up to two passwords for each user.
- map[string]string
- A list of tags to be added to this resource. A tag is a key-value pair.
- map[string]string
- User
Id string - The ID of the user.
- User
Name string The username of the user.
The following arguments are optional:
- access
String String - Access permissions string used for this user. See Specifying Permissions Using an Access String for more details.
- arn String
- The ARN of the created ElastiCache User.
- authentication
Mode UserAuthentication Mode - Denotes the user's authentication properties. Detailed below.
- engine String
- The current supported value is
REDIS
. - no
Password BooleanRequired - Indicates a password is not required for this user.
- passwords List<String>
- Passwords used for this user. You can create up to two passwords for each user.
- Map<String,String>
- A list of tags to be added to this resource. A tag is a key-value pair.
- Map<String,String>
- user
Id String - The ID of the user.
- user
Name String The username of the user.
The following arguments are optional:
- access
String string - Access permissions string used for this user. See Specifying Permissions Using an Access String for more details.
- arn string
- The ARN of the created ElastiCache User.
- authentication
Mode UserAuthentication Mode - Denotes the user's authentication properties. Detailed below.
- engine string
- The current supported value is
REDIS
. - no
Password booleanRequired - Indicates a password is not required for this user.
- passwords string[]
- Passwords used for this user. You can create up to two passwords for each user.
- {[key: string]: string}
- A list of tags to be added to this resource. A tag is a key-value pair.
- {[key: string]: string}
- user
Id string - The ID of the user.
- user
Name string The username of the user.
The following arguments are optional:
- access_
string str - Access permissions string used for this user. See Specifying Permissions Using an Access String for more details.
- arn str
- The ARN of the created ElastiCache User.
- authentication_
mode UserAuthentication Mode Args - Denotes the user's authentication properties. Detailed below.
- engine str
- The current supported value is
REDIS
. - no_
password_ boolrequired - Indicates a password is not required for this user.
- passwords Sequence[str]
- Passwords used for this user. You can create up to two passwords for each user.
- Mapping[str, str]
- A list of tags to be added to this resource. A tag is a key-value pair.
- Mapping[str, str]
- user_
id str - The ID of the user.
- user_
name str The username of the user.
The following arguments are optional:
- access
String String - Access permissions string used for this user. See Specifying Permissions Using an Access String for more details.
- arn String
- The ARN of the created ElastiCache User.
- authentication
Mode Property Map - Denotes the user's authentication properties. Detailed below.
- engine String
- The current supported value is
REDIS
. - no
Password BooleanRequired - Indicates a password is not required for this user.
- passwords List<String>
- Passwords used for this user. You can create up to two passwords for each user.
- Map<String>
- A list of tags to be added to this resource. A tag is a key-value pair.
- Map<String>
- user
Id String - The ID of the user.
- user
Name String The username of the user.
The following arguments are optional:
Supporting Types
UserAuthenticationMode, UserAuthenticationModeArgs
- Type string
- Specifies the authentication type. Possible options are:
password
,no-password-required
oriam
. - Password
Count int - Passwords List<string>
- Specifies the passwords to use for authentication if
type
is set topassword
.
- Type string
- Specifies the authentication type. Possible options are:
password
,no-password-required
oriam
. - Password
Count int - Passwords []string
- Specifies the passwords to use for authentication if
type
is set topassword
.
- type String
- Specifies the authentication type. Possible options are:
password
,no-password-required
oriam
. - password
Count Integer - passwords List<String>
- Specifies the passwords to use for authentication if
type
is set topassword
.
- type string
- Specifies the authentication type. Possible options are:
password
,no-password-required
oriam
. - password
Count number - passwords string[]
- Specifies the passwords to use for authentication if
type
is set topassword
.
- type str
- Specifies the authentication type. Possible options are:
password
,no-password-required
oriam
. - password_
count int - passwords Sequence[str]
- Specifies the passwords to use for authentication if
type
is set topassword
.
- type String
- Specifies the authentication type. Possible options are:
password
,no-password-required
oriam
. - password
Count Number - passwords List<String>
- Specifies the passwords to use for authentication if
type
is set topassword
.
Import
Using pulumi import
, import ElastiCache users using the user_id
. For example:
$ pulumi import aws:elasticache/user:User my_user userId1
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.