User class
Provides an ElastiCache user resource.
> Note: All arguments including the username and passwords will be stored in the raw state as plain-text unless you use the write-only passwordsWo argument.
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"])
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 main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/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
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "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 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.ArrayList;
import java.util.Arrays;
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", {
authenticationMode: {
type: "iam",
},
userId: "testUserId",
userName: "testUserName",
accessString: "on ~* +@all",
engine: "redis",
});
import pulumi
import pulumi_aws as aws
test = aws.elasticache.User("test",
authentication_mode={
"type": "iam",
},
user_id="testUserId",
user_name="testUserName",
access_string="on ~* +@all",
engine="redis")
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()
{
AuthenticationMode = new Aws.ElastiCache.Inputs.UserAuthenticationModeArgs
{
Type = "iam",
},
UserId = "testUserId",
UserName = "testUserName",
AccessString = "on ~* +@all",
Engine = "redis",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/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{
AuthenticationMode: &elasticache.UserAuthenticationModeArgs{
Type: pulumi.String("iam"),
},
UserId: pulumi.String("testUserId"),
UserName: pulumi.String("testUserName"),
AccessString: pulumi.String("on ~* +@all"),
Engine: pulumi.String("redis"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_elasticache_user" "test" {
authentication_mode = {
type = "iam"
}
user_id = "testUserId"
user_name = "testUserName"
access_string = "on ~* +@all"
engine = "redis"
}
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.ArrayList;
import java.util.Arrays;
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()
.authenticationMode(UserAuthenticationModeArgs.builder()
.type("iam")
.build())
.userId("testUserId")
.userName("testUserName")
.accessString("on ~* +@all")
.engine("redis")
.build());
}
}
resources:
test:
type: aws:elasticache:User
properties:
authenticationMode:
type: iam
userId: testUserId
userName: testUserName
accessString: on ~* +@all
engine: redis
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const test = new aws.elasticache.User("test", {
authenticationMode: {
type: "password",
passwords: [
"password1",
"password2",
],
},
userId: "testUserId",
userName: "testUserName",
accessString: "on ~* +@all",
engine: "redis",
});
import pulumi
import pulumi_aws as aws
test = aws.elasticache.User("test",
authentication_mode={
"type": "password",
"passwords": [
"password1",
"password2",
],
},
user_id="testUserId",
user_name="testUserName",
access_string="on ~* +@all",
engine="redis")
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()
{
AuthenticationMode = new Aws.ElastiCache.Inputs.UserAuthenticationModeArgs
{
Type = "password",
Passwords = new[]
{
"password1",
"password2",
},
},
UserId = "testUserId",
UserName = "testUserName",
AccessString = "on ~* +@all",
Engine = "redis",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/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{
AuthenticationMode: &elasticache.UserAuthenticationModeArgs{
Type: pulumi.String("password"),
Passwords: pulumi.StringArray{
pulumi.String("password1"),
pulumi.String("password2"),
},
},
UserId: pulumi.String("testUserId"),
UserName: pulumi.String("testUserName"),
AccessString: pulumi.String("on ~* +@all"),
Engine: pulumi.String("redis"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_elasticache_user" "test" {
authentication_mode = {
type = "password"
passwords = ["password1", "password2"]
}
user_id = "testUserId"
user_name = "testUserName"
access_string = "on ~* +@all"
engine = "redis"
}
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.ArrayList;
import java.util.Arrays;
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()
.authenticationMode(UserAuthenticationModeArgs.builder()
.type("password")
.passwords(
"password1",
"password2")
.build())
.userId("testUserId")
.userName("testUserName")
.accessString("on ~* +@all")
.engine("redis")
.build());
}
}
resources:
test:
type: aws:elasticache:User
properties:
authenticationMode:
type: password
passwords:
- password1
- password2
userId: testUserId
userName: testUserName
accessString: on ~* +@all
engine: redis
Using Write-Only Password (Terraform 1.11+)
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",
passwordsWo: elasticachePassword,
passwordsWoVersion: 1,
});
import pulumi
import pulumi_aws as aws
test = aws.elasticache.User("test",
user_id="testUserId",
user_name="testUserName",
access_string="on ~* +@all",
engine="redis",
passwords_wo=elasticache_password,
passwords_wo_version=1)
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",
PasswordsWo = elasticachePassword,
PasswordsWoVersion = 1,
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/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"),
PasswordsWo: pulumi.Any(elasticachePassword),
PasswordsWoVersion: pulumi.Int(1),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_elasticache_user" "test" {
user_id = "testUserId"
user_name = "testUserName"
access_string = "on ~* +@all"
engine = "redis"
passwords_wo = elasticachePassword
passwords_wo_version = 1 # Increment to trigger password update
}
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.ArrayList;
import java.util.Arrays;
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")
.passwordsWo(elasticachePassword)
.passwordsWoVersion(1)
.build());
}
}
resources:
test:
type: aws:elasticache:User
properties:
userId: testUserId
userName: testUserName
accessString: on ~* +@all
engine: redis
passwordsWo: ${elasticachePassword}
passwordsWoVersion: 1 # Increment to trigger password update
Import
Using pulumi import, import ElastiCache users using the userId. For example:
$ pulumi import aws:elasticache/user:User my_user userId1
Constructors
- User(String name, {UserArgs? args, CustomResourceOptions? options})
-
Creates a new User.
nameThe Pulumi resource name.argsArguments used to configure this User. The set of arguments for User.optionsResource options controlling this resource's behavior. - User.reference(String urn)
- Creates a typed reference to an existing User resource.
Properties
-
accessString
↔ Output<
String> -
Access permissions string used for this user. See Specifying Permissions Using an Access String for more details.
latefinal
-
arn
↔ Output<
String> -
The ARN of the created ElastiCache User.
latefinal
-
authenticationMode
↔ Output<
UserAuthenticationMode> -
Denotes the user's authentication properties. Detailed below.
latefinal
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
engine
↔ Output<
String> -
The current supported values are
redis,valkey(case insensitive).latefinal - hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
noPasswordRequired
↔ Output<
bool?> -
Indicates a password is not required for this user.
latefinal
-
passwords
↔ Output<
List< String> ?> -
Passwords used for this user. You can create up to two passwords for each user.
latefinal
-
passwordsWo
↔ Output<
String?> -
NOTE: This field is write-only and its value will not be updated in state as part of read operations.
Write-only password for this user. This argument is not stored in state. Conflicts with
passwordsandauthenticationMode. See Write-Only Arguments for more information. Requires Terraform 1.11+.latefinal -
passwordsWoVersion
↔ Output<
int?> -
Version number for
passwordsWo. Increment this value to trigger a password update. Required when usingpasswordsWo.latefinal -
region
↔ Output<
String> -
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
A list of tags to be added to this resource. A tag is a key-value pair.
latefinal
-
latefinal
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
-
userId
↔ Output<
String> -
The ID of the user.
latefinal
-
userName
↔ Output<
String> -
The username of the user.
latefinal
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited