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/v2/go/aws/s3"
    "github.com/pulumi/pulumi/sdk/v2/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={
        "dataExport": {
            "destination": {
                "s3BucketDestination": {
                    "bucketArn": 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/v2/go/aws/s3"
    "github.com/pulumi/pulumi/sdk/v2/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={
        "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

def AnalyticsConfiguration(resource_name, opts=None, bucket=None, filter=None, name=None, storage_class_analysis=None, __props__=None);
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.
opts ResourceOptions
A bag of options that control this 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 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 str

The name of the bucket this analytics configuration is associated with.

filter Dict[AnalyticsConfigurationFilter]

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 Dict[AnalyticsConfigurationStorageClassAnalysis]

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.

static get(resource_name, id, opts=None, bucket=None, filter=None, name=None, storage_class_analysis=None, __props__=None);
func GetAnalyticsConfiguration(ctx *Context, name string, id IDInput, state *AnalyticsConfigurationState, opts ...ResourceOption) (*AnalyticsConfiguration, error)
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 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 str

The name of the bucket this analytics configuration is associated with.

filter Dict[AnalyticsConfigurationFilter]

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 Dict[AnalyticsConfigurationStorageClassAnalysis]

Configuration for the analytics data export (documented below).

Supporting Types

AnalyticsConfigurationFilter

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

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 Dict[str, str]

Set of object tags for filtering.

AnalyticsConfigurationStorageClassAnalysis

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

DataExport AnalyticsConfigurationStorageClassAnalysisDataExportArgs

Data export configuration (documented below).

DataExport AnalyticsConfigurationStorageClassAnalysisDataExport

Data export configuration (documented below).

dataExport AnalyticsConfigurationStorageClassAnalysisDataExport

Data export configuration (documented below).

dataExport Dict[AnalyticsConfigurationStorageClassAnalysisDataExport]

Data export configuration (documented below).

AnalyticsConfigurationStorageClassAnalysisDataExport

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

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 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 Dict[AnalyticsConfigurationStorageClassAnalysisDataExportDestination]

Specifies the destination for the exported analytics data (documented below).

outputSchemaVersion str

The schema version of exported analytics data. Allowed values: V_1. Default value: V_1.

AnalyticsConfigurationStorageClassAnalysisDataExportDestination

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

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 AnalyticsConfigurationStorageClassAnalysisDataExportDestinationS3BucketDestination

Analytics data export currently only supports an S3 bucket destination (documented below).

s3BucketDestination Dict[AnalyticsConfigurationStorageClassAnalysisDataExportDestinationS3BucketDestination]

Analytics data export currently only supports an S3 bucket destination (documented below).

AnalyticsConfigurationStorageClassAnalysisDataExportDestinationS3BucketDestination

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

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.

bucketArn str

The ARN of the destination bucket.

bucketAccountId 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.

Package Details

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