Skip to content
GitHubXDiscord

User

The User resource lets you manage AWS MemoryDB Users, which are essential for controlling access to your MemoryDB clusters.

Create a basic MemoryDB user with required properties and an optional access string.

import AWS from "alchemy/aws/control";
const memoryDbUser = await AWS.MemoryDB.User("memoryDbUser", {
UserName: "memoryUser1",
AccessString: "on ~* +@all"
});

Configure a MemoryDB user with authentication mode and tags for better management.

const advancedMemoryDbUser = await AWS.MemoryDB.User("advancedMemoryDbUser", {
UserName: "memoryUser2",
AccessString: "on ~* +@all",
AuthenticationMode: {
Type: "password",
Passwords: ["SecurePassword123!"]
},
Tags: [
{ Key: "Environment", Value: "Production" },
{ Key: "Department", Value: "Engineering" }
]
});

Create a MemoryDB user with multiple authentication methods for enhanced security.

const multiAuthMemoryDbUser = await AWS.MemoryDB.User("multiAuthMemoryDbUser", {
UserName: "memoryUser3",
AccessString: "on ~* +@all",
AuthenticationMode: {
Type: "iam",
Passwords: ["AnotherSecurePassword456!"]
},
Tags: [
{ Key: "Project", Value: "MemoryDBMigration" }
]
});

Adopt an existing MemoryDB user instead of failing when the resource already exists.

const adoptExistingMemoryDbUser = await AWS.MemoryDB.User("existingUser", {
UserName: "existingUser1",
AccessString: "on ~* +@all",
adopt: true
});