CreateRoleMembershipCommand

Use CreateRoleMembership to add an existing Amazon QuickSight group to an existing role.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { QuickSightClient, CreateRoleMembershipCommand } from "@aws-sdk/client-quicksight"; // ES Modules import
// const { QuickSightClient, CreateRoleMembershipCommand } = require("@aws-sdk/client-quicksight"); // CommonJS import
const client = new QuickSightClient(config);
const input = { // CreateRoleMembershipRequest
  MemberName: "STRING_VALUE", // required
  AwsAccountId: "STRING_VALUE", // required
  Namespace: "STRING_VALUE", // required
  Role: "ADMIN" || "AUTHOR" || "READER" || "ADMIN_PRO" || "AUTHOR_PRO" || "READER_PRO", // required
};
const command = new CreateRoleMembershipCommand(input);
const response = await client.send(command);
// { // CreateRoleMembershipResponse
//   RequestId: "STRING_VALUE",
//   Status: Number("int"),
// };

CreateRoleMembershipCommand Input

Parameter
Type
Description
AwsAccountId
Required
string | undefined

The ID for the Amazon Web Services account that you want to create a group in. The Amazon Web Services account ID that you provide must be the same Amazon Web Services account that contains your Amazon QuickSight account.

MemberName
Required
string | undefined

The name of the group that you want to add to the role.

Namespace
Required
string | undefined

The namespace that the role belongs to.

Role
Required
Role | undefined

The role that you want to add a group to.

CreateRoleMembershipCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
RequestId
string | undefined

The Amazon Web Services request ID for this operation.

Status
number | undefined

The HTTP status of the request.

Throws

Name
Fault
Details
AccessDeniedException
client

You don't have access to this item. The provided credentials couldn't be validated. You might not be authorized to carry out the request. Make sure that your account is authorized to use the Amazon QuickSight service, that your policies have the correct permissions, and that you are using the correct credentials.

InternalFailureException
server

An internal failure occurred.

InvalidParameterValueException
client

One or more parameters has a value that isn't valid.

PreconditionNotMetException
client

One or more preconditions aren't met.

ResourceNotFoundException
client

One or more resources can't be found.

ResourceUnavailableException
server

This resource is currently unavailable.

ThrottlingException
client

Access is throttled.

QuickSightServiceException
Base exception class for all service exceptions from QuickSight service.