@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
159 lines (158 loc) • 6.3 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* Provides a S3 bucket [metrics configuration](http://docs.aws.amazon.com/AmazonS3/latest/dev/metrics-configurations.html) resource.
*
* > This resource cannot be used with S3 directory buckets.
*
* ## Example Usage
*
* ### Add metrics configuration for entire S3 bucket
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.s3.Bucket("example", {bucket: "example"});
* const example_entire_bucket = new aws.s3.BucketMetric("example-entire-bucket", {
* bucket: example.id,
* name: "EntireBucket",
* });
* ```
*
* ### Add metrics configuration with S3 object filter
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.s3.Bucket("example", {bucket: "example"});
* const example_filtered = new aws.s3.BucketMetric("example-filtered", {
* bucket: example.id,
* name: "ImportantBlueDocuments",
* filter: {
* prefix: "documents/",
* tags: {
* priority: "high",
* "class": "blue",
* },
* },
* });
* ```
*
* ### Add metrics configuration with S3 object filter for S3 Access Point
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.s3.Bucket("example", {bucket: "example"});
* const example_access_point = new aws.s3.AccessPoint("example-access-point", {
* bucket: example.id,
* name: "example-access-point",
* });
* const example_filtered = new aws.s3.BucketMetric("example-filtered", {
* bucket: example.id,
* name: "ImportantBlueDocuments",
* filter: {
* accessPoint: example_access_point.arn,
* tags: {
* priority: "high",
* "class": "blue",
* },
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import S3 bucket metric configurations using `bucket:metric`. For example:
*
* ```sh
* $ pulumi import aws:s3/bucketMetric:BucketMetric my-bucket-entire-bucket my-bucket:EntireBucket
* ```
*/
export declare class BucketMetric extends pulumi.CustomResource {
/**
* Get an existing BucketMetric resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state Any extra arguments used during the lookup.
* @param opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, state?: BucketMetricState, opts?: pulumi.CustomResourceOptions): BucketMetric;
/**
* Returns true if the given object is an instance of BucketMetric. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is BucketMetric;
/**
* Name of the bucket to put metric configuration.
*/
readonly bucket: pulumi.Output<string>;
/**
* [Object filtering](http://docs.aws.amazon.com/AmazonS3/latest/dev/metrics-configurations.html#metrics-configurations-filter) that accepts a prefix, tags, or a logical AND of prefix and tags (documented below).
*/
readonly filter: pulumi.Output<outputs.s3.BucketMetricFilter | undefined>;
/**
* Unique identifier of the metrics configuration for the bucket. Must be less than or equal to 64 characters in length.
*/
readonly name: pulumi.Output<string>;
/**
* Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
*/
readonly region: pulumi.Output<string>;
/**
* Create a BucketMetric resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: BucketMetricArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering BucketMetric resources.
*/
export interface BucketMetricState {
/**
* Name of the bucket to put metric configuration.
*/
bucket?: pulumi.Input<string>;
/**
* [Object filtering](http://docs.aws.amazon.com/AmazonS3/latest/dev/metrics-configurations.html#metrics-configurations-filter) that accepts a prefix, tags, or a logical AND of prefix and tags (documented below).
*/
filter?: pulumi.Input<inputs.s3.BucketMetricFilter>;
/**
* Unique identifier of the metrics configuration for the bucket. Must be less than or equal to 64 characters in length.
*/
name?: pulumi.Input<string>;
/**
* Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
*/
region?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a BucketMetric resource.
*/
export interface BucketMetricArgs {
/**
* Name of the bucket to put metric configuration.
*/
bucket: pulumi.Input<string>;
/**
* [Object filtering](http://docs.aws.amazon.com/AmazonS3/latest/dev/metrics-configurations.html#metrics-configurations-filter) that accepts a prefix, tags, or a logical AND of prefix and tags (documented below).
*/
filter?: pulumi.Input<inputs.s3.BucketMetricFilter>;
/**
* Unique identifier of the metrics configuration for the bucket. Must be less than or equal to 64 characters in length.
*/
name?: pulumi.Input<string>;
/**
* Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
*/
region?: pulumi.Input<string>;
}