UserGroupAssociationArgs

data class UserGroupAssociationArgs(val userGroupId: Output<String>? = null, val userId: Output<String>? = null) : ConvertibleToJava<UserGroupAssociationArgs>

Associate an existing ElastiCache user and an existing user group.

NOTE: The provider will detect changes in the aws.elasticache.UserGroup since aws.elasticache.UserGroupAssociation changes the user IDs associated with the user group. You can ignore these changes with the ignore_changes option as shown in the example.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const _default = new aws.elasticache.User("default", {
userId: "defaultUserID",
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 example = new aws.elasticache.UserGroup("example", {
engine: "REDIS",
userGroupId: "userGroupId",
userIds: [_default&#46;userId],
});
const exampleUser = new aws.elasticache.User("example", {
userId: "exampleUserID",
userName: "exampleuser",
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 exampleUserGroupAssociation = new aws.elasticache.UserGroupAssociation("example", {
userGroupId: example.userGroupId,
userId: exampleUser.userId,
});
import pulumi
import pulumi_aws as aws
default = aws.elasticache.User("default",
user_id="defaultUserID",
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"])
example = aws.elasticache.UserGroup("example",
engine="REDIS",
user_group_id="userGroupId",
user_ids=[default&#46;user_id])
example_user = aws.elasticache.User("example",
user_id="exampleUserID",
user_name="exampleuser",
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"])
example_user_group_association = aws.elasticache.UserGroupAssociation("example",
user_group_id=example.user_group_id,
user_id=example_user.user_id)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var @default = new Aws.ElastiCache.User("default", new()
{
UserId = "defaultUserID",
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 example = new Aws.ElastiCache.UserGroup("example", new()
{
Engine = "REDIS",
UserGroupId = "userGroupId",
UserIds = new[]
{
@default.UserId,
},
});
var exampleUser = new Aws.ElastiCache.User("example", new()
{
UserId = "exampleUserID",
UserName = "exampleuser",
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 exampleUserGroupAssociation = new Aws.ElastiCache.UserGroupAssociation("example", new()
{
UserGroupId = example.UserGroupId,
UserId = exampleUser.UserId,
});
});
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, "default", &elasticache.UserArgs{
UserId: pulumi.String("defaultUserID"),
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
}
example, err := elasticache.NewUserGroup(ctx, "example", &elasticache.UserGroupArgs{
Engine: pulumi.String("REDIS"),
UserGroupId: pulumi.String("userGroupId"),
UserIds: pulumi.StringArray{
_default.UserId,
},
})
if err != nil {
return err
}
exampleUser, err := elasticache.NewUser(ctx, "example", &elasticache.UserArgs{
UserId: pulumi.String("exampleUserID"),
UserName: pulumi.String("exampleuser"),
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.NewUserGroupAssociation(ctx, "example", &elasticache.UserGroupAssociationArgs{
UserGroupId: example.UserGroupId,
UserId: exampleUser.UserId,
})
if err != nil {
return err
}
return nil
})
}
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 com.pulumi.aws.elasticache.UserGroupAssociation;
import com.pulumi.aws.elasticache.UserGroupAssociationArgs;
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 default_ = new User("default", UserArgs.builder()
.userId("defaultUserID")
.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 example = new UserGroup("example", UserGroupArgs.builder()
.engine("REDIS")
.userGroupId("userGroupId")
.userIds(default_.userId())
.build());
var exampleUser = new User("exampleUser", UserArgs.builder()
.userId("exampleUserID")
.userName("exampleuser")
.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 exampleUserGroupAssociation = new UserGroupAssociation("exampleUserGroupAssociation", UserGroupAssociationArgs.builder()
.userGroupId(example.userGroupId())
.userId(exampleUser.userId())
.build());
}
}
resources:
default:
type: aws:elasticache:User
properties:
userId: defaultUserID
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
example:
type: aws:elasticache:UserGroup
properties:
engine: REDIS
userGroupId: userGroupId
userIds:
- ${default.userId}
exampleUser:
type: aws:elasticache:User
name: example
properties:
userId: exampleUserID
userName: exampleuser
accessString: on ~app::* -@all +@read +@hash +@bitmap +@geo -setbit -bitfield -hset -hsetnx -hmset -hincrby -hincrbyfloat -hdel -bitop -geoadd -georadius -georadiusbymember
engine: REDIS
passwords:
- password123456789
exampleUserGroupAssociation:
type: aws:elasticache:UserGroupAssociation
name: example
properties:
userGroupId: ${example.userGroupId}
userId: ${exampleUser.userId}

Import

Using pulumi import, import ElastiCache user group associations using the user_group_id and user_id. For example:

$ pulumi import aws:elasticache/userGroupAssociation:UserGroupAssociation example userGoupId1,userId

Constructors

Link copied to clipboard
constructor(userGroupId: Output<String>? = null, userId: Output<String>? = null)

Properties

Link copied to clipboard
val userGroupId: Output<String>? = null

ID of the user group.

Link copied to clipboard
val userId: Output<String>? = null

ID of the user to associated with the user group.

Functions

Link copied to clipboard
open override fun toJava(): UserGroupAssociationArgs