storage_lens
Creates, updates, deletes or gets a storage_len
resource or lists storage_lens
in a region
Overview
Name | storage_lens |
Type | Resource |
Description | The AWS::S3::StorageLens resource is an Amazon S3 resource type that you can use to create Storage Lens configurations. |
Id | aws.s3.storage_lens |
Fields
Name | Datatype | Description |
---|---|---|
storage_lens_configuration | object | Specifies the details of Amazon S3 Storage Lens configuration. |
tags | array | A set of tags (key-value pairs) for this Amazon S3 Storage Lens configuration. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | StorageLensConfiguration, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__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
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.s3.storage_lens (
StorageLensConfiguration,
region
)
SELECT
'{{ StorageLensConfiguration }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.s3.storage_lens (
StorageLensConfiguration,
Tags,
region
)
SELECT
'{{ StorageLensConfiguration }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: storage_len
props:
- name: StorageLensConfiguration
value:
Id: '{{ Id }}'
Include:
Buckets:
- '{{ Buckets[0] }}'
Regions:
- '{{ Regions[0] }}'
Exclude: null
AwsOrg:
Arn: null
AccountLevel:
ActivityMetrics:
IsEnabled: '{{ IsEnabled }}'
AdvancedCostOptimizationMetrics:
IsEnabled: '{{ IsEnabled }}'
AdvancedDataProtectionMetrics:
IsEnabled: '{{ IsEnabled }}'
DetailedStatusCodesMetrics:
IsEnabled: '{{ IsEnabled }}'
BucketLevel:
ActivityMetrics: null
AdvancedCostOptimizationMetrics: null
AdvancedDataProtectionMetrics: null
DetailedStatusCodesMetrics: null
PrefixLevel:
StorageMetrics:
IsEnabled: '{{ IsEnabled }}'
SelectionCriteria:
MaxDepth: '{{ MaxDepth }}'
Delimiter: '{{ Delimiter }}'
MinStorageBytesPercentage: null
StorageLensGroupLevel:
StorageLensGroupSelectionCriteria:
Include:
- '{{ Include[0] }}'
Exclude:
- null
DataExport:
S3BucketDestination:
OutputSchemaVersion: '{{ OutputSchemaVersion }}'
Format: '{{ Format }}'
AccountId: '{{ AccountId }}'
Arn: '{{ Arn }}'
Prefix: '{{ Prefix }}'
Encryption: {}
CloudWatchMetrics:
IsEnabled: '{{ IsEnabled }}'
IsEnabled: '{{ IsEnabled }}'
StorageLensArn: '{{ StorageLensArn }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
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