diff --git a/design/aws-guidelines.md b/design/aws-guidelines.md index c634976f4ad0e..7566d86f8d6bd 100644 --- a/design/aws-guidelines.md +++ b/design/aws-guidelines.md @@ -340,9 +340,9 @@ export interface IFoo extends cdk.IConstruct, ISomething { addToPipeline(stage: pipelineapi.IStage, name: string, props?: FooActionProps): FooAction; // metrics - metric(metricName: string, props?: cloudwatch.MetricCustomization): cloudwatch.Metric; - metricFoo(props?: cloudwatch.MetricCustomization): cloudwatch.Metric; - metricBar(props?: cloudwatch.MetricCustomization): cloudwatch.Metric; + metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric; + metricFoo(props?: cloudwatch.MetricOptions): cloudwatch.Metric; + metricBar(props?: cloudwatch.MetricOptions): cloudwatch.Metric; // export export(): FooImportProps; diff --git a/packages/@aws-cdk/aws-cloudwatch/lib/metric.ts b/packages/@aws-cdk/aws-cloudwatch/lib/metric.ts index 08e401470e925..c88e299580188 100644 --- a/packages/@aws-cdk/aws-cloudwatch/lib/metric.ts +++ b/packages/@aws-cdk/aws-cloudwatch/lib/metric.ts @@ -129,7 +129,7 @@ export class Metric { * * @param props The set of properties to change. */ - public with(props: MetricCustomization): Metric { + public with(props: MetricOptions): Metric { return new Metric({ dimensions: ifUndefined(props.dimensions, this.dimensions), namespace: this.namespace, @@ -244,7 +244,7 @@ export enum Unit { /** * Properties of a metric that can be changed */ -export interface MetricCustomization { +export interface MetricOptions { /** * Dimensions of the metric * diff --git a/packages/@aws-cdk/aws-codebuild/lib/project.ts b/packages/@aws-cdk/aws-codebuild/lib/project.ts index 7fc3e3a769f4c..e21a3d07637ab 100644 --- a/packages/@aws-cdk/aws-codebuild/lib/project.ts +++ b/packages/@aws-cdk/aws-codebuild/lib/project.ts @@ -78,7 +78,7 @@ export interface IProject extends IResource, iam.IGrantable { * @param metricName The name of the metric * @param props Customization properties */ - metric(metricName: string, props: cloudwatch.MetricCustomization): cloudwatch.Metric; + metric(metricName: string, props: cloudwatch.MetricOptions): cloudwatch.Metric; /** * Measures the number of builds triggered. @@ -89,7 +89,7 @@ export interface IProject extends IResource, iam.IGrantable { * * @default sum over 5 minutes */ - metricBuilds(props?: cloudwatch.MetricCustomization): cloudwatch.Metric; + metricBuilds(props?: cloudwatch.MetricOptions): cloudwatch.Metric; /** * Measures the duration of all builds over time. @@ -100,7 +100,7 @@ export interface IProject extends IResource, iam.IGrantable { * * @default average over 5 minutes */ - metricDuration(props?: cloudwatch.MetricCustomization): cloudwatch.Metric; + metricDuration(props?: cloudwatch.MetricOptions): cloudwatch.Metric; /** * Measures the number of successful builds. @@ -111,7 +111,7 @@ export interface IProject extends IResource, iam.IGrantable { * * @default sum over 5 minutes */ - metricSucceededBuilds(props?: cloudwatch.MetricCustomization): cloudwatch.Metric; + metricSucceededBuilds(props?: cloudwatch.MetricOptions): cloudwatch.Metric; /** * Measures the number of builds that failed because of client error or @@ -123,7 +123,7 @@ export interface IProject extends IResource, iam.IGrantable { * * @default sum over 5 minutes */ - metricFailedBuilds(props?: cloudwatch.MetricCustomization): cloudwatch.Metric; + metricFailedBuilds(props?: cloudwatch.MetricOptions): cloudwatch.Metric; /** * Export this Project. Allows referencing this Project in a different CDK Stack. @@ -271,7 +271,7 @@ export abstract class ProjectBase extends Resource implements IProject { * @param metricName The name of the metric * @param props Customization properties */ - public metric(metricName: string, props: cloudwatch.MetricCustomization) { + public metric(metricName: string, props: cloudwatch.MetricOptions) { return new cloudwatch.Metric({ namespace: 'AWS/CodeBuild', metricName, @@ -289,7 +289,7 @@ export abstract class ProjectBase extends Resource implements IProject { * * @default sum over 5 minutes */ - public metricBuilds(props?: cloudwatch.MetricCustomization) { + public metricBuilds(props?: cloudwatch.MetricOptions) { return this.metric('Builds', { statistic: 'sum', ...props, @@ -305,7 +305,7 @@ export abstract class ProjectBase extends Resource implements IProject { * * @default average over 5 minutes */ - public metricDuration(props?: cloudwatch.MetricCustomization) { + public metricDuration(props?: cloudwatch.MetricOptions) { return this.metric('Duration', { statistic: 'avg', ...props @@ -321,7 +321,7 @@ export abstract class ProjectBase extends Resource implements IProject { * * @default sum over 5 minutes */ - public metricSucceededBuilds(props?: cloudwatch.MetricCustomization) { + public metricSucceededBuilds(props?: cloudwatch.MetricOptions) { return this.metric('SucceededBuilds', { statistic: 'sum', ...props, @@ -338,7 +338,7 @@ export abstract class ProjectBase extends Resource implements IProject { * * @default sum over 5 minutes */ - public metricFailedBuilds(props?: cloudwatch.MetricCustomization) { + public metricFailedBuilds(props?: cloudwatch.MetricOptions) { return this.metric('FailedBuilds', { statistic: 'sum', ...props, diff --git a/packages/@aws-cdk/aws-ec2/lib/vpn.ts b/packages/@aws-cdk/aws-ec2/lib/vpn.ts index 22e31897a7ee7..592dc64cab534 100644 --- a/packages/@aws-cdk/aws-ec2/lib/vpn.ts +++ b/packages/@aws-cdk/aws-ec2/lib/vpn.ts @@ -102,7 +102,7 @@ export class VpnConnection extends cdk.Construct implements IVpnConnection { /** * Return the given named metric for all VPN connections in the account/region. */ - public static metricAll(metricName: string, props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public static metricAll(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric { return new cloudwatch.Metric({ namespace: 'AWS/VPN', metricName, @@ -115,7 +115,7 @@ export class VpnConnection extends cdk.Construct implements IVpnConnection { * * @default average over 5 minutes */ - public static metricAllTunnelState(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public static metricAllTunnelState(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.metricAll('TunnelSate', { statistic: 'avg', ...props }); } @@ -124,7 +124,7 @@ export class VpnConnection extends cdk.Construct implements IVpnConnection { * * @default sum over 5 minutes */ - public static metricAllTunnelDataIn(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public static metricAllTunnelDataIn(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.metricAll('TunnelDataIn', { statistic: 'sum', ...props }); } @@ -133,7 +133,7 @@ export class VpnConnection extends cdk.Construct implements IVpnConnection { * * @default sum over 5 minutes */ - public static metricAllTunnelDataOut(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public static metricAllTunnelDataOut(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.metricAll('TunnelDataOut', { statistic: 'sum', ...props }); } diff --git a/packages/@aws-cdk/aws-ecs/lib/base/base-service.ts b/packages/@aws-cdk/aws-ecs/lib/base/base-service.ts index c9d602b28a9da..32a6b80c8145a 100644 --- a/packages/@aws-cdk/aws-ecs/lib/base/base-service.ts +++ b/packages/@aws-cdk/aws-ecs/lib/base/base-service.ts @@ -209,7 +209,7 @@ export abstract class BaseService extends cdk.Construct /** * Return the given named metric for this Service */ - public metric(metricName: string, props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric { return new cloudwatch.Metric({ namespace: 'AWS/ECS', metricName, diff --git a/packages/@aws-cdk/aws-ecs/lib/cluster.ts b/packages/@aws-cdk/aws-ecs/lib/cluster.ts index 3e73da2f56de2..4266dde63e6ca 100644 --- a/packages/@aws-cdk/aws-ecs/lib/cluster.ts +++ b/packages/@aws-cdk/aws-ecs/lib/cluster.ts @@ -199,7 +199,7 @@ export class Cluster extends Resource implements ICluster { * * @default average over 5 minutes */ - public metricCpuReservation(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricCpuReservation(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.metric('CPUReservation', props); } @@ -208,14 +208,14 @@ export class Cluster extends Resource implements ICluster { * * @default average over 5 minutes */ - public metricMemoryReservation(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricMemoryReservation(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.metric('MemoryReservation', props ); } /** * Return the given named metric for this Cluster */ - public metric(metricName: string, props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric { return new cloudwatch.Metric({ namespace: 'AWS/ECS', metricName, diff --git a/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts b/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts index cbe39a53a5e44..864c84bcf5781 100644 --- a/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts +++ b/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts @@ -203,7 +203,7 @@ export class Ec2Service extends BaseService implements elb.ILoadBalancerTarget { /** * Return the given named metric for this Service */ - public metric(metricName: string, props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric { return new cloudwatch.Metric({ namespace: 'AWS/ECS', metricName, @@ -217,7 +217,7 @@ export class Ec2Service extends BaseService implements elb.ILoadBalancerTarget { * * @default average over 5 minutes */ - public metricMemoryUtilization(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricMemoryUtilization(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.metric('MemoryUtilization', props ); } @@ -226,7 +226,7 @@ export class Ec2Service extends BaseService implements elb.ILoadBalancerTarget { * * @default average over 5 minutes */ - public metricCpuUtilization(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricCpuUtilization(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.metric('CPUUtilization', props); } diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-load-balancer.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-load-balancer.ts index 62e22c728243d..f4be21d3b1b84 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-load-balancer.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-load-balancer.ts @@ -120,7 +120,7 @@ export class ApplicationLoadBalancer extends BaseLoadBalancer implements IApplic * * @default Average over 5 minutes */ - public metric(metricName: string, props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric { return new cloudwatch.Metric({ namespace: 'AWS/ApplicationELB', metricName, @@ -135,7 +135,7 @@ export class ApplicationLoadBalancer extends BaseLoadBalancer implements IApplic * * @default Sum over 5 minutes */ - public metricActiveConnectionCount(props?: cloudwatch.MetricCustomization) { + public metricActiveConnectionCount(props?: cloudwatch.MetricOptions) { return this.metric('ActiveConnectionCount', { statistic: 'sum', ...props @@ -149,7 +149,7 @@ export class ApplicationLoadBalancer extends BaseLoadBalancer implements IApplic * * @default Sum over 5 minutes */ - public metricClientTlsNegotiationErrorCount(props?: cloudwatch.MetricCustomization) { + public metricClientTlsNegotiationErrorCount(props?: cloudwatch.MetricOptions) { return this.metric('ClientTLSNegotiationErrorCount', { statistic: 'sum', ...props @@ -161,7 +161,7 @@ export class ApplicationLoadBalancer extends BaseLoadBalancer implements IApplic * * @default Sum over 5 minutes */ - public metricConsumedLCUs(props?: cloudwatch.MetricCustomization) { + public metricConsumedLCUs(props?: cloudwatch.MetricOptions) { return this.metric('ConsumedLCUs', { statistic: 'sum', ...props @@ -173,7 +173,7 @@ export class ApplicationLoadBalancer extends BaseLoadBalancer implements IApplic * * @default Sum over 5 minutes */ - public metricHttpFixedResponseCount(props?: cloudwatch.MetricCustomization) { + public metricHttpFixedResponseCount(props?: cloudwatch.MetricOptions) { return this.metric('HTTP_Fixed_Response_Count', { statistic: 'Sum', ...props @@ -185,7 +185,7 @@ export class ApplicationLoadBalancer extends BaseLoadBalancer implements IApplic * * @default Sum over 5 minutes */ - public metricHttpRedirectCount(props?: cloudwatch.MetricCustomization) { + public metricHttpRedirectCount(props?: cloudwatch.MetricOptions) { return this.metric('HTTP_Redirect_Count', { statistic: 'Sum', ...props @@ -198,7 +198,7 @@ export class ApplicationLoadBalancer extends BaseLoadBalancer implements IApplic * * @default Sum over 5 minutes */ - public metricHttpRedirectUrlLimitExceededCount(props?: cloudwatch.MetricCustomization) { + public metricHttpRedirectUrlLimitExceededCount(props?: cloudwatch.MetricOptions) { return this.metric('HTTP_Redirect_Url_Limit_Exceeded_Count', { statistic: 'Sum', ...props @@ -212,7 +212,7 @@ export class ApplicationLoadBalancer extends BaseLoadBalancer implements IApplic * * @default Sum over 5 minutes */ - public metricHttpCodeElb(code: HttpCodeElb, props?: cloudwatch.MetricCustomization) { + public metricHttpCodeElb(code: HttpCodeElb, props?: cloudwatch.MetricOptions) { return this.metric(code, { statistic: 'Sum', ...props @@ -227,7 +227,7 @@ export class ApplicationLoadBalancer extends BaseLoadBalancer implements IApplic * * @default Sum over 5 minutes */ - public metricHttpCodeTarget(code: HttpCodeTarget, props?: cloudwatch.MetricCustomization) { + public metricHttpCodeTarget(code: HttpCodeTarget, props?: cloudwatch.MetricOptions) { return this.metric(code, { statistic: 'Sum', ...props @@ -239,7 +239,7 @@ export class ApplicationLoadBalancer extends BaseLoadBalancer implements IApplic * * @default Sum over 5 minutes */ - public metricIPv6ProcessedBytes(props?: cloudwatch.MetricCustomization) { + public metricIPv6ProcessedBytes(props?: cloudwatch.MetricOptions) { return this.metric('IPv6ProcessedBytes', { statistic: 'Sum', ...props @@ -251,7 +251,7 @@ export class ApplicationLoadBalancer extends BaseLoadBalancer implements IApplic * * @default Sum over 5 minutes */ - public metricIPv6RequestCount(props?: cloudwatch.MetricCustomization) { + public metricIPv6RequestCount(props?: cloudwatch.MetricOptions) { return this.metric('IPv6RequestCount', { statistic: 'Sum', ...props @@ -264,7 +264,7 @@ export class ApplicationLoadBalancer extends BaseLoadBalancer implements IApplic * * @default Sum over 5 minutes */ - public metricNewConnectionCount(props?: cloudwatch.MetricCustomization) { + public metricNewConnectionCount(props?: cloudwatch.MetricOptions) { return this.metric('NewConnectionCount', { statistic: 'Sum', ...props @@ -276,7 +276,7 @@ export class ApplicationLoadBalancer extends BaseLoadBalancer implements IApplic * * @default Sum over 5 minutes */ - public metricProcessedBytes(props?: cloudwatch.MetricCustomization) { + public metricProcessedBytes(props?: cloudwatch.MetricOptions) { return this.metric('ProcessedBytes', { statistic: 'Sum', ...props @@ -289,7 +289,7 @@ export class ApplicationLoadBalancer extends BaseLoadBalancer implements IApplic * * @default Sum over 5 minutes */ - public metricRejectedConnectionCount(props?: cloudwatch.MetricCustomization) { + public metricRejectedConnectionCount(props?: cloudwatch.MetricOptions) { return this.metric('RejectedConnectionCount', { statistic: 'Sum', ...props @@ -303,7 +303,7 @@ export class ApplicationLoadBalancer extends BaseLoadBalancer implements IApplic * * @default Sum over 5 minutes */ - public metricRequestCount(props?: cloudwatch.MetricCustomization) { + public metricRequestCount(props?: cloudwatch.MetricOptions) { return this.metric('RequestCount', { statistic: 'Sum', ...props @@ -315,7 +315,7 @@ export class ApplicationLoadBalancer extends BaseLoadBalancer implements IApplic * * @default Sum over 5 minutes */ - public metricRuleEvaluations(props?: cloudwatch.MetricCustomization) { + public metricRuleEvaluations(props?: cloudwatch.MetricOptions) { return this.metric('RuleEvaluations', { statistic: 'Sum', ...props @@ -327,7 +327,7 @@ export class ApplicationLoadBalancer extends BaseLoadBalancer implements IApplic * * @default Sum over 5 minutes */ - public metricTargetConnectionErrorCount(props?: cloudwatch.MetricCustomization) { + public metricTargetConnectionErrorCount(props?: cloudwatch.MetricOptions) { return this.metric('TargetConnectionErrorCount', { statistic: 'Sum', ...props @@ -339,7 +339,7 @@ export class ApplicationLoadBalancer extends BaseLoadBalancer implements IApplic * * @default Average over 5 minutes */ - public metricTargetResponseTime(props?: cloudwatch.MetricCustomization) { + public metricTargetResponseTime(props?: cloudwatch.MetricOptions) { return this.metric('TargetResponseTime', { statistic: 'Average', ...props @@ -353,7 +353,7 @@ export class ApplicationLoadBalancer extends BaseLoadBalancer implements IApplic * * @default Sum over 5 minutes */ - public metricTargetTLSNegotiationErrorCount(props?: cloudwatch.MetricCustomization) { + public metricTargetTLSNegotiationErrorCount(props?: cloudwatch.MetricOptions) { return this.metric('TargetTLSNegotiationErrorCount', { statistic: 'Sum', ...props @@ -369,7 +369,7 @@ export class ApplicationLoadBalancer extends BaseLoadBalancer implements IApplic * * @default Sum over 5 minutes */ - public metricElbAuthError(props?: cloudwatch.MetricCustomization) { + public metricElbAuthError(props?: cloudwatch.MetricOptions) { return this.metric('ELBAuthError', { statistic: 'Sum', ...props @@ -383,7 +383,7 @@ export class ApplicationLoadBalancer extends BaseLoadBalancer implements IApplic * * @default Sum over 5 minutes */ - public metricElbAuthFailure(props?: cloudwatch.MetricCustomization) { + public metricElbAuthFailure(props?: cloudwatch.MetricOptions) { return this.metric('ELBAuthFailure', { statistic: 'Sum', ...props @@ -397,7 +397,7 @@ export class ApplicationLoadBalancer extends BaseLoadBalancer implements IApplic * * @default Average over 5 minutes */ - public metricElbAuthLatency(props?: cloudwatch.MetricCustomization) { + public metricElbAuthLatency(props?: cloudwatch.MetricOptions) { return this.metric('ELBAuthLatency', { statistic: 'Average', ...props @@ -412,7 +412,7 @@ export class ApplicationLoadBalancer extends BaseLoadBalancer implements IApplic * * @default Sum over 5 minutes */ - public metricElbAuthSuccess(props?: cloudwatch.MetricCustomization) { + public metricElbAuthSuccess(props?: cloudwatch.MetricOptions) { return this.metric('ELBAuthSuccess', { statistic: 'Sum', ...props diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-target-group.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-target-group.ts index 4a3b99ba577ab..24920a7c89186 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-target-group.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-target-group.ts @@ -170,7 +170,7 @@ export class ApplicationTargetGroup extends TargetGroupBase implements IApplicat * * @default Average over 5 minutes */ - public metric(metricName: string, props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric { return new cloudwatch.Metric({ namespace: 'AWS/ApplicationELB', metricName, @@ -187,7 +187,7 @@ export class ApplicationTargetGroup extends TargetGroupBase implements IApplicat * * @default Sum over 5 minutes */ - public metricIPv6RequestCount(props?: cloudwatch.MetricCustomization) { + public metricIPv6RequestCount(props?: cloudwatch.MetricOptions) { return this.metric('IPv6RequestCount', { statistic: 'Sum', ...props @@ -201,7 +201,7 @@ export class ApplicationTargetGroup extends TargetGroupBase implements IApplicat * * @default Sum over 5 minutes */ - public metricRequestCount(props?: cloudwatch.MetricCustomization) { + public metricRequestCount(props?: cloudwatch.MetricOptions) { return this.metric('RequestCount', { statistic: 'Sum', ...props @@ -213,7 +213,7 @@ export class ApplicationTargetGroup extends TargetGroupBase implements IApplicat * * @default Average over 5 minutes */ - public metricHealthyHostCount(props?: cloudwatch.MetricCustomization) { + public metricHealthyHostCount(props?: cloudwatch.MetricOptions) { return this.metric('HealthyHostCount', { statistic: 'Average', ...props @@ -225,7 +225,7 @@ export class ApplicationTargetGroup extends TargetGroupBase implements IApplicat * * @default Average over 5 minutes */ - public metricUnhealthyHostCount(props?: cloudwatch.MetricCustomization) { + public metricUnhealthyHostCount(props?: cloudwatch.MetricOptions) { return this.metric('UnhealthyHostCount', { statistic: 'Average', ...props @@ -239,7 +239,7 @@ export class ApplicationTargetGroup extends TargetGroupBase implements IApplicat * * @default Sum over 5 minutes */ - public metricHttpCodeTarget(code: HttpCodeTarget, props?: cloudwatch.MetricCustomization) { + public metricHttpCodeTarget(code: HttpCodeTarget, props?: cloudwatch.MetricOptions) { return this.metric(code, { statistic: 'Sum', ...props @@ -253,7 +253,7 @@ export class ApplicationTargetGroup extends TargetGroupBase implements IApplicat * * @default Sum over 5 minutes */ - public metricRequestCountPerTarget(props?: cloudwatch.MetricCustomization) { + public metricRequestCountPerTarget(props?: cloudwatch.MetricOptions) { return this.metric('RequestCountPerTarget', { statistic: 'Sum', ...props @@ -265,7 +265,7 @@ export class ApplicationTargetGroup extends TargetGroupBase implements IApplicat * * @default Sum over 5 minutes */ - public metricTargetConnectionErrorCount(props?: cloudwatch.MetricCustomization) { + public metricTargetConnectionErrorCount(props?: cloudwatch.MetricOptions) { return this.metric('TargetConnectionErrorCount', { statistic: 'Sum', ...props @@ -277,7 +277,7 @@ export class ApplicationTargetGroup extends TargetGroupBase implements IApplicat * * @default Average over 5 minutes */ - public metricTargetResponseTime(props?: cloudwatch.MetricCustomization) { + public metricTargetResponseTime(props?: cloudwatch.MetricOptions) { return this.metric('TargetResponseTime', { statistic: 'Average', ...props @@ -291,7 +291,7 @@ export class ApplicationTargetGroup extends TargetGroupBase implements IApplicat * * @default Sum over 5 minutes */ - public metricTargetTLSNegotiationErrorCount(props?: cloudwatch.MetricCustomization) { + public metricTargetTLSNegotiationErrorCount(props?: cloudwatch.MetricOptions) { return this.metric('TargetTLSNegotiationErrorCount', { statistic: 'Sum', ...props diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-load-balancer.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-load-balancer.ts index dc66da99ff445..ba906d8de2f67 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-load-balancer.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-load-balancer.ts @@ -58,7 +58,7 @@ export class NetworkLoadBalancer extends BaseLoadBalancer implements INetworkLoa * * @default Average over 5 minutes */ - public metric(metricName: string, props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric { return new cloudwatch.Metric({ namespace: 'AWS/NetworkELB', metricName, @@ -76,7 +76,7 @@ export class NetworkLoadBalancer extends BaseLoadBalancer implements INetworkLoa * * @default Average over 5 minutes */ - public metricActiveFlowCount(props?: cloudwatch.MetricCustomization) { + public metricActiveFlowCount(props?: cloudwatch.MetricOptions) { return this.metric('ActiveFlowCount', { statistic: 'Average', ...props @@ -88,7 +88,7 @@ export class NetworkLoadBalancer extends BaseLoadBalancer implements INetworkLoa * * @default Sum over 5 minutes */ - public metricConsumedLCUs(props?: cloudwatch.MetricCustomization) { + public metricConsumedLCUs(props?: cloudwatch.MetricOptions) { return this.metric('ConsumedLCUs', { statistic: 'Sum', ...props @@ -100,7 +100,7 @@ export class NetworkLoadBalancer extends BaseLoadBalancer implements INetworkLoa * * @default Average over 5 minutes */ - public metricHealthyHostCount(props?: cloudwatch.MetricCustomization) { + public metricHealthyHostCount(props?: cloudwatch.MetricOptions) { return this.metric('HealthyHostCount', { statistic: 'Average', ...props @@ -112,7 +112,7 @@ export class NetworkLoadBalancer extends BaseLoadBalancer implements INetworkLoa * * @default Average over 5 minutes */ - public metricUnHealthyHostCount(props?: cloudwatch.MetricCustomization) { + public metricUnHealthyHostCount(props?: cloudwatch.MetricOptions) { return this.metric('UnHealthyHostCount', { statistic: 'Average', ...props @@ -124,7 +124,7 @@ export class NetworkLoadBalancer extends BaseLoadBalancer implements INetworkLoa * * @default Sum over 5 minutes */ - public metricNewFlowCount(props?: cloudwatch.MetricCustomization) { + public metricNewFlowCount(props?: cloudwatch.MetricOptions) { return this.metric('NewFlowCount', { statistic: 'Sum', ...props @@ -136,7 +136,7 @@ export class NetworkLoadBalancer extends BaseLoadBalancer implements INetworkLoa * * @default Sum over 5 minutes */ - public metricProcessedBytes(props?: cloudwatch.MetricCustomization) { + public metricProcessedBytes(props?: cloudwatch.MetricOptions) { return this.metric('ProcessedBytes', { statistic: 'Sum', ...props @@ -150,7 +150,7 @@ export class NetworkLoadBalancer extends BaseLoadBalancer implements INetworkLoa * * @default Sum over 5 minutes */ - public metricTcpClientResetCount(props?: cloudwatch.MetricCustomization) { + public metricTcpClientResetCount(props?: cloudwatch.MetricOptions) { return this.metric('TCP_Client_Reset_Count', { statistic: 'Sum', ...props @@ -162,7 +162,7 @@ export class NetworkLoadBalancer extends BaseLoadBalancer implements INetworkLoa * * @default Sum over 5 minutes */ - public metricTcpElbResetCount(props?: cloudwatch.MetricCustomization) { + public metricTcpElbResetCount(props?: cloudwatch.MetricOptions) { return this.metric('TCP_ELB_Reset_Count', { statistic: 'Sum', ...props @@ -176,7 +176,7 @@ export class NetworkLoadBalancer extends BaseLoadBalancer implements INetworkLoa * * @default Sum over 5 minutes */ - public metricTcpTargetResetCount(props?: cloudwatch.MetricCustomization) { + public metricTcpTargetResetCount(props?: cloudwatch.MetricOptions) { return this.metric('TCP_Target_Reset_Count', { statistic: 'Sum', ...props diff --git a/packages/@aws-cdk/aws-lambda/lib/alias.ts b/packages/@aws-cdk/aws-lambda/lib/alias.ts index 2bec04e7dd79c..e21b051675c1c 100644 --- a/packages/@aws-cdk/aws-lambda/lib/alias.ts +++ b/packages/@aws-cdk/aws-lambda/lib/alias.ts @@ -110,7 +110,7 @@ export class Alias extends FunctionBase { return this.underlyingLambda.grantPrincipal; } - public metric(metricName: string, props: cloudwatch.MetricCustomization = {}): cloudwatch.Metric { + public metric(metricName: string, props: cloudwatch.MetricOptions = {}): cloudwatch.Metric { // Metrics on Aliases need the "bare" function name, and the alias' ARN, this differes from the base behavior. return super.metric(metricName, { dimensions: { diff --git a/packages/@aws-cdk/aws-lambda/lib/function-base.ts b/packages/@aws-cdk/aws-lambda/lib/function-base.ts index 07fcc0ea7f64c..8a1f9e004c9fe 100644 --- a/packages/@aws-cdk/aws-lambda/lib/function-base.ts +++ b/packages/@aws-cdk/aws-lambda/lib/function-base.ts @@ -56,28 +56,28 @@ export interface IFunction extends IResource, logs.ILogSubscriptionDestination, /** * Return the given named metric for this Lambda */ - metric(metricName: string, props?: cloudwatch.MetricCustomization): cloudwatch.Metric; + metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric; /** * Metric for the Duration of this Lambda * * @default average over 5 minutes */ - metricDuration(props?: cloudwatch.MetricCustomization): cloudwatch.Metric; + metricDuration(props?: cloudwatch.MetricOptions): cloudwatch.Metric; /** * Metric for the number of invocations of this Lambda * * @default sum over 5 minutes */ - metricInvocations(props?: cloudwatch.MetricCustomization): cloudwatch.Metric; + metricInvocations(props?: cloudwatch.MetricOptions): cloudwatch.Metric; /** * Metric for the number of throttled invocations of this Lambda * * @default sum over 5 minutes */ - metricThrottles(props?: cloudwatch.MetricCustomization): cloudwatch.Metric; + metricThrottles(props?: cloudwatch.MetricOptions): cloudwatch.Metric; /** * Export this Function (without the role) diff --git a/packages/@aws-cdk/aws-lambda/lib/function.ts b/packages/@aws-cdk/aws-lambda/lib/function.ts index 31936f565bada..24cf1e3ceca6d 100644 --- a/packages/@aws-cdk/aws-lambda/lib/function.ts +++ b/packages/@aws-cdk/aws-lambda/lib/function.ts @@ -241,7 +241,7 @@ export class Function extends FunctionBase { /** * Return the given named metric for this Lambda */ - public static metricAll(metricName: string, props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public static metricAll(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric { return new cloudwatch.Metric({ namespace: 'AWS/Lambda', metricName, @@ -253,7 +253,7 @@ export class Function extends FunctionBase { * * @default sum over 5 minutes */ - public static metricAllErrors(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public static metricAllErrors(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.metricAll('Errors', { statistic: 'sum', ...props }); } @@ -262,7 +262,7 @@ export class Function extends FunctionBase { * * @default average over 5 minutes */ - public static metricAllDuration(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public static metricAllDuration(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.metricAll('Duration', props); } @@ -271,7 +271,7 @@ export class Function extends FunctionBase { * * @default sum over 5 minutes */ - public static metricAllInvocations(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public static metricAllInvocations(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.metricAll('Invocations', { statistic: 'sum', ...props }); } @@ -280,7 +280,7 @@ export class Function extends FunctionBase { * * @default sum over 5 minutes */ - public static metricAllThrottles(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public static metricAllThrottles(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.metricAll('Throttles', { statistic: 'sum', ...props }); } @@ -289,7 +289,7 @@ export class Function extends FunctionBase { * * @default max over 5 minutes */ - public static metricAllConcurrentExecutions(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public static metricAllConcurrentExecutions(props?: cloudwatch.MetricOptions): cloudwatch.Metric { // Mini-FAQ: why max? This metric is a gauge that is emitted every // minute, so either max or avg or a percentile make sense (but sum // doesn't). Max is more sensitive to spiky load changes which is @@ -304,7 +304,7 @@ export class Function extends FunctionBase { * * @default max over 5 minutes */ - public static metricAllUnreservedConcurrentExecutions(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public static metricAllUnreservedConcurrentExecutions(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.metricAll('UnreservedConcurrentExecutions', { statistic: 'max', ...props }); } diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/activity.ts b/packages/@aws-cdk/aws-stepfunctions/lib/activity.ts index 14b04ee19483b..5dfc83837883c 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/activity.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/activity.ts @@ -45,7 +45,7 @@ export class Activity extends Resource implements IStepFunctionsTaskResource { * * @default sum over 5 minutes */ - public metric(metricName: string, props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric { return new cloudwatch.Metric({ namespace: 'AWS/States', metricName, @@ -60,7 +60,7 @@ export class Activity extends Resource implements IStepFunctionsTaskResource { * * @default average over 5 minutes */ - public metricRunTime(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricRunTime(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.metric('ActivityRunTime', { statistic: 'avg', ...props }); } @@ -69,7 +69,7 @@ export class Activity extends Resource implements IStepFunctionsTaskResource { * * @default average over 5 minutes */ - public metricScheduleTime(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricScheduleTime(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.metric('ActivityScheduleTime', { statistic: 'avg', ...props }); } @@ -78,7 +78,7 @@ export class Activity extends Resource implements IStepFunctionsTaskResource { * * @default average over 5 minutes */ - public metricTime(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricTime(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.metric('ActivityTime', { statistic: 'avg', ...props }); } @@ -87,7 +87,7 @@ export class Activity extends Resource implements IStepFunctionsTaskResource { * * @default sum over 5 minutes */ - public metricScheduled(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricScheduled(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.metric('ActivitiesScheduled', props); } @@ -96,7 +96,7 @@ export class Activity extends Resource implements IStepFunctionsTaskResource { * * @default sum over 5 minutes */ - public metricTimedOut(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricTimedOut(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.metric('ActivitiesTimedOut', props); } @@ -105,7 +105,7 @@ export class Activity extends Resource implements IStepFunctionsTaskResource { * * @default sum over 5 minutes */ - public metricStarted(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricStarted(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.metric('ActivitiesStarted', props); } @@ -114,7 +114,7 @@ export class Activity extends Resource implements IStepFunctionsTaskResource { * * @default sum over 5 minutes */ - public metricSucceeded(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricSucceeded(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.metric('ActivitiesSucceeded', props); } @@ -123,7 +123,7 @@ export class Activity extends Resource implements IStepFunctionsTaskResource { * * @default sum over 5 minutes */ - public metricFailed(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricFailed(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.metric('ActivitiesFailed', props); } @@ -132,7 +132,7 @@ export class Activity extends Resource implements IStepFunctionsTaskResource { * * @default sum over 5 minutes */ - public metricHeartbeatTimedOut(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricHeartbeatTimedOut(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.metric('ActivitiesHeartbeatTimedOut', props); } diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/state-machine.ts b/packages/@aws-cdk/aws-stepfunctions/lib/state-machine.ts index 22e1f700e1964..85ea5d41e1682 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/state-machine.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/state-machine.ts @@ -125,7 +125,7 @@ export class StateMachine extends Resource implements IStateMachine, events.IEve * * @default sum over 5 minutes */ - public metric(metricName: string, props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric { return new cloudwatch.Metric({ namespace: 'AWS/States', metricName, @@ -140,7 +140,7 @@ export class StateMachine extends Resource implements IStateMachine, events.IEve * * @default sum over 5 minutes */ - public metricFailed(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricFailed(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.metric('ExecutionsFailed', props); } @@ -149,7 +149,7 @@ export class StateMachine extends Resource implements IStateMachine, events.IEve * * @default sum over 5 minutes */ - public metricThrottled(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricThrottled(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.metric('ExecutionThrottled', props); } @@ -158,7 +158,7 @@ export class StateMachine extends Resource implements IStateMachine, events.IEve * * @default sum over 5 minutes */ - public metricAborted(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricAborted(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.metric('ExecutionsAborted', props); } @@ -167,7 +167,7 @@ export class StateMachine extends Resource implements IStateMachine, events.IEve * * @default sum over 5 minutes */ - public metricSucceeded(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricSucceeded(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.metric('ExecutionsSucceeded', props); } @@ -176,7 +176,7 @@ export class StateMachine extends Resource implements IStateMachine, events.IEve * * @default sum over 5 minutes */ - public metricTimedOut(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricTimedOut(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.metric('ExecutionsTimedOut', props); } @@ -185,7 +185,7 @@ export class StateMachine extends Resource implements IStateMachine, events.IEve * * @default sum over 5 minutes */ - public metricStarted(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricStarted(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.metric('ExecutionsStarted', props); } diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/state-transition-metrics.ts b/packages/@aws-cdk/aws-stepfunctions/lib/state-transition-metrics.ts index d29817a305c89..8cdc088536fd4 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/state-transition-metrics.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/state-transition-metrics.ts @@ -11,7 +11,7 @@ export class StateTransitionMetric { * * @default average over 5 minutes */ - public static metric(metricName: string, props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public static metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric { return new cloudwatch.Metric({ namespace: 'AWS/States', metricName, @@ -25,7 +25,7 @@ export class StateTransitionMetric { * * @default average over 5 minutes */ - public static metricProvisionedBucketSize(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public static metricProvisionedBucketSize(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return StateTransitionMetric.metric("ProvisionedBucketSize", props); } @@ -34,7 +34,7 @@ export class StateTransitionMetric { * * @default average over 5 minutes */ - public static metricProvisionedRefillRate(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public static metricProvisionedRefillRate(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return StateTransitionMetric.metric("ProvisionedRefillRate", props); } @@ -43,7 +43,7 @@ export class StateTransitionMetric { * * @default average over 5 minutes */ - public static metricConsumedCapacity(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public static metricConsumedCapacity(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return StateTransitionMetric.metric("ConsumedCapacity", props); } @@ -52,7 +52,7 @@ export class StateTransitionMetric { * * @default sum over 5 minutes */ - public static metricThrottledEvents(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public static metricThrottledEvents(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return StateTransitionMetric.metric("ThrottledEvents", { statistic: 'sum', ...props }); } -} \ No newline at end of file +} diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/states/task.ts b/packages/@aws-cdk/aws-stepfunctions/lib/states/task.ts index 3aa11676d6675..7a98884d4881f 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/states/task.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/states/task.ts @@ -158,7 +158,7 @@ export class Task extends State implements INextable { * * @default sum over 5 minutes */ - public metric(metricName: string, props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric { return new cloudwatch.Metric({ namespace: 'AWS/States', metricName, @@ -173,7 +173,7 @@ export class Task extends State implements INextable { * * @default average over 5 minutes */ - public metricRunTime(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricRunTime(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.taskMetric(this.resourceProps.metricPrefixSingular, 'RunTime', { statistic: 'avg', ...props }); } @@ -182,7 +182,7 @@ export class Task extends State implements INextable { * * @default average over 5 minutes */ - public metricScheduleTime(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricScheduleTime(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.taskMetric(this.resourceProps.metricPrefixSingular, 'ScheduleTime', { statistic: 'avg', ...props }); } @@ -191,7 +191,7 @@ export class Task extends State implements INextable { * * @default average over 5 minutes */ - public metricTime(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricTime(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.taskMetric(this.resourceProps.metricPrefixSingular, 'Time', { statistic: 'avg', ...props }); } @@ -200,7 +200,7 @@ export class Task extends State implements INextable { * * @default sum over 5 minutes */ - public metricScheduled(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricScheduled(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.taskMetric(this.resourceProps.metricPrefixPlural, 'Scheduled', props); } @@ -209,7 +209,7 @@ export class Task extends State implements INextable { * * @default sum over 5 minutes */ - public metricTimedOut(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricTimedOut(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.taskMetric(this.resourceProps.metricPrefixPlural, 'TimedOut', props); } @@ -218,7 +218,7 @@ export class Task extends State implements INextable { * * @default sum over 5 minutes */ - public metricStarted(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricStarted(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.taskMetric(this.resourceProps.metricPrefixPlural, 'Started', props); } @@ -227,7 +227,7 @@ export class Task extends State implements INextable { * * @default sum over 5 minutes */ - public metricSucceeded(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricSucceeded(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.taskMetric(this.resourceProps.metricPrefixPlural, 'Succeeded', props); } @@ -236,7 +236,7 @@ export class Task extends State implements INextable { * * @default sum over 5 minutes */ - public metricFailed(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricFailed(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.taskMetric(this.resourceProps.metricPrefixPlural, 'Failed', props); } @@ -245,7 +245,7 @@ export class Task extends State implements INextable { * * @default sum over 5 minutes */ - public metricHeartbeatTimedOut(props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + public metricHeartbeatTimedOut(props?: cloudwatch.MetricOptions): cloudwatch.Metric { return this.taskMetric(this.resourceProps.metricPrefixPlural, 'HeartbeatTimedOut', props); } @@ -256,7 +256,7 @@ export class Task extends State implements INextable { } } - private taskMetric(prefix: string | undefined, suffix: string, props?: cloudwatch.MetricCustomization): cloudwatch.Metric { + private taskMetric(prefix: string | undefined, suffix: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric { if (prefix === undefined) { throw new Error('This Task Resource does not expose metrics'); } @@ -310,4 +310,4 @@ export interface StepFunctionsTaskResourceProps { * @default No metrics */ readonly metricDimensions?: cloudwatch.DimensionHash; -} \ No newline at end of file +} diff --git a/tools/cfn2ts/lib/augmentation-generator.ts b/tools/cfn2ts/lib/augmentation-generator.ts index 94521c94c27de..ce5ba1308153d 100644 --- a/tools/cfn2ts/lib/augmentation-generator.ts +++ b/tools/cfn2ts/lib/augmentation-generator.ts @@ -82,11 +82,11 @@ export class AugmentationGenerator { this.code.line(`/**`); this.code.line(` * Return the given named metric for this ${resource.resourceName}`); this.code.line(` */`); - this.code.line(`metric(metricName: string, props?: cloudwatch.MetricCustomization): cloudwatch.Metric;`); + this.code.line(`metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric;`); } private emitMetricFunction(className: string, metrics: schema.ResourceMetricAugmentations) { - this.code.line(`${className}.prototype.metric = function(metricName: string, props?: cloudwatch.MetricCustomization) {`); + this.code.line(`${className}.prototype.metric = function(metricName: string, props?: cloudwatch.MetricOptions) {`); this.code.line(` return new cloudwatch.Metric({`); this.code.line(` namespace: '${metrics.namespace}',`); this.code.line(` metricName,`); @@ -108,11 +108,11 @@ export class AugmentationGenerator { this.code.line(` *`); this.code.line(` * ${metricStatistic(metric)} over 5 minutes`); this.code.line(` */`); - this.code.line(`metric${metricFunctionName(metric)}(props?: cloudwatch.MetricCustomization): cloudwatch.Metric;`); + this.code.line(`metric${metricFunctionName(metric)}(props?: cloudwatch.MetricOptions): cloudwatch.Metric;`); } private emitSpecificMetricFunction(className: string, metric: schema.ResourceMetric) { - this.code.line(`${className}.prototype.metric${metricFunctionName(metric)} = function(props?: cloudwatch.MetricCustomization) {`); + this.code.line(`${className}.prototype.metric${metricFunctionName(metric)} = function(props?: cloudwatch.MetricOptions) {`); this.code.line(` return this.metric('${metric.name}', { statistic: '${metricStatistic(metric)}', ...props });`); this.code.line('};'); }