AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.10.0 published on Monday, Jul 11, 2022 by Pulumi

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.BucketV2("example", new Aws.S3.BucketV2Args
        {
        });
        var analytics = new Aws.S3.BucketV2("analytics", new Aws.S3.BucketV2Args
        {
        });
        var example_entire_bucket = new Aws.S3.AnalyticsConfiguration("example-entire-bucket", new Aws.S3.AnalyticsConfigurationArgs
        {
            Bucket = example.Bucket,
            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/v5/go/aws/s3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := s3.NewBucketV2(ctx, "example", nil)
		if err != nil {
			return err
		}
		analytics, err := s3.NewBucketV2(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
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new BucketV2("example");

        var analytics = new BucketV2("analytics");

        var example_entire_bucket = new AnalyticsConfiguration("example-entire-bucket", AnalyticsConfigurationArgs.builder()        
            .bucket(example.bucket())
            .storageClassAnalysis(AnalyticsConfigurationStorageClassAnalysisArgs.builder()
                .dataExport(AnalyticsConfigurationStorageClassAnalysisDataExportArgs.builder()
                    .destination(AnalyticsConfigurationStorageClassAnalysisDataExportDestinationArgs.builder()
                        .s3BucketDestination(AnalyticsConfigurationStorageClassAnalysisDataExportDestinationS3BucketDestinationArgs.builder()
                            .bucketArn(analytics.arn())
                            .build())
                        .build())
                    .build())
                .build())
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example = aws.s3.BucketV2("example")
analytics = aws.s3.BucketV2("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.BucketV2("example", {});
const analytics = new aws.s3.BucketV2("analytics", {});
const example_entire_bucket = new aws.s3.AnalyticsConfiguration("example-entire-bucket", {
    bucket: example.bucket,
    storageClassAnalysis: {
        dataExport: {
            destination: {
                s3BucketDestination: {
                    bucketArn: analytics.arn,
                },
            },
        },
    },
});
resources:
  example-entire-bucket:
    type: aws:s3:AnalyticsConfiguration
    properties:
      bucket: ${example.bucket}
      storageClassAnalysis:
        dataExport:
          destination:
            s3BucketDestination:
              bucketArn: ${analytics.arn}
  example:
    type: aws:s3:BucketV2
  analytics:
    type: aws:s3:BucketV2

Add analytics configuration with S3 object filter

using Pulumi;
using Aws = Pulumi.Aws;

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

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := s3.NewBucketV2(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
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new BucketV2("example");

        var example_filtered = new AnalyticsConfiguration("example-filtered", AnalyticsConfigurationArgs.builder()        
            .bucket(example.bucket())
            .filter(AnalyticsConfigurationFilterArgs.builder()
                .prefix("documents/")
                .tags(Map.ofEntries(
                    Map.entry("priority", "high"),
                    Map.entry("class", "blue")
                ))
                .build())
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example = aws.s3.BucketV2("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.BucketV2("example", {});
const example_filtered = new aws.s3.AnalyticsConfiguration("example-filtered", {
    bucket: example.bucket,
    filter: {
        prefix: "documents/",
        tags: {
            priority: "high",
            "class": "blue",
        },
    },
});
resources:
  example-filtered:
    type: aws:s3:AnalyticsConfiguration
    properties:
      bucket: ${example.bucket}
      filter:
        prefix: documents/
        tags:
          priority: high
          class: blue
  example:
    type: aws:s3:BucketV2

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)
public AnalyticsConfiguration(String name, AnalyticsConfigurationArgs args)
public AnalyticsConfiguration(String name, AnalyticsConfigurationArgs args, CustomResourceOptions options)
type: aws:s3:AnalyticsConfiguration
properties: # The arguments to resource properties.
options: # 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.
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.
name String
The unique name of the resource.
args AnalyticsConfigurationArgs
The arguments to resource properties.
options 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 Architecture and Concepts 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 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 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 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).

bucket String

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

filter Property Map

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 Property Map

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 string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

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)
public static AnalyticsConfiguration get(String name, Output<String> id, AnalyticsConfigurationState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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.
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 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 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 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).

bucket String

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

filter Property Map

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 Property Map

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

prefix String

Object prefix for filtering.

tags Map<String>

Set of object tags for filtering.

AnalyticsConfigurationStorageClassAnalysis

DataExport AnalyticsConfigurationStorageClassAnalysisDataExport

Data export configuration (documented below).

DataExport AnalyticsConfigurationStorageClassAnalysisDataExport

Data export configuration (documented below).

dataExport AnalyticsConfigurationStorageClassAnalysisDataExport

Data export configuration (documented below).

dataExport AnalyticsConfigurationStorageClassAnalysisDataExport

Data export configuration (documented below).

data_export AnalyticsConfigurationStorageClassAnalysisDataExport

Data export configuration (documented below).

dataExport Property Map

Data export configuration (documented below).

AnalyticsConfigurationStorageClassAnalysisDataExport

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 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 AnalyticsConfigurationStorageClassAnalysisDataExportDestination

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.

destination Property Map

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.

AnalyticsConfigurationStorageClassAnalysisDataExportDestination

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

s3_bucket_destination AnalyticsConfigurationStorageClassAnalysisDataExportDestinationS3BucketDestination

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

s3BucketDestination Property Map

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.

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.

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.

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.