CreateAllowListCommand

Creates and defines the settings for an allow list.

Example Syntax

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

import { Macie2Client, CreateAllowListCommand } from "@aws-sdk/client-macie2"; // ES Modules import
// const { Macie2Client, CreateAllowListCommand } = require("@aws-sdk/client-macie2"); // CommonJS import
const client = new Macie2Client(config);
const input = { // CreateAllowListRequest
  clientToken: "STRING_VALUE", // required
  criteria: { // AllowListCriteria
    regex: "STRING_VALUE",
    s3WordsList: { // S3WordsList
      bucketName: "STRING_VALUE", // required
      objectKey: "STRING_VALUE", // required
    },
  },
  description: "STRING_VALUE",
  name: "STRING_VALUE", // required
  tags: { // TagMap
    "<keys>": "STRING_VALUE",
  },
};
const command = new CreateAllowListCommand(input);
const response = await client.send(command);
// { // CreateAllowListResponse
//   arn: "STRING_VALUE",
//   id: "STRING_VALUE",
// };

CreateAllowListCommand Input

See CreateAllowListCommandInput for more details

Parameter
Type
Description
criteria
Required
AllowListCriteria | undefined

The criteria that specify the text or text pattern to ignore. The criteria can be the location and name of an S3 object that lists specific text to ignore (s3WordsList), or a regular expression (regex) that defines a text pattern to ignore.

name
Required
string | undefined

A custom name for the allow list. The name can contain as many as 128 characters.

clientToken
string | undefined

A unique, case-sensitive token that you provide to ensure the idempotency of the request.

description
string | undefined

A custom description of the allow list. The description can contain as many as 512 characters.

tags
Record<string, string> | undefined

A map of key-value pairs that specifies the tags to associate with the allow list.

An allow list can have a maximum of 50 tags. Each tag consists of a tag key and an associated tag value. The maximum length of a tag key is 128 characters. The maximum length of a tag value is 256 characters.

CreateAllowListCommand Output

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

The Amazon Resource Name (ARN) of the allow list.

id
string | undefined

The unique identifier for the allow list.

Throws

Name
Fault
Details
AccessDeniedException
client

Provides information about an error that occurred due to insufficient access to a specified resource.

ConflictException
client

Provides information about an error that occurred due to a versioning conflict for a specified resource.

InternalServerException
server

Provides information about an error that occurred due to an unknown internal server error, exception, or failure.

ResourceNotFoundException
client

Provides information about an error that occurred because a specified resource wasn't found.

ServiceQuotaExceededException
client

Provides information about an error that occurred due to one or more service quotas for an account.

ThrottlingException
client

Provides information about an error that occurred because too many requests were sent during a certain amount of time.

ValidationException
client

Provides information about an error that occurred due to a syntax error in a request.

Macie2ServiceException
Base exception class for all service exceptions from Macie2 service.