1. Packages
  2. AWS
  3. API Docs
  4. elasticache
  5. UserGroup
AWS v6.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

aws.elasticache.UserGroup

Explore with Pulumi AI

Provides an ElastiCache user group resource.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const test = new aws.elasticache.User("test", {
    userId: "testUserId",
    userName: "default",
    accessString: "on ~app::* -@all +@read +@hash +@bitmap +@geo -setbit -bitfield -hset -hsetnx -hmset -hincrby -hincrbyfloat -hdel -bitop -geoadd -georadius -georadiusbymember",
    engine: "redis",
    passwords: ["password123456789"],
});
const testUserGroup = new aws.elasticache.UserGroup("test", {
    engine: "redis",
    userGroupId: "userGroupId",
    userIds: [test.userId],
});
Copy
import pulumi
import pulumi_aws as aws

test = aws.elasticache.User("test",
    user_id="testUserId",
    user_name="default",
    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"])
test_user_group = aws.elasticache.UserGroup("test",
    engine="redis",
    user_group_id="userGroupId",
    user_ids=[test.user_id])
Copy
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 {
		test, err := elasticache.NewUser(ctx, "test", &elasticache.UserArgs{
			UserId:       pulumi.String("testUserId"),
			UserName:     pulumi.String("default"),
			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
		}
		_, err = elasticache.NewUserGroup(ctx, "test", &elasticache.UserGroupArgs{
			Engine:      pulumi.String("redis"),
			UserGroupId: pulumi.String("userGroupId"),
			UserIds: pulumi.StringArray{
				test.UserId,
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
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 = "default",
        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",
        },
    });

    var testUserGroup = new Aws.ElastiCache.UserGroup("test", new()
    {
        Engine = "redis",
        UserGroupId = "userGroupId",
        UserIds = new[]
        {
            test.UserId,
        },
    });

});
Copy
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.UserGroup;
import com.pulumi.aws.elasticache.UserGroupArgs;
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("default")
            .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());

        var testUserGroup = new UserGroup("testUserGroup", UserGroupArgs.builder()
            .engine("redis")
            .userGroupId("userGroupId")
            .userIds(test.userId())
            .build());

    }
}
Copy
resources:
  test:
    type: aws:elasticache:User
    properties:
      userId: testUserId
      userName: default
      accessString: on ~app::* -@all +@read +@hash +@bitmap +@geo -setbit -bitfield -hset -hsetnx -hmset -hincrby -hincrbyfloat -hdel -bitop -geoadd -georadius -georadiusbymember
      engine: redis
      passwords:
        - password123456789
  testUserGroup:
    type: aws:elasticache:UserGroup
    name: test
    properties:
      engine: redis
      userGroupId: userGroupId
      userIds:
        - ${test.userId}
Copy

Create UserGroup Resource

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

Constructor syntax

new UserGroup(name: string, args: UserGroupArgs, opts?: CustomResourceOptions);
@overload
def UserGroup(resource_name: str,
              args: UserGroupArgs,
              opts: Optional[ResourceOptions] = None)

@overload
def UserGroup(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              engine: Optional[str] = None,
              user_group_id: Optional[str] = None,
              tags: Optional[Mapping[str, str]] = None,
              user_ids: Optional[Sequence[str]] = None)
func NewUserGroup(ctx *Context, name string, args UserGroupArgs, opts ...ResourceOption) (*UserGroup, error)
public UserGroup(string name, UserGroupArgs args, CustomResourceOptions? opts = null)
public UserGroup(String name, UserGroupArgs args)
public UserGroup(String name, UserGroupArgs args, CustomResourceOptions options)
type: aws:elasticache:UserGroup
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. UserGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. UserGroupArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. UserGroupArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. UserGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. UserGroupArgs
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 awsUserGroupResource = new Aws.ElastiCache.UserGroup("awsUserGroupResource", new()
{
    Engine = "string",
    UserGroupId = "string",
    Tags = 
    {
        { "string", "string" },
    },
    UserIds = new[]
    {
        "string",
    },
});
Copy
example, err := elasticache.NewUserGroup(ctx, "awsUserGroupResource", &elasticache.UserGroupArgs{
	Engine:      pulumi.String("string"),
	UserGroupId: pulumi.String("string"),
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	UserIds: pulumi.StringArray{
		pulumi.String("string"),
	},
})
Copy
var awsUserGroupResource = new UserGroup("awsUserGroupResource", UserGroupArgs.builder()
    .engine("string")
    .userGroupId("string")
    .tags(Map.of("string", "string"))
    .userIds("string")
    .build());
Copy
aws_user_group_resource = aws.elasticache.UserGroup("awsUserGroupResource",
    engine="string",
    user_group_id="string",
    tags={
        "string": "string",
    },
    user_ids=["string"])
Copy
const awsUserGroupResource = new aws.elasticache.UserGroup("awsUserGroupResource", {
    engine: "string",
    userGroupId: "string",
    tags: {
        string: "string",
    },
    userIds: ["string"],
});
Copy
type: aws:elasticache:UserGroup
properties:
    engine: string
    tags:
        string: string
    userGroupId: string
    userIds:
        - string
Copy

UserGroup Resource Properties

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

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The UserGroup resource accepts the following input properties:

