AWS S3 Control

2023/11/15 - AWS S3 Control - 8 new2 updated api methods

Changes  Add 5 APIs to create, update, get, list, delete S3 Storage Lens group(eg. CreateStorageLensGroup), 3 APIs for tagging(TagResource,UntagResource,ListTagsForResource), and update to StorageLensConfiguration to allow metrics to be aggregated on Storage Lens groups.

UpdateStorageLensGroup (new) Link ¶

Updates the existing Storage Lens group.

To use this operation, you must have the permission to perform the s3:UpdateStorageLensGroup 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.

See also: AWS API Documentation

Request Syntax

client.update_storage_lens_group(
    Name='string',
    AccountId='string',
    StorageLensGroup={
        'Name': 'string',
        'Filter': {
            'MatchAnyPrefix': [
                'string',
            ],
            'MatchAnySuffix': [
                'string',
            ],
            'MatchAnyTag': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'MatchObjectAge': {
                'DaysGreaterThan': 123,
                'DaysLessThan': 123
            },
            'MatchObjectSize': {
                'BytesGreaterThan': 123,
                'BytesLessThan': 123
            },
            'And': {
                'MatchAnyPrefix': [
                    'string',
                ],
                'MatchAnySuffix': [
                    'string',
                ],
                'MatchAnyTag': [
                    {
                        'Key': 'string',
                        'Value': 'string'
                    },
                ],
                'MatchObjectAge': {
                    'DaysGreaterThan': 123,
                    'DaysLessThan': 123
                },
                'MatchObjectSize': {
                    'BytesGreaterThan': 123,
                    'BytesLessThan': 123
                }
            },
            'Or': {
                'MatchAnyPrefix': [
                    'string',
                ],
                'MatchAnySuffix': [
                    'string',
                ],
                'MatchAnyTag': [
                    {
                        'Key': 'string',
                        'Value': 'string'
                    },
                ],
                'MatchObjectAge': {
                    'DaysGreaterThan': 123,
                    'DaysLessThan': 123
                },
                'MatchObjectSize': {
                    'BytesGreaterThan': 123,
                    'BytesLessThan': 123
                }
            }
        },
        'StorageLensGroupArn': 'string'
    }
)
type Name:

string

param Name:

[REQUIRED]

The name of the Storage Lens group that you want to update.

type AccountId:

string

param AccountId:

[REQUIRED]

The Amazon Web Services account ID of the Storage Lens group owner.

type StorageLensGroup:

dict

param StorageLensGroup:

[REQUIRED]

The JSON file that contains the Storage Lens group configuration.

  • Name (string) -- [REQUIRED]

    Contains the name of the Storage Lens group.

  • Filter (dict) -- [REQUIRED]

    Sets the criteria for the Storage Lens group data that is displayed. For multiple filter conditions, the AND or OR logical operator is used.

    • MatchAnyPrefix (list) --

      Contains a list of prefixes. At least one prefix must be specified. Up to 10 prefixes are allowed.

      • (string) --

    • MatchAnySuffix (list) --

      Contains a list of suffixes. At least one suffix must be specified. Up to 10 suffixes are allowed.

      • (string) --

    • MatchAnyTag (list) --

      Contains the list of S3 object tags. At least one object tag must be specified. Up to 10 object tags are allowed.

      • (dict) --

        A container for a key-value name pair.

        • Key (string) -- [REQUIRED]

          Key of the tag

        • Value (string) -- [REQUIRED]

          Value of the tag

    • MatchObjectAge (dict) --

      Contains DaysGreaterThan and DaysLessThan to define the object age range (minimum and maximum number of days).

      • DaysGreaterThan (integer) --

        Specifies the maximum object age in days. Must be a positive whole number, greater than the minimum object age and less than or equal to 2,147,483,647.

      • DaysLessThan (integer) --

        Specifies the minimum object age in days. The value must be a positive whole number, greater than 0 and less than or equal to 2,147,483,647.

    • MatchObjectSize (dict) --

      Contains BytesGreaterThan and BytesLessThan to define the object size range (minimum and maximum number of Bytes).

      • BytesGreaterThan (integer) --

        Specifies the minimum object size in Bytes. The value must be a positive number, greater than 0 and less than 5 TB.

      • BytesLessThan (integer) --

        Specifies the maximum object size in Bytes. The value must be a positive number, greater than the minimum object size and less than 5 TB.

    • And (dict) --

      A logical operator that allows multiple filter conditions to be joined for more complex comparisons of Storage Lens group data. Objects must match all of the listed filter conditions that are joined by the And logical operator. Only one of each filter condition is allowed.

      • MatchAnyPrefix (list) --

        Contains a list of prefixes. At least one prefix must be specified. Up to 10 prefixes are allowed.

        • (string) --

      • MatchAnySuffix (list) --

        Contains a list of suffixes. At least one suffix must be specified. Up to 10 suffixes are allowed.

        • (string) --

      • MatchAnyTag (list) --

        Contains the list of object tags. At least one object tag must be specified. Up to 10 object tags are allowed.

        • (dict) --

          A container for a key-value name pair.

          • Key (string) -- [REQUIRED]

            Key of the tag

          • Value (string) -- [REQUIRED]

            Value of the tag

      • MatchObjectAge (dict) --

        Contains DaysGreaterThan and DaysLessThan to define the object age range (minimum and maximum number of days).

        • DaysGreaterThan (integer) --

          Specifies the maximum object age in days. Must be a positive whole number, greater than the minimum object age and less than or equal to 2,147,483,647.

        • DaysLessThan (integer) --

          Specifies the minimum object age in days. The value must be a positive whole number, greater than 0 and less than or equal to 2,147,483,647.

      • MatchObjectSize (dict) --

        Contains BytesGreaterThan and BytesLessThan to define the object size range (minimum and maximum number of Bytes).

        • BytesGreaterThan (integer) --

          Specifies the minimum object size in Bytes. The value must be a positive number, greater than 0 and less than 5 TB.

        • BytesLessThan (integer) --

          Specifies the maximum object size in Bytes. The value must be a positive number, greater than the minimum object size and less than 5 TB.

    • Or (dict) --

      A single logical operator that allows multiple filter conditions to be joined. Objects can match any of the listed filter conditions, which are joined by the Or logical operator. Only one of each filter condition is allowed.

      • MatchAnyPrefix (list) --

        Filters objects that match any of the specified prefixes.

        • (string) --

      • MatchAnySuffix (list) --

        Filters objects that match any of the specified suffixes.

        • (string) --

      • MatchAnyTag (list) --

        Filters objects that match any of the specified S3 object tags.

        • (dict) --

          A container for a key-value name pair.

          • Key (string) -- [REQUIRED]

            Key of the tag

          • Value (string) -- [REQUIRED]

            Value of the tag

      • MatchObjectAge (dict) --

        Filters objects that match the specified object age range.

        • DaysGreaterThan (integer) --

          Specifies the maximum object age in days. Must be a positive whole number, greater than the minimum object age and less than or equal to 2,147,483,647.

        • DaysLessThan (integer) --

          Specifies the minimum object age in days. The value must be a positive whole number, greater than 0 and less than or equal to 2,147,483,647.

      • MatchObjectSize (dict) --

        Filters objects that match the specified object size range.

        • BytesGreaterThan (integer) --

          Specifies the minimum object size in Bytes. The value must be a positive number, greater than 0 and less than 5 TB.

        • BytesLessThan (integer) --

          Specifies the maximum object size in Bytes. The value must be a positive number, greater than the minimum object size and less than 5 TB.

  • StorageLensGroupArn (string) --

    Contains the Amazon Resource Name (ARN) of the Storage Lens group. This property is read-only.

returns:

None

TagResource (new) Link ¶

Creates a new Amazon Web Services resource tag or updates an existing resource tag. You can add up to 50 Amazon Web Services resource tags for each S3 resource.

To use this operation, you must have the 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 S3 Tagging errors, see List of Amazon S3 Tagging error codes.

See also: AWS API Documentation

Request Syntax

client.tag_resource(
    AccountId='string',
    ResourceArn='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type AccountId:

string

param AccountId:

[REQUIRED]

The Amazon Web Services account ID that created the S3 resource that you're trying to add tags to.

type ResourceArn:

string

param ResourceArn:

[REQUIRED]

The Amazon Resource Name (ARN) of the S3 resource that you're trying to add tags to.

type Tags:

list

param Tags:

[REQUIRED]

The Amazon Web Services resource tags that you want to add to the specified S3 resource.

  • (dict) --

    An Amazon Web Services resource tag that's associated with your S3 resource. You can add tags to new objects when you upload them, or you can add object tags to existing objects.

    • Key (string) -- [REQUIRED]

      The tag key for your Amazon Web Services resource. A tag key can be up to 128 Unicode characters in length and is case-sensitive. System created tags that begin with aws: aren’t supported.

    • Value (string) -- [REQUIRED]

      The tag value for your Amazon Web Services resource. A tag value can be up to 256 Unicode characters in length and is case-sensitive.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

DeleteStorageLensGroup (new) Link ¶

Deletes an existing S3 Storage Lens group.

To use this operation, you must have the permission to perform the s3:DeleteStorageLensGroup 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.

See also: AWS API Documentation

Request Syntax

client.delete_storage_lens_group(
    Name='string',
    AccountId='string'
)
type Name:

string

param Name:

[REQUIRED]

The name of the Storage Lens group that you're trying to delete.

type AccountId:

string

param AccountId:

[REQUIRED]

The Amazon Web Services account ID used to create the Storage Lens group that you're trying to delete.

returns:

None

ListTagsForResource (new) Link ¶

This operation allows you to list all the Amazon Web Services resource tags for the specified resource.

To use this operation, you must have the permission to perform the s3:ListTagsForResource action. For more information about the required Storage Lens Groups permissions, see Setting account permissions to use S3 Storage Lens groups.

For information about S3 Tagging errors, see List of Amazon S3 Tagging error codes.

See also: AWS API Documentation

Request Syntax

client.list_tags_for_resource(
    AccountId='string',
    ResourceArn='string'
)
type AccountId:

string

param AccountId:

[REQUIRED]

The Amazon Web Services account ID of the resource owner.

type ResourceArn:

string

param ResourceArn:

[REQUIRED]

The Amazon Resource Name (ARN) of the S3 resource that you want to list the tags for.

rtype:

dict

returns:

Response Syntax

{
    'Tags': [
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • Tags (list) --

      The Amazon Web Services resource tags that are associated with the resource.

      • (dict) --

        An Amazon Web Services resource tag that's associated with your S3 resource. You can add tags to new objects when you upload them, or you can add object tags to existing objects.

        • Key (string) --

          The tag key for your Amazon Web Services resource. A tag key can be up to 128 Unicode characters in length and is case-sensitive. System created tags that begin with aws: aren’t supported.

        • Value (string) --

          The tag value for your Amazon Web Services resource. A tag value can be up to 256 Unicode characters in length and is case-sensitive.

GetStorageLensGroup (new) Link ¶

Retrieves the Storage Lens group configuration details.

To use this operation, you must have the permission to perform the s3:GetStorageLensGroup 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.

See also: AWS API Documentation

Request Syntax

client.get_storage_lens_group(
    Name='string',
    AccountId='string'
)
type Name:

string

param Name:

[REQUIRED]

The name of the Storage Lens group that you're trying to retrieve the configuration details for.

type AccountId:

string

param AccountId:

[REQUIRED]

The Amazon Web Services account ID associated with the Storage Lens group that you're trying to retrieve the details for.

rtype:

dict

returns:

Response Syntax

{
    'StorageLensGroup': {
        'Name': 'string',
        'Filter': {
            'MatchAnyPrefix': [
                'string',
            ],
            'MatchAnySuffix': [
                'string',
            ],
            'MatchAnyTag': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'MatchObjectAge': {
                'DaysGreaterThan': 123,
                'DaysLessThan': 123
            },
            'MatchObjectSize': {
                'BytesGreaterThan': 123,
                'BytesLessThan': 123
            },
            'And': {
                'MatchAnyPrefix': [
                    'string',
                ],
                'MatchAnySuffix': [
                    'string',
                ],
                'MatchAnyTag': [
                    {
                        'Key': 'string',
                        'Value': 'string'
                    },
                ],
                'MatchObjectAge': {
                    'DaysGreaterThan': 123,
                    'DaysLessThan': 123
                },
                'MatchObjectSize': {
                    'BytesGreaterThan': 123,
                    'BytesLessThan': 123
                }
            },
            'Or': {
                'MatchAnyPrefix': [
                    'string',
                ],
                'MatchAnySuffix': [
                    'string',
                ],
                'MatchAnyTag': [
                    {
                        'Key': 'string',
                        'Value': 'string'
                    },
                ],
                'MatchObjectAge': {
                    'DaysGreaterThan': 123,
                    'DaysLessThan': 123
                },
                'MatchObjectSize': {
                    'BytesGreaterThan': 123,
                    'BytesLessThan': 123
                }
            }
        },
        'StorageLensGroupArn': 'string'
    }
}

Response Structure

  • (dict) --

    • StorageLensGroup (dict) --

      The name of the Storage Lens group that you're trying to retrieve the configuration details for.

      • Name (string) --

        Contains the name of the Storage Lens group.

      • Filter (dict) --

        Sets the criteria for the Storage Lens group data that is displayed. For multiple filter conditions, the AND or OR logical operator is used.

        • MatchAnyPrefix (list) --

          Contains a list of prefixes. At least one prefix must be specified. Up to 10 prefixes are allowed.

          • (string) --

        • MatchAnySuffix (list) --

          Contains a list of suffixes. At least one suffix must be specified. Up to 10 suffixes are allowed.

          • (string) --

        • MatchAnyTag (list) --

          Contains the list of S3 object tags. At least one object tag must be specified. Up to 10 object tags are allowed.

          • (dict) --

            A container for a key-value name pair.

            • Key (string) --

              Key of the tag

            • Value (string) --

              Value of the tag

        • MatchObjectAge (dict) --

          Contains DaysGreaterThan and DaysLessThan to define the object age range (minimum and maximum number of days).

          • DaysGreaterThan (integer) --

            Specifies the maximum object age in days. Must be a positive whole number, greater than the minimum object age and less than or equal to 2,147,483,647.

          • DaysLessThan (integer) --

            Specifies the minimum object age in days. The value must be a positive whole number, greater than 0 and less than or equal to 2,147,483,647.

        • MatchObjectSize (dict) --

          Contains BytesGreaterThan and BytesLessThan to define the object size range (minimum and maximum number of Bytes).

          • BytesGreaterThan (integer) --

            Specifies the minimum object size in Bytes. The value must be a positive number, greater than 0 and less than 5 TB.

          • BytesLessThan (integer) --

            Specifies the maximum object size in Bytes. The value must be a positive number, greater than the minimum object size and less than 5 TB.

        • And (dict) --

          A logical operator that allows multiple filter conditions to be joined for more complex comparisons of Storage Lens group data. Objects must match all of the listed filter conditions that are joined by the And logical operator. Only one of each filter condition is allowed.

          • MatchAnyPrefix (list) --

            Contains a list of prefixes. At least one prefix must be specified. Up to 10 prefixes are allowed.

            • (string) --

          • MatchAnySuffix (list) --

            Contains a list of suffixes. At least one suffix must be specified. Up to 10 suffixes are allowed.

            • (string) --

          • MatchAnyTag (list) --

            Contains the list of object tags. At least one object tag must be specified. Up to 10 object tags are allowed.

            • (dict) --

              A container for a key-value name pair.

              • Key (string) --

                Key of the tag

              • Value (string) --

                Value of the tag

          • MatchObjectAge (dict) --

            Contains DaysGreaterThan and DaysLessThan to define the object age range (minimum and maximum number of days).

            • DaysGreaterThan (integer) --

              Specifies the maximum object age in days. Must be a positive whole number, greater than the minimum object age and less than or equal to 2,147,483,647.

            • DaysLessThan (integer) --

              Specifies the minimum object age in days. The value must be a positive whole number, greater than 0 and less than or equal to 2,147,483,647.

          • MatchObjectSize (dict) --

            Contains BytesGreaterThan and BytesLessThan to define the object size range (minimum and maximum number of Bytes).

            • BytesGreaterThan (integer) --

              Specifies the minimum object size in Bytes. The value must be a positive number, greater than 0 and less than 5 TB.

            • BytesLessThan (integer) --

              Specifies the maximum object size in Bytes. The value must be a positive number, greater than the minimum object size and less than 5 TB.

        • Or (dict) --

          A single logical operator that allows multiple filter conditions to be joined. Objects can match any of the listed filter conditions, which are joined by the Or logical operator. Only one of each filter condition is allowed.

          • MatchAnyPrefix (list) --

            Filters objects that match any of the specified prefixes.

            • (string) --

          • MatchAnySuffix (list) --

            Filters objects that match any of the specified suffixes.

            • (string) --

          • MatchAnyTag (list) --

            Filters objects that match any of the specified S3 object tags.

            • (dict) --

              A container for a key-value name pair.

              • Key (string) --

                Key of the tag

              • Value (string) --

                Value of the tag

          • MatchObjectAge (dict) --

            Filters objects that match the specified object age range.

            • DaysGreaterThan (integer) --

              Specifies the maximum object age in days. Must be a positive whole number, greater than the minimum object age and less than or equal to 2,147,483,647.

            • DaysLessThan (integer) --

              Specifies the minimum object age in days. The value must be a positive whole number, greater than 0 and less than or equal to 2,147,483,647.

          • MatchObjectSize (dict) --

            Filters objects that match the specified object size range.

            • BytesGreaterThan (integer) --

              Specifies the minimum object size in Bytes. The value must be a positive number, greater than 0 and less than 5 TB.

            • BytesLessThan (integer) --

              Specifies the maximum object size in Bytes. The value must be a positive number, greater than the minimum object size and less than 5 TB.

      • StorageLensGroupArn (string) --

        Contains the Amazon Resource Name (ARN) of the Storage Lens group. This property is read-only.

CreateStorageLensGroup (new) Link ¶

Creates a new S3 Storage Lens group and associates it with the specified Amazon Web Services 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 Amazon Web Services 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 Amazon Web Services 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.

See also: AWS API Documentation

Request Syntax

client.create_storage_lens_group(
    AccountId='string',
    StorageLensGroup={
        'Name': 'string',
        'Filter': {
            'MatchAnyPrefix': [
                'string',
            ],
            'MatchAnySuffix': [
                'string',
            ],
            'MatchAnyTag': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'MatchObjectAge': {
                'DaysGreaterThan': 123,
                'DaysLessThan': 123
            },
            'MatchObjectSize': {
                'BytesGreaterThan': 123,
                'BytesLessThan': 123
            },
            'And': {
                'MatchAnyPrefix': [
                    'string',
                ],
                'MatchAnySuffix': [
                    'string',
                ],
                'MatchAnyTag': [
                    {
                        'Key': 'string',
                        'Value': 'string'
                    },
                ],
                'MatchObjectAge': {
                    'DaysGreaterThan': 123,
                    'DaysLessThan': 123
                },
                'MatchObjectSize': {
                    'BytesGreaterThan': 123,
                    'BytesLessThan': 123
                }
            },
            'Or': {
                'MatchAnyPrefix': [
                    'string',
                ],
                'MatchAnySuffix': [
                    'string',
                ],
                'MatchAnyTag': [
                    {
                        'Key': 'string',
                        'Value': 'string'
                    },
                ],
                'MatchObjectAge': {
                    'DaysGreaterThan': 123,
                    'DaysLessThan': 123
                },
                'MatchObjectSize': {
                    'BytesGreaterThan': 123,
                    'BytesLessThan': 123
                }
            }
        },
        'StorageLensGroupArn': 'string'
    },
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type AccountId:

string

param AccountId:

[REQUIRED]

The Amazon Web Services account ID that the Storage Lens group is created from and associated with.

type StorageLensGroup:

dict

param StorageLensGroup:

[REQUIRED]

The Storage Lens group configuration.

  • Name (string) -- [REQUIRED]

    Contains the name of the Storage Lens group.

  • Filter (dict) -- [REQUIRED]

    Sets the criteria for the Storage Lens group data that is displayed. For multiple filter conditions, the AND or OR logical operator is used.

    • MatchAnyPrefix (list) --

      Contains a list of prefixes. At least one prefix must be specified. Up to 10 prefixes are allowed.

      • (string) --

    • MatchAnySuffix (list) --

      Contains a list of suffixes. At least one suffix must be specified. Up to 10 suffixes are allowed.

      • (string) --

    • MatchAnyTag (list) --

      Contains the list of S3 object tags. At least one object tag must be specified. Up to 10 object tags are allowed.

      • (dict) --

        A container for a key-value name pair.

        • Key (string) -- [REQUIRED]

          Key of the tag

        • Value (string) -- [REQUIRED]

          Value of the tag

    • MatchObjectAge (dict) --

      Contains DaysGreaterThan and DaysLessThan to define the object age range (minimum and maximum number of days).

      • DaysGreaterThan (integer) --

        Specifies the maximum object age in days. Must be a positive whole number, greater than the minimum object age and less than or equal to 2,147,483,647.

      • DaysLessThan (integer) --

        Specifies the minimum object age in days. The value must be a positive whole number, greater than 0 and less than or equal to 2,147,483,647.

    • MatchObjectSize (dict) --

      Contains BytesGreaterThan and BytesLessThan to define the object size range (minimum and maximum number of Bytes).

      • BytesGreaterThan (integer) --

        Specifies the minimum object size in Bytes. The value must be a positive number, greater than 0 and less than 5 TB.

      • BytesLessThan (integer) --

        Specifies the maximum object size in Bytes. The value must be a positive number, greater than the minimum object size and less than 5 TB.

    • And (dict) --

      A logical operator that allows multiple filter conditions to be joined for more complex comparisons of Storage Lens group data. Objects must match all of the listed filter conditions that are joined by the And logical operator. Only one of each filter condition is allowed.

      • MatchAnyPrefix (list) --

        Contains a list of prefixes. At least one prefix must be specified. Up to 10 prefixes are allowed.

        • (string) --

      • MatchAnySuffix (list) --

        Contains a list of suffixes. At least one suffix must be specified. Up to 10 suffixes are allowed.

        • (string) --

      • MatchAnyTag (list) --

        Contains the list of object tags. At least one object tag must be specified. Up to 10 object tags are allowed.

        • (dict) --

          A container for a key-value name pair.

          • Key (string) -- [REQUIRED]

            Key of the tag

          • Value (string) -- [REQUIRED]

            Value of the tag

      • MatchObjectAge (dict) --

        Contains DaysGreaterThan and DaysLessThan to define the object age range (minimum and maximum number of days).

        • DaysGreaterThan (integer) --

          Specifies the maximum object age in days. Must be a positive whole number, greater than the minimum object age and less than or equal to 2,147,483,647.

        • DaysLessThan (integer) --

          Specifies the minimum object age in days. The value must be a positive whole number, greater than 0 and less than or equal to 2,147,483,647.

      • MatchObjectSize (dict) --

        Contains BytesGreaterThan and BytesLessThan to define the object size range (minimum and maximum number of Bytes).

        • BytesGreaterThan (integer) --

          Specifies the minimum object size in Bytes. The value must be a positive number, greater than 0 and less than 5 TB.

        • BytesLessThan (integer) --

          Specifies the maximum object size in Bytes. The value must be a positive number, greater than the minimum object size and less than 5 TB.

    • Or (dict) --

      A single logical operator that allows multiple filter conditions to be joined. Objects can match any of the listed filter conditions, which are joined by the Or logical operator. Only one of each filter condition is allowed.

      • MatchAnyPrefix (list) --

        Filters objects that match any of the specified prefixes.

        • (string) --

      • MatchAnySuffix (list) --

        Filters objects that match any of the specified suffixes.

        • (string) --

      • MatchAnyTag (list) --

        Filters objects that match any of the specified S3 object tags.

        • (dict) --

          A container for a key-value name pair.

          • Key (string) -- [REQUIRED]

            Key of the tag

          • Value (string) -- [REQUIRED]

            Value of the tag

      • MatchObjectAge (dict) --

        Filters objects that match the specified object age range.

        • DaysGreaterThan (integer) --

          Specifies the maximum object age in days. Must be a positive whole number, greater than the minimum object age and less than or equal to 2,147,483,647.

        • DaysLessThan (integer) --

          Specifies the minimum object age in days. The value must be a positive whole number, greater than 0 and less than or equal to 2,147,483,647.

      • MatchObjectSize (dict) --

        Filters objects that match the specified object size range.

        • BytesGreaterThan (integer) --

          Specifies the minimum object size in Bytes. The value must be a positive number, greater than 0 and less than 5 TB.

        • BytesLessThan (integer) --

          Specifies the maximum object size in Bytes. The value must be a positive number, greater than the minimum object size and less than 5 TB.

  • StorageLensGroupArn (string) --

    Contains the Amazon Resource Name (ARN) of the Storage Lens group. This property is read-only.

type Tags:

list

param Tags:

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

  • (dict) --

    An Amazon Web Services resource tag that's associated with your S3 resource. You can add tags to new objects when you upload them, or you can add object tags to existing objects.

    • Key (string) -- [REQUIRED]

      The tag key for your Amazon Web Services resource. A tag key can be up to 128 Unicode characters in length and is case-sensitive. System created tags that begin with aws: aren’t supported.

    • Value (string) -- [REQUIRED]

      The tag value for your Amazon Web Services resource. A tag value can be up to 256 Unicode characters in length and is case-sensitive.

returns:

None

UntagResource (new) Link ¶

This operation removes the specified Amazon Web Services resource tags from an S3 resource.

To use this operation, you must have the permission to perform the s3:UntagResource action. For more information about the required Storage Lens Groups permissions, see Setting account permissions to use S3 Storage Lens groups.

For information about S3 Tagging errors, see List of Amazon S3 Tagging error codes.

See also: AWS API Documentation

Request Syntax

client.untag_resource(
    AccountId='string',
    ResourceArn='string',
    TagKeys=[
        'string',
    ]
)
type AccountId:

string

param AccountId:

[REQUIRED]

The Amazon Web Services account ID that owns the resource that you're trying to remove the tags from.

type ResourceArn:

string

param ResourceArn:

[REQUIRED]

The Amazon Resource Name (ARN) of the S3 resource that you want to remove the resource tags from.

type TagKeys:

list

param TagKeys:

[REQUIRED]

The tag key pair of the S3 resource tag that you're trying to remove.

  • (string) --

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

ListStorageLensGroups (new) Link ¶

Lists all the Storage Lens groups in the specified home Region.

To use this operation, you must have the permission to perform the s3:ListStorageLensGroups 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.

See also: AWS API Documentation

Request Syntax

client.list_storage_lens_groups(
    AccountId='string',
    NextToken='string'
)
type AccountId:

string

param AccountId:

[REQUIRED]

The Amazon Web Services account ID that owns the Storage Lens groups.

type NextToken:

string

param NextToken:

The token for the next set of results, or null if there are no more results.

rtype:

dict

returns:

Response Syntax

{
    'NextToken': 'string',
    'StorageLensGroupList': [
        {
            'Name': 'string',
            'StorageLensGroupArn': 'string',
            'HomeRegion': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • NextToken (string) --

      If NextToken is returned, there are more Storage Lens groups results available. The value of NextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours.

    • StorageLensGroupList (list) --

      The list of Storage Lens groups that exist in the specified home Region.

      • (dict) --

        Each entry contains a Storage Lens group that exists in the specified home Region.

        • Name (string) --

          Contains the name of the Storage Lens group that exists in the specified home Region.

        • StorageLensGroupArn (string) --

          Contains the Amazon Resource Name (ARN) of the Storage Lens group. This property is read-only.

        • HomeRegion (string) --

          Contains the Amazon Web Services Region where the Storage Lens group was created.

GetStorageLensConfiguration (updated) Link ¶
Changes (response)
{'StorageLensConfiguration': {'AccountLevel': {'StorageLensGroupLevel': {'SelectionCriteria': {'Exclude': ['string'],
                                                                                               'Include': ['string']}}}}}

Gets the Amazon S3 Storage Lens configuration. For more information, see Assessing your storage activity and usage with Amazon S3 Storage Lens in the Amazon S3 User Guide. For a complete list of S3 Storage Lens metrics, see S3 Storage Lens metrics glossary in the Amazon S3 User Guide.

See also: AWS API Documentation

Request Syntax

client.get_storage_lens_configuration(
    ConfigId='string',
    AccountId='string'
)
type ConfigId:

string

param ConfigId:

[REQUIRED]

The ID of the Amazon S3 Storage Lens configuration.

type AccountId:

string

param AccountId:

[REQUIRED]

The account ID of the requester.

rtype:

dict

returns:

Response Syntax

{
    'StorageLensConfiguration': {
        'Id': 'string',
        'AccountLevel': {
            'ActivityMetrics': {
                'IsEnabled': True|False
            },
            'BucketLevel': {
                'ActivityMetrics': {
                    'IsEnabled': True|False
                },
                'PrefixLevel': {
                    'StorageMetrics': {
                        'IsEnabled': True|False,
                        'SelectionCriteria': {
                            'Delimiter': 'string',
                            'MaxDepth': 123,
                            'MinStorageBytesPercentage': 123.0
                        }
                    }
                },
                'AdvancedCostOptimizationMetrics': {
                    'IsEnabled': True|False
                },
                'AdvancedDataProtectionMetrics': {
                    'IsEnabled': True|False
                },
                'DetailedStatusCodesMetrics': {
                    'IsEnabled': True|False
                }
            },
            'AdvancedCostOptimizationMetrics': {
                'IsEnabled': True|False
            },
            'AdvancedDataProtectionMetrics': {
                'IsEnabled': True|False
            },
            'DetailedStatusCodesMetrics': {
                'IsEnabled': True|False
            },
            'StorageLensGroupLevel': {
                'SelectionCriteria': {
                    'Include': [
                        'string',
                    ],
                    'Exclude': [
                        'string',
                    ]
                }
            }
        },
        'Include': {
            'Buckets': [
                'string',
            ],
            'Regions': [
                'string',
            ]
        },
        'Exclude': {
            'Buckets': [
                'string',
            ],
            'Regions': [
                'string',
            ]
        },
        'DataExport': {
            'S3BucketDestination': {
                'Format': 'CSV'|'Parquet',
                'OutputSchemaVersion': 'V_1',
                'AccountId': 'string',
                'Arn': 'string',
                'Prefix': 'string',
                'Encryption': {
                    'SSES3': {},
                    'SSEKMS': {
                        'KeyId': 'string'
                    }
                }
            },
            'CloudWatchMetrics': {
                'IsEnabled': True|False
            }
        },
        'IsEnabled': True|False,
        'AwsOrg': {
            'Arn': 'string'
        },
        'StorageLensArn': 'string'
    }
}

Response Structure

  • (dict) --

    • StorageLensConfiguration (dict) --

      The S3 Storage Lens configuration requested.

      • Id (string) --

        A container for the Amazon S3 Storage Lens configuration ID.

      • AccountLevel (dict) --

        A container for all the account-level configurations of your S3 Storage Lens configuration.

        • ActivityMetrics (dict) --

          A container element for S3 Storage Lens activity metrics.

          • IsEnabled (boolean) --

            A container that indicates whether activity metrics are enabled.

        • BucketLevel (dict) --

          A container element for the S3 Storage Lens bucket-level configuration.

          • ActivityMetrics (dict) --

            A container for the bucket-level activity metrics for S3 Storage Lens.

            • IsEnabled (boolean) --

              A container that indicates whether activity metrics are enabled.

          • PrefixLevel (dict) --

            A container for the prefix-level metrics for S3 Storage Lens.

            • StorageMetrics (dict) --

              A container for the prefix-level storage metrics for S3 Storage Lens.

              • IsEnabled (boolean) --

                A container for whether prefix-level storage metrics are enabled.

              • SelectionCriteria (dict) --

                • Delimiter (string) --

                  A container for the delimiter of the selection criteria being used.

                • MaxDepth (integer) --

                  The max depth of the selection criteria

                • MinStorageBytesPercentage (float) --

                  The minimum number of storage bytes percentage whose metrics will be selected.

          • AdvancedCostOptimizationMetrics (dict) --

            A container for bucket-level advanced cost-optimization metrics for S3 Storage Lens.

            • IsEnabled (boolean) --

              A container that indicates whether advanced cost-optimization metrics are enabled.

          • AdvancedDataProtectionMetrics (dict) --

            A container for bucket-level advanced data-protection metrics for S3 Storage Lens.

            • IsEnabled (boolean) --

              A container that indicates whether advanced data-protection metrics are enabled.

          • DetailedStatusCodesMetrics (dict) --

            A container for bucket-level detailed status code metrics for S3 Storage Lens.

            • IsEnabled (boolean) --

              A container that indicates whether detailed status code metrics are enabled.

        • AdvancedCostOptimizationMetrics (dict) --

          A container element for S3 Storage Lens advanced cost-optimization metrics.

          • IsEnabled (boolean) --

            A container that indicates whether advanced cost-optimization metrics are enabled.

        • AdvancedDataProtectionMetrics (dict) --

          A container element for S3 Storage Lens advanced data-protection metrics.

          • IsEnabled (boolean) --

            A container that indicates whether advanced data-protection metrics are enabled.

        • DetailedStatusCodesMetrics (dict) --

          A container element for detailed status code metrics.

          • IsEnabled (boolean) --

            A container that indicates whether detailed status code metrics are enabled.

        • StorageLensGroupLevel (dict) --

          A container element for S3 Storage Lens groups metrics.

          • SelectionCriteria (dict) --

            Indicates which Storage Lens group ARNs to include or exclude in the Storage Lens group aggregation. If this value is left null, then all Storage Lens groups are selected.

            • Include (list) --

              Indicates which Storage Lens group ARNs to include in the Storage Lens group aggregation.

              • (string) --

            • Exclude (list) --

              Indicates which Storage Lens group ARNs to exclude from the Storage Lens group aggregation.

              • (string) --

      • Include (dict) --

        A container for what is included in this configuration. This container can only be valid if there is no Exclude container submitted, and it's not empty.

        • Buckets (list) --

          A container for the S3 Storage Lens bucket includes.

          • (string) --

        • Regions (list) --

          A container for the S3 Storage Lens Region includes.

          • (string) --

      • Exclude (dict) --

        A container for what is excluded in this configuration. This container can only be valid if there is no Include container submitted, and it's not empty.

        • Buckets (list) --

          A container for the S3 Storage Lens bucket excludes.

          • (string) --

        • Regions (list) --

          A container for the S3 Storage Lens Region excludes.

          • (string) --

      • DataExport (dict) --

        A container to specify the properties of your S3 Storage Lens metrics export including, the destination, schema and format.

        • S3BucketDestination (dict) --

          A container for the bucket where the S3 Storage Lens metrics export will be located.

          • Format (string) --

          • OutputSchemaVersion (string) --

            The schema version of the export file.

          • AccountId (string) --

            The account ID of the owner of the S3 Storage Lens metrics export bucket.

          • Arn (string) --

            The Amazon Resource Name (ARN) of the bucket. This property is read-only and follows the following format: arn:aws:s3:us-east-1:example-account-id:bucket/your-destination-bucket-name

          • Prefix (string) --

            The prefix of the destination bucket where the metrics export will be delivered.

          • Encryption (dict) --

            The container for the type encryption of the metrics exports in this bucket.

            • SSES3 (dict) --

            • SSEKMS (dict) --

              • KeyId (string) --

                A container for the ARN of the SSE-KMS encryption. This property is read-only and follows the following format: arn:aws:kms:us-east-1:example-account-id:key/example-9a73-4afc-8d29-8f5900cef44e

        • CloudWatchMetrics (dict) --

          A container for enabling Amazon CloudWatch publishing for S3 Storage Lens metrics.

          • IsEnabled (boolean) --

            A container that indicates whether CloudWatch publishing for S3 Storage Lens metrics is enabled. A value of true indicates that CloudWatch publishing for S3 Storage Lens metrics is enabled.

      • IsEnabled (boolean) --

        A container for whether the S3 Storage Lens configuration is enabled.

      • AwsOrg (dict) --

        A container for the Amazon Web Services organization for this S3 Storage Lens configuration.

        • Arn (string) --

          A container for the Amazon Resource Name (ARN) of the Amazon Web Services organization. This property is read-only and follows the following format: arn:aws:organizations:us-east-1:example-account-id:organization/o-ex2l495dck

      • StorageLensArn (string) --

        The Amazon Resource Name (ARN) of the S3 Storage Lens configuration. This property is read-only and follows the following format: arn:aws:s3:us-east-1:example-account-id:storage-lens/your-dashboard-name

PutStorageLensConfiguration (updated) Link ¶
Changes (request)
{'StorageLensConfiguration': {'AccountLevel': {'StorageLensGroupLevel': {'SelectionCriteria': {'Exclude': ['string'],
                                                                                               'Include': ['string']}}}}}

Puts an Amazon S3 Storage Lens configuration. For more information about S3 Storage Lens, see Working with Amazon S3 Storage Lens in the Amazon S3 User Guide. For a complete list of S3 Storage Lens metrics, see S3 Storage Lens metrics glossary in the Amazon S3 User Guide.

See also: AWS API Documentation

Request Syntax

client.put_storage_lens_configuration(
    ConfigId='string',
    AccountId='string',
    StorageLensConfiguration={
        'Id': 'string',
        'AccountLevel': {
            'ActivityMetrics': {
                'IsEnabled': True|False
            },
            'BucketLevel': {
                'ActivityMetrics': {
                    'IsEnabled': True|False
                },
                'PrefixLevel': {
                    'StorageMetrics': {
                        'IsEnabled': True|False,
                        'SelectionCriteria': {
                            'Delimiter': 'string',
                            'MaxDepth': 123,
                            'MinStorageBytesPercentage': 123.0
                        }
                    }
                },
                'AdvancedCostOptimizationMetrics': {
                    'IsEnabled': True|False
                },
                'AdvancedDataProtectionMetrics': {
                    'IsEnabled': True|False
                },
                'DetailedStatusCodesMetrics': {
                    'IsEnabled': True|False
                }
            },
            'AdvancedCostOptimizationMetrics': {
                'IsEnabled': True|False
            },
            'AdvancedDataProtectionMetrics': {
                'IsEnabled': True|False
            },
            'DetailedStatusCodesMetrics': {
                'IsEnabled': True|False
            },
            'StorageLensGroupLevel': {
                'SelectionCriteria': {
                    'Include': [
                        'string',
                    ],
                    'Exclude': [
                        'string',
                    ]
                }
            }
        },
        'Include': {
            'Buckets': [
                'string',
            ],
            'Regions': [
                'string',
            ]
        },
        'Exclude': {
            'Buckets': [
                'string',
            ],
            'Regions': [
                'string',
            ]
        },
        'DataExport': {
            'S3BucketDestination': {
                'Format': 'CSV'|'Parquet',
                'OutputSchemaVersion': 'V_1',
                'AccountId': 'string',
                'Arn': 'string',
                'Prefix': 'string',
                'Encryption': {
                    'SSES3': {}
                    ,
                    'SSEKMS': {
                        'KeyId': 'string'
                    }
                }
            },
            'CloudWatchMetrics': {
                'IsEnabled': True|False
            }
        },
        'IsEnabled': True|False,
        'AwsOrg': {
            'Arn': 'string'
        },
        'StorageLensArn': 'string'
    },
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type ConfigId:

string

param ConfigId:

[REQUIRED]

The ID of the S3 Storage Lens configuration.

type AccountId:

string

param AccountId:

[REQUIRED]

The account ID of the requester.

type StorageLensConfiguration:

dict

param StorageLensConfiguration:

[REQUIRED]

The S3 Storage Lens configuration.

  • Id (string) -- [REQUIRED]

    A container for the Amazon S3 Storage Lens configuration ID.

  • AccountLevel (dict) -- [REQUIRED]

    A container for all the account-level configurations of your S3 Storage Lens configuration.

    • ActivityMetrics (dict) --

      A container element for S3 Storage Lens activity metrics.

      • IsEnabled (boolean) --

        A container that indicates whether activity metrics are enabled.

    • BucketLevel (dict) -- [REQUIRED]

      A container element for the S3 Storage Lens bucket-level configuration.

      • ActivityMetrics (dict) --

        A container for the bucket-level activity metrics for S3 Storage Lens.

        • IsEnabled (boolean) --

          A container that indicates whether activity metrics are enabled.

      • PrefixLevel (dict) --

        A container for the prefix-level metrics for S3 Storage Lens.

        • StorageMetrics (dict) -- [REQUIRED]

          A container for the prefix-level storage metrics for S3 Storage Lens.

          • IsEnabled (boolean) --

            A container for whether prefix-level storage metrics are enabled.

          • SelectionCriteria (dict) --

            • Delimiter (string) --

              A container for the delimiter of the selection criteria being used.

            • MaxDepth (integer) --

              The max depth of the selection criteria

            • MinStorageBytesPercentage (float) --

              The minimum number of storage bytes percentage whose metrics will be selected.

      • AdvancedCostOptimizationMetrics (dict) --

        A container for bucket-level advanced cost-optimization metrics for S3 Storage Lens.

        • IsEnabled (boolean) --

          A container that indicates whether advanced cost-optimization metrics are enabled.

      • AdvancedDataProtectionMetrics (dict) --

        A container for bucket-level advanced data-protection metrics for S3 Storage Lens.

        • IsEnabled (boolean) --

          A container that indicates whether advanced data-protection metrics are enabled.

      • DetailedStatusCodesMetrics (dict) --

        A container for bucket-level detailed status code metrics for S3 Storage Lens.

        • IsEnabled (boolean) --

          A container that indicates whether detailed status code metrics are enabled.

    • AdvancedCostOptimizationMetrics (dict) --

      A container element for S3 Storage Lens advanced cost-optimization metrics.

      • IsEnabled (boolean) --

        A container that indicates whether advanced cost-optimization metrics are enabled.

    • AdvancedDataProtectionMetrics (dict) --

      A container element for S3 Storage Lens advanced data-protection metrics.

      • IsEnabled (boolean) --

        A container that indicates whether advanced data-protection metrics are enabled.

    • DetailedStatusCodesMetrics (dict) --

      A container element for detailed status code metrics.

      • IsEnabled (boolean) --

        A container that indicates whether detailed status code metrics are enabled.

    • StorageLensGroupLevel (dict) --

      A container element for S3 Storage Lens groups metrics.

      • SelectionCriteria (dict) --

        Indicates which Storage Lens group ARNs to include or exclude in the Storage Lens group aggregation. If this value is left null, then all Storage Lens groups are selected.

        • Include (list) --

          Indicates which Storage Lens group ARNs to include in the Storage Lens group aggregation.

          • (string) --

        • Exclude (list) --

          Indicates which Storage Lens group ARNs to exclude from the Storage Lens group aggregation.

          • (string) --

  • Include (dict) --

    A container for what is included in this configuration. This container can only be valid if there is no Exclude container submitted, and it's not empty.

    • Buckets (list) --

      A container for the S3 Storage Lens bucket includes.

      • (string) --

    • Regions (list) --

      A container for the S3 Storage Lens Region includes.

      • (string) --

  • Exclude (dict) --

    A container for what is excluded in this configuration. This container can only be valid if there is no Include container submitted, and it's not empty.

    • Buckets (list) --

      A container for the S3 Storage Lens bucket excludes.

      • (string) --

    • Regions (list) --

      A container for the S3 Storage Lens Region excludes.

      • (string) --

  • DataExport (dict) --

    A container to specify the properties of your S3 Storage Lens metrics export including, the destination, schema and format.

    • S3BucketDestination (dict) --

      A container for the bucket where the S3 Storage Lens metrics export will be located.

      • Format (string) -- [REQUIRED]

      • OutputSchemaVersion (string) -- [REQUIRED]

        The schema version of the export file.

      • AccountId (string) -- [REQUIRED]

        The account ID of the owner of the S3 Storage Lens metrics export bucket.

      • Arn (string) -- [REQUIRED]

        The Amazon Resource Name (ARN) of the bucket. This property is read-only and follows the following format: arn:aws:s3:us-east-1:example-account-id:bucket/your-destination-bucket-name

      • Prefix (string) --

        The prefix of the destination bucket where the metrics export will be delivered.

      • Encryption (dict) --

        The container for the type encryption of the metrics exports in this bucket.

        • SSES3 (dict) --

        • SSEKMS (dict) --

          • KeyId (string) -- [REQUIRED]

            A container for the ARN of the SSE-KMS encryption. This property is read-only and follows the following format: arn:aws:kms:us-east-1:example-account-id:key/example-9a73-4afc-8d29-8f5900cef44e

    • CloudWatchMetrics (dict) --

      A container for enabling Amazon CloudWatch publishing for S3 Storage Lens metrics.

      • IsEnabled (boolean) -- [REQUIRED]

        A container that indicates whether CloudWatch publishing for S3 Storage Lens metrics is enabled. A value of true indicates that CloudWatch publishing for S3 Storage Lens metrics is enabled.

  • IsEnabled (boolean) -- [REQUIRED]

    A container for whether the S3 Storage Lens configuration is enabled.

  • AwsOrg (dict) --

    A container for the Amazon Web Services organization for this S3 Storage Lens configuration.

    • Arn (string) -- [REQUIRED]

      A container for the Amazon Resource Name (ARN) of the Amazon Web Services organization. This property is read-only and follows the following format: arn:aws:organizations:us-east-1:example-account-id:organization/o-ex2l495dck

  • StorageLensArn (string) --

    The Amazon Resource Name (ARN) of the S3 Storage Lens configuration. This property is read-only and follows the following format: arn:aws:s3:us-east-1:example-account-id:storage-lens/your-dashboard-name

type Tags:

list

param Tags:

The tag set of the S3 Storage Lens configuration.

  • (dict) --

    • Key (string) -- [REQUIRED]

    • Value (string) -- [REQUIRED]

returns:

None