AWS Amazon S3 Bucket Analytics Configuration

This page shows how to write Terraform and CloudFormation for Amazon S3 Bucket Analytics Configuration and write them securely.

aws_s3_bucket_analytics_configuration (Terraform)

The Bucket Analytics Configuration in Amazon S3 can be configured in Terraform with the resource name aws_s3_bucket_analytics_configuration. The following sections describe 4 examples of how to use the resource and its parameters.

Example Usage from GitHub

github-icongilyas/infracost
resource "aws_s3_bucket_analytics_configuration" "bucketanalytics" {
  bucket = aws_s3_bucket.bucket1.bucket
  name   = "bucketanalytics"
}

resource "aws_s3_bucket" "bucket1_withUsage" {
github-iconcpodieu1/Hello-Word
resource "aws_s3_bucket_analytics_configuration" "example-filtered" {
  bucket = aws_s3_bucket.example.bucket
  name   = "ImportantBlueDocuments"

  filter {
    prefix = "documents/"
github-iconinfracost/infracost
resource "aws_s3_bucket_analytics_configuration" "bucketanalytics" {
  bucket = aws_s3_bucket.bucket1.bucket
  name   = "bucketanalytics"
}

resource "aws_s3_bucket" "bucket1_withUsage" {
github-iconniveklabs/aws
resource "aws_s3_bucket_analytics_configuration" "this" {
  bucket = var.bucket
  name   = var.name

  dynamic "filter" {
    for_each = var.filter

Parameters

Explanation in Terraform Registry

Provides a S3 bucket analytics configuration resource.

AWS::S3::Bucket AnalyticsConfiguration (CloudFormation)

The Bucket AnalyticsConfiguration in S3 can be configured in CloudFormation with the resource name AWS::S3::Bucket AnalyticsConfiguration. The following sections describe how to use the resource and its parameters.

Parameters

Id The ID that identifies the analytics configuration.
Required: Yes
Type: String
Update requires: No interruption

Prefix The prefix that an object must have to be included in the analytics results.
Required: No
Type: String
Update requires: No interruption

StorageClassAnalysis Contains data related to access patterns to be collected and made available to analyze the tradeoffs between different storage classes.
Required: Yes
Type: StorageClassAnalysis
Update requires: No interruption

TagFilters The tags to use when evaluating an analytics filter.
The analytics only includes objects that meet the filter's criteria. If no filter is specified, all of the contents of the bucket are included in the analysis.
Required: No
Type: List of TagFilter
Update requires: No interruption

Explanation in CloudFormation Registry

Specifies the configuration and any analyses for the analytics filter of an Amazon S3 bucket.

Frequently asked questions

What is AWS Amazon S3 Bucket Analytics Configuration?

AWS Amazon S3 Bucket Analytics Configuration is a resource for Amazon S3 of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Amazon S3 Bucket Analytics Configuration?

For Terraform, the gilyas/infracost, cpodieu1/Hello-Word and infracost/infracost source code examples are useful. See the Terraform Example section for further details.