Engine This property is required. string
The current supported value are redis, valkey (case insensitive).
UserGroupId
This property is required.
Changes to this property will trigger replacement.
string

The ID of the user group.

The following arguments are optional:

Tags Dictionary<string, string>
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
UserIds List<string>
The list of user IDs that belong to the user group.
Engine This property is required. string
The current supported value are redis, valkey (case insensitive).
UserGroupId
This property is required.
Changes to this property will trigger replacement.
string

The ID of the user group.

The following arguments are optional:

Tags map[string]string
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
UserIds []string
The list of user IDs that belong to the user group.
engine This property is required. String
The current supported value are redis, valkey (case insensitive).
userGroupId
This property is required.
Changes to this property will trigger replacement.
String

The ID of the user group.

The following arguments are optional:

tags Map<String,String>
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
userIds List<String>
The list of user IDs that belong to the user group.
engine This property is required. string
The current supported value are redis, valkey (case insensitive).
userGroupId
This property is required.
Changes to this property will trigger replacement.
string

The ID of the user group.

The following arguments are optional:

tags {[key: string]: string}
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
userIds string[]
The list of user IDs that belong to the user group.
engine This property is required. str
The current supported value are redis, valkey (case insensitive).
user_group_id
This property is required.
Changes to this property will trigger replacement.
str

The ID of the user group.

The following arguments are optional:

tags Mapping[str, str]
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
user_ids Sequence[str]
The list of user IDs that belong to the user group.
engine This property is required. String
The current supported value are redis, valkey (case insensitive).
userGroupId
This property is required.
Changes to this property will trigger replacement.
String

The ID of the user group.

The following arguments are optional:

tags Map<String>
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
userIds List<String>
The list of user IDs that belong to the user group.

Outputs

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

Arn string
The ARN that identifies the user group.
Id string
The provider-assigned unique ID for this managed resource.
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
The ARN that identifies the user group.
Id string
The provider-assigned unique ID for this managed resource.
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
The ARN that identifies the user group.
id String
The provider-assigned unique ID for this managed resource.
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
The ARN that identifies the user group.
id string
The provider-assigned unique ID for this managed resource.
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
The ARN that identifies the user group.
id str
The provider-assigned unique ID for this managed resource.
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
The ARN that identifies the user group.
id String
The provider-assigned unique ID for this managed resource.
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 UserGroup Resource

Get an existing UserGroup 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?: UserGroupState, opts?: CustomResourceOptions): UserGroup
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        engine: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None,
        user_group_id: Optional[str] = None,
        user_ids: Optional[Sequence[str]] = None) -> UserGroup
func GetUserGroup(ctx *Context, name string, id IDInput, state *UserGroupState, opts ...ResourceOption) (*UserGroup, error)
public static UserGroup Get(string name, Input<string> id, UserGroupState? state, CustomResourceOptions? opts = null)
public static UserGroup get(String name, Output<String> id, UserGroupState state, CustomResourceOptions options)
resources:  _:    type: aws:elasticache:UserGroup    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Arn string
The ARN that identifies the user group.
Engine string
The current supported value are redis, valkey (case insensitive).
Tags Dictionary<string, string>
Key-value map of resource tags. 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.

UserGroupId Changes to this property will trigger replacement. string

The ID of the user group.

The following arguments are optional:

UserIds List<string>
The list of user IDs that belong to the user group.
Arn string
The ARN that identifies the user group.
Engine string
The current supported value are redis, valkey (case insensitive).
Tags map[string]string
Key-value map of resource tags. 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.

UserGroupId Changes to this property will trigger replacement. string

The ID of the user group.

The following arguments are optional:

UserIds []string
The list of user IDs that belong to the user group.
arn String
The ARN that identifies the user group.
engine String
The current supported value are redis, valkey (case insensitive).
tags Map<String,String>
Key-value map of resource tags. 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.

userGroupId Changes to this property will trigger replacement. String

The ID of the user group.

The following arguments are optional:

userIds List<String>
The list of user IDs that belong to the user group.
arn string
The ARN that identifies the user group.
engine string
The current supported value are redis, valkey (case insensitive).
tags {[key: string]: string}
Key-value map of resource tags. 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.

userGroupId Changes to this property will trigger replacement. string

The ID of the user group.

The following arguments are optional:

userIds string[]
The list of user IDs that belong to the user group.
arn str
The ARN that identifies the user group.
engine str
The current supported value are redis, valkey (case insensitive).
tags Mapping[str, str]
Key-value map of resource tags. 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_group_id Changes to this property will trigger replacement. str

The ID of the user group.

The following arguments are optional:

user_ids Sequence[str]
The list of user IDs that belong to the user group.
arn String
The ARN that identifies the user group.
engine String
The current supported value are redis, valkey (case insensitive).
tags Map<String>
Key-value map of resource tags. 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.

userGroupId Changes to this property will trigger replacement. String

The ID of the user group.

The following arguments are optional:

userIds List<String>
The list of user IDs that belong to the user group.

Import

Using pulumi import, import ElastiCache user groups using the user_group_id. For example:

$ pulumi import aws:elasticache/userGroup:UserGroup my_user_group userGoupId1
Copy

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.