# MetricExpressionConfig

Properties for a concrete metric.

- Source: [`aws-cloudwatch/lib/metric-types.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-cloudwatch/lib/metric-types.ts#L352)

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cloudwatch as cloudwatch } from 'aws-cdk-lib';

declare const metric: cloudwatch.Metric;
const metricExpressionConfig: cloudwatch.MetricExpressionConfig = {
  expression: 'expression',
  period: 123,
  usingMetrics: {
    usingMetricsKey: metric,
  },

  // the properties below are optional
  searchAccount: 'searchAccount',
  searchRegion: 'searchRegion',
};
```

Python:

```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_cloudwatch as cloudwatch

# metric: cloudwatch.Metric

metric_expression_config = cloudwatch.MetricExpressionConfig(
    expression="expression",
    period=123,
    using_metrics={
        "using_metrics_key": metric
    },

    # the properties below are optional
    search_account="searchAccount",
    search_region="searchRegion"
)
```

Java:

```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.cloudwatch.*;

Metric metric;

MetricExpressionConfig metricExpressionConfig = MetricExpressionConfig.builder()
        .expression("expression")
        .period(123)
        .usingMetrics(Map.of(
                "usingMetricsKey", metric))

        // the properties below are optional
        .searchAccount("searchAccount")
        .searchRegion("searchRegion")
        .build();
```

C# / .NET:

```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.CloudWatch;

Metric metric;

var metricExpressionConfig = new MetricExpressionConfig {
    Expression = "expression",
    Period = 123,
    UsingMetrics = new Dictionary<string, IMetric> {
        { "usingMetricsKey", metric }
    },

    // the properties below are optional
    SearchAccount = "searchAccount",
    SearchRegion = "searchRegion"
};
```

Golang:

```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"

var metric Metric

metricExpressionConfig := &MetricExpressionConfig{
	Expression: jsii.String("expression"),
	Period: jsii.Number(123),
	UsingMetrics: map[string]IMetric{
		"usingMetricsKey": metric,
	},

	// the properties below are optional
	SearchAccount: jsii.String("searchAccount"),
	SearchRegion: jsii.String("searchRegion"),
}
```

## Properties

- `expression`: string (required) — Math expression for the metric.

- `period`: number (required) — How many seconds to aggregate over.

- `searchAccount`: string — Account to evaluate search expressions within.

  **Default:** Deployment account.

- `searchRegion`: string — Region to evaluate search expressions within.

  **Default:** Deployment region.

- `usingMetrics`: { [key: string]: [IMetric](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudwatch.IMetric.html) } (required) — Metrics used in the math expression.
