Skip to main content

storage_lens

Creates, updates, deletes or gets a storage_len resource or lists storage_lens in a region

Overview

Namestorage_lens
TypeResource
DescriptionThe AWS::S3::StorageLens resource is an Amazon S3 resource type that you can use to create Storage Lens configurations.
Idaws.s3.storage_lens

Fields

NameDatatypeDescription
storage_lens_configurationobjectSpecifies the details of Amazon S3 Storage Lens configuration.
tagsarrayA set of tags (key-value pairs) for this Amazon S3 Storage Lens configuration.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTStorageLensConfiguration, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all storage_lens in a region.

SELECT
region,
storage_lens_configuration,
tags
FROM aws.s3.storage_lens
WHERE region = 'us-east-1';

Gets all properties from an individual storage_len.

SELECT
region,
storage_lens_configuration,
tags
FROM aws.s3.storage_lens
WHERE region = 'us-east-1' AND data__Identifier = '<StorageLensConfiguration/Id>';

INSERT example

Use the following StackQL query and manifest file to create a new storage_len resource, using stack-deploy.

/*+ create */
INSERT INTO aws.s3.storage_lens (
StorageLensConfiguration,
region
)
SELECT
'{{ StorageLensConfiguration }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.s3.storage_lens
WHERE data__Identifier = '<StorageLensConfiguration/Id>'
AND region = 'us-east-1';

Permissions

To operate on the storage_lens resource, the following permissions are required:

Create

s3:PutStorageLensConfiguration,
s3:PutStorageLensConfigurationTagging,
s3:GetStorageLensConfiguration,
s3:GetStorageLensConfigurationTagging,
organizations:DescribeOrganization,
organizations:ListAccounts,
organizations:ListAWSServiceAccessForOrganization,
organizations:ListDelegatedAdministrators,
iam:CreateServiceLinkedRole

Read

s3:GetStorageLensConfiguration,
s3:GetStorageLensConfigurationTagging

Update

s3:PutStorageLensConfiguration,
s3:PutStorageLensConfigurationTagging,
s3:GetStorageLensConfiguration,
s3:GetStorageLensConfigurationTagging,
organizations:DescribeOrganization,
organizations:ListAccounts,
organizations:ListAWSServiceAccessForOrganization,
organizations:ListDelegatedAdministrators,
iam:CreateServiceLinkedRole

Delete

s3:DeleteStorageLensConfiguration,
s3:DeleteStorageLensConfigurationTagging

List

s3:ListStorageLensConfigurations