CreateStorageLensGroup - Amazon Simple Storage Service

CreateStorageLensGroup

Creates a new S3 Storage Lens group and associates it with the specified AWS account ID. An S3 Storage Lens group is a custom grouping of objects based on prefix, suffix, object tags, object size, object age, or a combination of these filters. For each Storage Lens group that you’ve created, you can also optionally add AWS resource tags. For more information about S3 Storage Lens groups, see Working with S3 Storage Lens groups.

To use this operation, you must have the permission to perform the s3:CreateStorageLensGroup action. If you’re trying to create a Storage Lens group with AWS resource tags, you must also have permission to perform the s3:TagResource action. For more information about the required Storage Lens Groups permissions, see Setting account permissions to use S3 Storage Lens groups.

For information about Storage Lens groups errors, see List of Amazon S3 Storage Lens error codes.

Request Syntax

POST /v20180820/storagelensgroup HTTP/1.1 Host: s3-control.amazonaws.com x-amz-account-id: AccountId <?xml version="1.0" encoding="UTF-8"?> <CreateStorageLensGroupRequest xmlns="http://awss3control.amazonaws.com/doc/2018-08-20/"> <StorageLensGroup> <Filter> <And> <MatchAnyPrefix> <Prefix>string</Prefix> </MatchAnyPrefix> <MatchAnySuffix> <Suffix>string</Suffix> </MatchAnySuffix> <MatchAnyTag> <Tag> <Key>string</Key> <Value>string</Value> </Tag> </MatchAnyTag> <MatchObjectAge> <DaysGreaterThan>integer</DaysGreaterThan> <DaysLessThan>integer</DaysLessThan> </MatchObjectAge> <MatchObjectSize> <BytesGreaterThan>long</BytesGreaterThan> <BytesLessThan>long</BytesLessThan> </MatchObjectSize> </And> <MatchAnyPrefix> <Prefix>string</Prefix> </MatchAnyPrefix> <MatchAnySuffix> <Suffix>string</Suffix> </MatchAnySuffix> <MatchAnyTag> <Tag> <Key>string</Key> <Value>string</Value> </Tag> </MatchAnyTag> <MatchObjectAge> <DaysGreaterThan>integer</DaysGreaterThan> <DaysLessThan>integer</DaysLessThan> </MatchObjectAge> <MatchObjectSize> <BytesGreaterThan>long</BytesGreaterThan> <BytesLessThan>long</BytesLessThan> </MatchObjectSize> <Or> <MatchAnyPrefix> <Prefix>string</Prefix> </MatchAnyPrefix> <MatchAnySuffix> <Suffix>string</Suffix> </MatchAnySuffix> <MatchAnyTag> <Tag> <Key>string</Key> <Value>string</Value> </Tag> </MatchAnyTag> <MatchObjectAge> <DaysGreaterThan>integer</DaysGreaterThan> <DaysLessThan>integer</DaysLessThan> </MatchObjectAge> <MatchObjectSize> <BytesGreaterThan>long</BytesGreaterThan> <BytesLessThan>long</BytesLessThan> </MatchObjectSize> </Or> </Filter> <Name>string</Name> <StorageLensGroupArn>string</StorageLensGroupArn> </StorageLensGroup> <Tags> <Tag> <Key>string</Key> <Value>string</Value> </Tag> </Tags> </CreateStorageLensGroupRequest>

URI Request Parameters

The request uses the following URI parameters.

x-amz-account-id

The AWS account ID that the Storage Lens group is created from and associated with.

Length Constraints: Maximum length of 64.

Pattern: ^\d{12}$

Required: Yes

Request Body

The request accepts the following data in XML format.

CreateStorageLensGroupRequest

Root level tag for the CreateStorageLensGroupRequest parameters.

Required: Yes

StorageLensGroup

The Storage Lens group configuration.

Type: StorageLensGroup data type

Required: Yes

Tags

The AWS resource tags that you're adding to your Storage Lens group. This parameter is optional.

Type: Array of Tag data types

Array Members: Minimum number of 0 items. Maximum number of 50 items.

Required: No

Response Syntax

HTTP/1.1 204

Response Elements

If the action is successful, the service sends back an HTTP 204 response with an empty HTTP body.

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: