Skip to content

Commit

Permalink
Add documentation for BucketMetrics
Browse files Browse the repository at this point in the history
  • Loading branch information
workeitel committed May 8, 2019
1 parent 6cb8190 commit b836ead
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/@aws-cdk/aws-s3/lib/bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -567,9 +567,22 @@ export class BlockPublicAccess {
}
}

/**
* Specifies a metrics configuration for the CloudWatch request metrics from an Amazon S3 bucket.
*/
export interface BucketMetrics {
/**
* The ID used to identify the metrics configuration.
*/
readonly id: string;
/**
* The prefix that an object must have to be included in the metrics results.
*/
readonly prefix?: string;
/**
* Specifies a list of tag filters to use as a metrics configuration filter.
* The metrics configuration includes only objects that meet the filter's criteria.
*/
readonly tagFilters?: {[tag: string]: any};
}

Expand Down Expand Up @@ -758,6 +771,11 @@ export class Bucket extends BucketBase {
this.lifecycleRules.push(rule);
}

/**
* Adds a metrics configuration for the CloudWatch request metrics from the bucket.
*
* @param metric The metric configuration to add
*/
public addMetric(metric: BucketMetrics) {
this.metrics.push(metric);
}
Expand Down

0 comments on commit b836ead

Please sign in to comment.