# CloudWatchLogConfigurationProperty

Holds CloudWatch log configuration settings and metadata that specify settings like log files to monitor and where to send them.

- Source: Generated at build time
- Type last changed: v2.276.0 · 10 Nov 2026

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_emr as emr } from 'aws-cdk-lib';
const cloudWatchLogConfigurationProperty: emr.CfnCluster.CloudWatchLogConfigurationProperty = {
  enabled: false,

  // the properties below are optional
  encryptionKeyArn: 'encryptionKeyArn',
  logGroupName: 'logGroupName',
  logStreamNamePrefix: 'logStreamNamePrefix',
  logTypes: {
    logTypesKey: ['logTypes'],
  },
};
```

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_emr as emr

cloud_watch_log_configuration_property = emr.CfnCluster.CloudWatchLogConfigurationProperty(
    enabled=False,

    # the properties below are optional
    encryption_key_arn="encryptionKeyArn",
    log_group_name="logGroupName",
    log_stream_name_prefix="logStreamNamePrefix",
    log_types={
        "log_types_key": ["logTypes"]
    }
)
```

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.emr.*;

CloudWatchLogConfigurationProperty cloudWatchLogConfigurationProperty = CloudWatchLogConfigurationProperty.builder()
        .enabled(false)

        // the properties below are optional
        .encryptionKeyArn("encryptionKeyArn")
        .logGroupName("logGroupName")
        .logStreamNamePrefix("logStreamNamePrefix")
        .logTypes(Map.of(
                "logTypesKey", List.of("logTypes")))
        .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.EMR;

var cloudWatchLogConfigurationProperty = new CloudWatchLogConfigurationProperty {
    Enabled = false,

    // the properties below are optional
    EncryptionKeyArn = "encryptionKeyArn",
    LogGroupName = "logGroupName",
    LogStreamNamePrefix = "logStreamNamePrefix",
    LogTypes = new Dictionary<string, string[]> {
        { "logTypesKey", new [] { "logTypes" } }
    }
};
```

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"

cloudWatchLogConfigurationProperty := &CloudWatchLogConfigurationProperty{
	Enabled: jsii.Boolean(false),

	// the properties below are optional
	EncryptionKeyArn: jsii.String("encryptionKeyArn"),
	LogGroupName: jsii.String("logGroupName"),
	LogStreamNamePrefix: jsii.String("logStreamNamePrefix"),
	LogTypes: map[string][]*string{
		"logTypesKey": []*string{
			jsii.String("logTypes"),
		},
	},
}
```

## Properties

- `enabled`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) (required) — Specifies if CloudWatch logging is enabled.

- `encryptionKeyArn`: string — The ARN of the encryption key used to encrypt the logs.

- `logGroupName`: string — The name of the CloudWatch log group where logs are published.

- `logStreamNamePrefix`: string — The prefix of the log stream name.

- `logTypes`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | { [key: string]: string[] } — A map of log types to file names for publishing logs to the standard output or standard error streams for CloudWatch.

  Valid log types include STEP_LOGS, SPARK_DRIVER, and SPARK_EXECUTOR. Valid file names for each type include STDOUT and STDERR.
