Skip to content
v2.278.0

MetricConfigurationProperty Struct ​

The configuration for a specific set of metrics to collect for a service.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ecs as ecs } from 'aws-cdk-lib';
const metricConfigurationProperty: ecs.CfnService.MetricConfigurationProperty = {
  metricNames: ['metricNames'],
  resolutionSeconds: 123,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ecs as ecs

metric_configuration_property = ecs.CfnService.MetricConfigurationProperty(
    metric_names=["metricNames"],
    resolution_seconds=123
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ecs.*;

MetricConfigurationProperty metricConfigurationProperty = MetricConfigurationProperty.builder()
        .metricNames(List.of("metricNames"))
        .resolutionSeconds(123)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ECS;

var metricConfigurationProperty = new MetricConfigurationProperty {
    MetricNames = new [] { "metricNames" },
    ResolutionSeconds = 123
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

metricConfigurationProperty := &MetricConfigurationProperty{
	MetricNames: []*string{
		jsii.String("metricNames"),
	},
	ResolutionSeconds: jsii.Number(123),
}

Properties ​

metricNamesstring[]metric_namestyping.List[str]metricNamesList<String>MetricNamesstring[]MetricNames*[]*string required #
The list of metric names to configure.

The supported metric names are CPUUtilization and MemoryUtilization.

resolutionSecondsnumberresolution_secondsint | floatresolutionSecondsNumberResolutionSecondsdoubleResolutionSeconds*float64 required #
The resolution, in seconds, at which to collect the metrics.

The valid values are 20 and 60.