AnalyticsConfiguration

Provides a S3 bucket analytics configuration resource.

Example Usage

Add analytics configuration for entire S3 bucket and export results to a second S3 bucket

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Aws.S3.Bucket("example", new Aws.S3.BucketArgs
        {
        });
        var analytics = new Aws.S3.Bucket("analytics", new Aws.S3.BucketArgs
        {
        });
        var example_entire_bucket = new Aws.S3.AnalyticsConfiguration("example-entire-bucket", new Aws.S3.AnalyticsConfigurationArgs
        {
            Bucket = example.BucketName,
            StorageClassAnalysis = new Aws.S3.Inputs.AnalyticsConfigurationStorageClassAnalysisArgs
            {
                DataExport = new Aws.S3.Inputs.AnalyticsConfigurationStorageClassAnalysisDataExportArgs
                {
                    Destination = new Aws.S3.Inputs.AnalyticsConfigurationStorageClassAnalysisDataExportDestinationArgs
                    {
                        S3BucketDestination = new Aws.S3.Inputs.AnalyticsConfigurationStorageClassAnalysisDataExportDestinationS3BucketDestinationArgs
                        {
                            BucketArn = analytics.Arn,
                        },
                    },
                },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/s3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := s3.NewBucket(ctx, "example", nil)
		if err != nil {
			return err
		}
		analytics, err := s3.NewBucket(ctx, "analytics", nil)
		if err != nil {
			return err
		}
		_, err = s3.NewAnalyticsConfiguration(ctx, "example_entire_bucket", &s3.AnalyticsConfigurationArgs{
			Bucket: example.Bucket,
			StorageClassAnalysis: &s3.AnalyticsConfigurationStorageClassAnalysisArgs{
				DataExport: &s3.AnalyticsConfigurationStorageClassAnalysisDataExportArgs{
					Destination: &s3.AnalyticsConfigurationStorageClassAnalysisDataExportDestinationArgs{
						S3BucketDestination: &s3.AnalyticsConfigurationStorageClassAnalysisDataExportDestinationS3BucketDestinationArgs{
							BucketArn: analytics.Arn,
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

example = aws.s3.Bucket("example")
analytics = aws.s3.Bucket("analytics")
example_entire_bucket = aws.s3.AnalyticsConfiguration("example-entire-bucket",
    bucket=example.bucket,
    storage_class_analysis=aws.s3.AnalyticsConfigurationStorageClassAnalysisArgs(
        data_export=aws.s3.AnalyticsConfigurationStorageClassAnalysisDataExportArgs(
            destination=aws.s3.AnalyticsConfigurationStorageClassAnalysisDataExportDestinationArgs(
                s3_bucket_destination=aws.s3.AnalyticsConfigurationStorageClassAnalysisDataExportDestinationS3BucketDestinationArgs(
                    bucket_arn=analytics.arn,
                ),
            ),
        ),
    ))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.s3.Bucket("example", {});
const analytics = new aws.s3.Bucket("analytics", {});
const example_entire_bucket = new aws.s3.AnalyticsConfiguration("example-entire-bucket", {
    bucket: example.bucket,
    storageClassAnalysis: {
        dataExport: {
            destination: {
                s3BucketDestination: {
                    bucketArn: analytics.arn,
                },
            },
        },
    },
});

Add analytics configuration with S3 bucket object filter

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var example = new Aws.S3.Bucket("example", new Aws.S3.BucketArgs
        {
        });
        var example_filtered = new Aws.S3.AnalyticsConfiguration("example-filtered", new Aws.S3.AnalyticsConfigurationArgs
        {
            Bucket = example.BucketName,
            Filter = new Aws.S3.Inputs.AnalyticsConfigurationFilterArgs
            {
                Prefix = "documents/",
                Tags = 
                {
                    { "priority", "high" },
                    { "class", "blue" },
                },
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/s3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := s3.NewBucket(ctx, "example", nil)
		if err != nil {
			return err
		}
		_, err = s3.NewAnalyticsConfiguration(ctx, "example_filtered", &s3.AnalyticsConfigurationArgs{
			Bucket: example.Bucket,
			Filter: &s3.AnalyticsConfigurationFilterArgs{
				Prefix: pulumi.String("documents/"),
				Tags: pulumi.StringMap{
					"priority": pulumi.String("high"),
					"class":    pulumi.String("blue"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_aws as aws

example = aws.s3.Bucket("example")
example_filtered = aws.s3.AnalyticsConfiguration("example-filtered",
    bucket=example.bucket,
    filter=aws.s3.AnalyticsConfigurationFilterArgs(
        prefix="documents/",
        tags={
            "priority": "high",
            "class": "blue",
        },
    ))
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.s3.Bucket("example", {});
const example_filtered = new aws.s3.AnalyticsConfiguration("example-filtered", {
    bucket: example.bucket,
    filter: {
        prefix: "documents/",
        tags: {
            priority: "high",
            "class": "blue",
        },
    },
});

Create a AnalyticsConfiguration Resource

new AnalyticsConfiguration(name: string, args: AnalyticsConfigurationArgs, opts?: CustomResourceOptions);
@overload
def AnalyticsConfiguration(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           bucket: Optional[str] = None,
                           filter: Optional[AnalyticsConfigurationFilterArgs] = None,
                           name: Optional[str] = None,
                           storage_class_analysis: Optional[AnalyticsConfigurationStorageClassAnalysisArgs] = None)
@overload
def AnalyticsConfiguration(resource_name: str,
                           args: AnalyticsConfigurationArgs,
                           opts: Optional[ResourceOptions] = None)
func NewAnalyticsConfiguration(ctx *Context, name string, args AnalyticsConfigurationArgs, opts ...ResourceOption) (*AnalyticsConfiguration, error)
public AnalyticsConfiguration(string name, AnalyticsConfigurationArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args AnalyticsConfigurationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args AnalyticsConfigurationArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args AnalyticsConfigurationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args AnalyticsConfigurationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

AnalyticsConfiguration Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The AnalyticsConfiguration resource accepts the following input properties:

Bucket string
The name of the bucket this analytics configuration is associated with.
Filter AnalyticsConfigurationFilterArgs
Object filtering that accepts a prefix, tags, or a logical AND of prefix and tags (documented below).
Name string
Unique identifier of the analytics configuration for the bucket.
StorageClassAnalysis AnalyticsConfigurationStorageClassAnalysisArgs
Configuration for the analytics data export (documented below).
Bucket string
The name of the bucket this analytics configuration is associated with.
Filter AnalyticsConfigurationFilter
Object filtering that accepts a prefix, tags, or a logical AND of prefix and tags (documented below).
Name string
Unique identifier of the analytics configuration for the bucket.
StorageClassAnalysis AnalyticsConfigurationStorageClassAnalysis
Configuration for the analytics data export (documented below).
bucket string
The name of the bucket this analytics configuration is associated with.
filter AnalyticsConfigurationFilterArgs
Object filtering that accepts a prefix, tags, or a logical AND of prefix and tags (documented below).
name string
Unique identifier of the analytics configuration for the bucket.
storageClassAnalysis AnalyticsConfigurationStorageClassAnalysisArgs
Configuration for the analytics data export (documented below).
bucket str
The name of the bucket this analytics configuration is associated with.
filter AnalyticsConfigurationFilterArgs
Object filtering that accepts a prefix, tags, or a logical AND of prefix and tags (documented below).
name str
Unique identifier of the analytics configuration for the bucket.
storage_class_analysis AnalyticsConfigurationStorageClassAnalysisArgs
Configuration for the analytics data export (documented below).

Outputs

All input properties are implicitly available as output properties. Additionally, the AnalyticsConfiguration resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing AnalyticsConfiguration Resource

Get an existing AnalyticsConfiguration resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: AnalyticsConfigurationState, opts?: CustomResourceOptions): AnalyticsConfiguration
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        bucket: Optional[str] = None,
        filter: Optional[AnalyticsConfigurationFilterArgs] = None,
        name: Optional[str] = None,
        storage_class_analysis: Optional[AnalyticsConfigurationStorageClassAnalysisArgs] = None) -> AnalyticsConfiguration
func GetAnalyticsConfiguration(ctx *Context, name string, id IDInput, state *AnalyticsConfigurationState, opts ...ResourceOption) (*AnalyticsConfiguration, error)
public static AnalyticsConfiguration Get(string name, Input<string> id, AnalyticsConfigurationState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Bucket string
The name of the bucket this analytics configuration is associated with.
Filter AnalyticsConfigurationFilterArgs
Object filtering that accepts a prefix, tags, or a logical AND of prefix and tags (documented below).
Name string
Unique identifier of the analytics configuration for the bucket.
StorageClassAnalysis AnalyticsConfigurationStorageClassAnalysisArgs
Configuration for the analytics data export (documented below).
Bucket string
The name of the bucket this analytics configuration is associated with.
Filter AnalyticsConfigurationFilter
Object filtering that accepts a prefix, tags, or a logical AND of prefix and tags (documented below).
Name string
Unique identifier of the analytics configuration for the bucket.
StorageClassAnalysis AnalyticsConfigurationStorageClassAnalysis
Configuration for the analytics data export (documented below).
bucket string
The name of the bucket this analytics configuration is associated with.
filter AnalyticsConfigurationFilterArgs
Object filtering that accepts a prefix, tags, or a logical AND of prefix and tags (documented below).
name string
Unique identifier of the analytics configuration for the bucket.
storageClassAnalysis AnalyticsConfigurationStorageClassAnalysisArgs
Configuration for the analytics data export (documented below).
bucket str
The name of the bucket this analytics configuration is associated with.
filter AnalyticsConfigurationFilterArgs
Object filtering that accepts a prefix, tags, or a logical AND of prefix and tags (documented below).
name str
Unique identifier of the analytics configuration for the bucket.
storage_class_analysis AnalyticsConfigurationStorageClassAnalysisArgs
Configuration for the analytics data export (documented below).

Supporting Types

AnalyticsConfigurationFilter

Prefix string
Object prefix for filtering.
Tags Dictionary<string, string>
Set of object tags for filtering.
Prefix string
Object prefix for filtering.
Tags map[string]string
Set of object tags for filtering.
prefix string
Object prefix for filtering.
tags {[key: string]: string}
Set of object tags for filtering.
prefix str
Object prefix for filtering.
tags Mapping[str, str]
Set of object tags for filtering.

AnalyticsConfigurationStorageClassAnalysis

DataExport AnalyticsConfigurationStorageClassAnalysisDataExportArgs
Data export configuration (documented below).
DataExport AnalyticsConfigurationStorageClassAnalysisDataExport
Data export configuration (documented below).
dataExport AnalyticsConfigurationStorageClassAnalysisDataExportArgs
Data export configuration (documented below).
data_export AnalyticsConfigurationStorageClassAnalysisDataExportArgs
Data export configuration (documented below).

AnalyticsConfigurationStorageClassAnalysisDataExport

Destination AnalyticsConfigurationStorageClassAnalysisDataExportDestinationArgs
Specifies the destination for the exported analytics data (documented below).
OutputSchemaVersion string
The schema version of exported analytics data. Allowed values: V_1. Default value: V_1.
Destination AnalyticsConfigurationStorageClassAnalysisDataExportDestination
Specifies the destination for the exported analytics data (documented below).
OutputSchemaVersion string
The schema version of exported analytics data. Allowed values: V_1. Default value: V_1.
destination AnalyticsConfigurationStorageClassAnalysisDataExportDestinationArgs
Specifies the destination for the exported analytics data (documented below).
outputSchemaVersion string
The schema version of exported analytics data. Allowed values: V_1. Default value: V_1.
destination AnalyticsConfigurationStorageClassAnalysisDataExportDestinationArgs
Specifies the destination for the exported analytics data (documented below).
output_schema_version str
The schema version of exported analytics data. Allowed values: V_1. Default value: V_1.

AnalyticsConfigurationStorageClassAnalysisDataExportDestination

S3BucketDestination AnalyticsConfigurationStorageClassAnalysisDataExportDestinationS3BucketDestinationArgs
Analytics data export currently only supports an S3 bucket destination (documented below).
S3BucketDestination AnalyticsConfigurationStorageClassAnalysisDataExportDestinationS3BucketDestination
Analytics data export currently only supports an S3 bucket destination (documented below).
s3BucketDestination AnalyticsConfigurationStorageClassAnalysisDataExportDestinationS3BucketDestinationArgs
Analytics data export currently only supports an S3 bucket destination (documented below).
s3_bucket_destination AnalyticsConfigurationStorageClassAnalysisDataExportDestinationS3BucketDestinationArgs
Analytics data export currently only supports an S3 bucket destination (documented below).

AnalyticsConfigurationStorageClassAnalysisDataExportDestinationS3BucketDestination

BucketArn string
The ARN of the destination bucket.
BucketAccountId string
The account ID that owns the destination bucket.
Format string
The output format of exported analytics data. Allowed values: CSV. Default value: CSV.
Prefix string
Object prefix for filtering.
BucketArn string
The ARN of the destination bucket.
BucketAccountId string
The account ID that owns the destination bucket.
Format string
The output format of exported analytics data. Allowed values: CSV. Default value: CSV.
Prefix string
Object prefix for filtering.
bucketArn string
The ARN of the destination bucket.
bucketAccountId string
The account ID that owns the destination bucket.
format string
The output format of exported analytics data. Allowed values: CSV. Default value: CSV.
prefix string
Object prefix for filtering.
bucket_arn str
The ARN of the destination bucket.
bucket_account_id str
The account ID that owns the destination bucket.
format str
The output format of exported analytics data. Allowed values: CSV. Default value: CSV.
prefix str
Object prefix for filtering.

Import

S3 bucket analytics configurations can be imported using bucket:analytics, e.g.

 $ pulumi import aws:s3/analyticsConfiguration:AnalyticsConfiguration my-bucket-entire-bucket my-bucket:EntireBucket

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.