Skip to content

Resource: awsMemorydbUser

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. Read more about sensitive data in state.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
import * as random from "./.gen/providers/random";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: random.
For a more precise conversion please use the --provider flag in convert.*/
const randomPasswordExample = new random.password.Password(this, "example", {
  length: 16,
});
const awsMemorydbUserExample = new aws.memorydbUser.MemorydbUser(
  this,
  "example_1",
  {
    accessString: "on ~* &* +@all",
    authenticationMode: {
      passwords: [randomPasswordExample.result],
      type: "password",
    },
    userName: "my-user",
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsMemorydbUserExample.overrideLogicalId("example");

Argument Reference

The following arguments are required:

  • accessString - (Required) The access permissions string used for this user.
  • authenticationMode - (Required) Denotes the user's authentication properties. Detailed below.
  • userName - (Required, Forces new resource) Name of the MemoryDB user. Up to 40 characters.

The following arguments are optional:

  • tags - (Optional) A map of tags to assign to the resource. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

authentication_mode Configuration Block

  • passwords - (Required) The set of passwords used for authentication. You can create up to two passwords for each user.
  • type - (Required) Indicates whether the user requires a password to authenticate. Must be set to password.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - Same as userName.
  • arn - The ARN of the user.
  • minimumEngineVersion - The minimum engine version supported for the user.
  • authenticationMode configuration block
  • passwordCount - The number of passwords belonging to the user.
  • tagsAll - A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.

Import

Use the userName to import a user. For example:

$ terraform import aws_memorydb_user.example my-user

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