User Group Association Args
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
sinceaws.elasticache.UserGroupAssociation
changes the user IDs associated with the user group. You can ignore these changes with theignore_changes
option as shown in the example.
Example Usage
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 exampleUserGroup = new UserGroup("exampleUserGroup", 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(exampleUserGroup.userGroupId())
.userId(exampleUser.userId())
.build());
}
}
Content copied to clipboard
Import
ElastiCache user group associations can be imported using the user_group_id
and user_id
, e.g.,
$ pulumi import aws:elasticache/userGroupAssociation:UserGroupAssociation example userGoupId1,userId
Content copied to clipboard