BucketMetricArgs

data class BucketMetricArgs(val bucket: Output<String>? = null, val filter: Output<BucketMetricFilterArgs>? = null, val name: Output<String>? = null) : ConvertibleToJava<BucketMetricArgs>

Provides a S3 bucket metrics configuration resource.

Example Usage

Add metrics configuration for entire S3 bucket

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.BucketV2;
import com.pulumi.aws.s3.BucketMetric;
import com.pulumi.aws.s3.BucketMetricArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
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_entire_bucket = new BucketMetric("example-entire-bucket", BucketMetricArgs.builder()
.bucket(example.id())
.build());
}
}

Add metrics configuration with S3 object filter

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.BucketV2;
import com.pulumi.aws.s3.BucketMetric;
import com.pulumi.aws.s3.BucketMetricArgs;
import com.pulumi.aws.s3.inputs.BucketMetricFilterArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
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 BucketMetric("example-filtered", BucketMetricArgs.builder()
.bucket(example.id())
.filter(BucketMetricFilterArgs.builder()
.prefix("documents/")
.tags(Map.ofEntries(
Map.entry("priority", "high"),
Map.entry("class", "blue")
))
.build())
.build());
}
}

Import

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

$ pulumi import aws:s3/bucketMetric:BucketMetric my-bucket-entire-bucket my-bucket:EntireBucket

Constructors

Link copied to clipboard
constructor(bucket: Output<String>? = null, filter: Output<BucketMetricFilterArgs>? = null, name: Output<String>? = null)

Properties

Link copied to clipboard
val bucket: Output<String>? = null

Name of the bucket to put metric configuration.

Link copied to clipboard
val filter: Output<BucketMetricFilterArgs>? = null

Object filtering that accepts a prefix, tags, or a logical AND of prefix and tags (documented below).

Link copied to clipboard
val name: Output<String>? = null

Unique identifier of the metrics configuration for the bucket. Must be less than or equal to 64 characters in length.

Functions

Link copied to clipboard
open override fun toJava(): BucketMetricArgs