- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
PutGroupCommand
Create, or updates, a mapping of users—who have access to a document—to groups.
You can also map sub groups to groups. For example, the group "Company Intellectual Property Teams" includes sub groups "Research" and "Engineering". These sub groups include their own list of users or people who work in these teams. Only users who work in research and engineering, and therefore belong in the intellectual property group, can see top-secret company documents in their Amazon Q Business chat results.
There are two options for creating groups, either passing group members inline or using an S3 file via the S3PathForGroupMembers field. For inline groups, there is a limit of 1000 members per group and for provided S3 files there is a limit of 100 thousand members. When creating a group using an S3 file, you provide both an S3 file and a RoleArn
for Amazon Q Buisness to access the file.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { QBusinessClient, PutGroupCommand } from "@aws-sdk/client-qbusiness"; // ES Modules import
// const { QBusinessClient, PutGroupCommand } = require("@aws-sdk/client-qbusiness"); // CommonJS import
const client = new QBusinessClient(config);
const input = { // PutGroupRequest
applicationId: "STRING_VALUE", // required
indexId: "STRING_VALUE", // required
groupName: "STRING_VALUE", // required
dataSourceId: "STRING_VALUE",
type: "INDEX" || "DATASOURCE", // required
groupMembers: { // GroupMembers
memberGroups: [ // MemberGroups
{ // MemberGroup
groupName: "STRING_VALUE", // required
type: "INDEX" || "DATASOURCE",
},
],
memberUsers: [ // MemberUsers
{ // MemberUser
userId: "STRING_VALUE", // required
type: "INDEX" || "DATASOURCE",
},
],
s3PathForGroupMembers: { // S3
bucket: "STRING_VALUE", // required
key: "STRING_VALUE", // required
},
},
roleArn: "STRING_VALUE",
};
const command = new PutGroupCommand(input);
const response = await client.send(command);
// {};
PutGroupCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
applicationId Required | string | undefined | The identifier of the application in which the user and group mapping belongs. |
groupMembers Required | GroupMembers | undefined | A list of users or sub groups that belong to a group. This is for generating Amazon Q Business chat results only from document a user has access to. |
groupName Required | string | undefined | The list that contains your users or sub groups that belong the same group. For example, the group "Company" includes the user "CEO" and the sub groups "Research", "Engineering", and "Sales and Marketing". |
indexId Required | string | undefined | The identifier of the index in which you want to map users to their groups. |
type Required | MembershipType | undefined | The type of the group. |
dataSourceId | string | undefined | The identifier of the data source for which you want to map users to their groups. This is useful if a group is tied to multiple data sources, but you only want the group to access documents of a certain data source. For example, the groups "Research", "Engineering", and "Sales and Marketing" are all tied to the company's documents stored in the data sources Confluence and Salesforce. However, "Sales and Marketing" team only needs access to customer-related documents stored in Salesforce. |
roleArn | string | undefined | The Amazon Resource Name (ARN) of an IAM role that has access to the S3 file that contains your list of users that belong to a group. |
PutGroupCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDeniedException | client | You don't have access to perform this action. Make sure you have the required permission policies and user accounts and try again. |
ConflictException | client | You are trying to perform an action that conflicts with the current status of your resource. Fix any inconsistencies with your resources and try again. |
InternalServerException | server | An issue occurred with the internal server used for your Amazon Q Business service. Wait some minutes and try again, or contact Support for help. |
ResourceNotFoundException | client | The application or plugin resource you want to use doesn’t exist. Make sure you have provided the correct resource and try again. |
ServiceQuotaExceededException | client | You have exceeded the set limits for your Amazon Q Business service. |
ThrottlingException | client | The request was denied due to throttling. Reduce the number of requests and try again. |
ValidationException | client | The input doesn't meet the constraints set by the Amazon Q Business service. Provide the correct input and try again. |
QBusinessServiceException | Base exception class for all service exceptions from QBusiness service. |