# LoggingProperty

Enable or disable exporting the Kubernetes control plane logs for your cluster to CloudWatch Logs.

By default, cluster control plane logs aren't exported to CloudWatch Logs. For more information, see [Amazon EKS Cluster control plane logs](https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html) in the **Amazon EKS User Guide** .

> When updating a resource, you must include this `Logging` property if the previous CloudFormation template of the resource had it. > CloudWatch Logs ingestion, archive storage, and data scanning rates apply to exported control plane logs. For more information, see [CloudWatch Pricing](https://docs.aws.amazon.com/cloudwatch/pricing/) .

- Source: Generated at build time
- Type last changed: v2.268.0 · 2 Sep 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_eks_v2 as eks_v2 } from 'aws-cdk-lib';
const loggingProperty: eks_v2.CfnCluster.LoggingProperty = {
  clusterLogging: {
    enabledTypes: [{
      type: 'type',
    }],
  },
};
```

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_eks_v2 as eks_v2

logging_property = eks_v2.CfnCluster.LoggingProperty(
    cluster_logging=eks_v2.CfnCluster.ClusterLoggingProperty(
        enabled_types=[eks_v2.CfnCluster.LoggingTypeConfigProperty(
            type="type"
        )]
    )
)
```

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

LoggingProperty loggingProperty = LoggingProperty.builder()
        .clusterLogging(ClusterLoggingProperty.builder()
                .enabledTypes(List.of(LoggingTypeConfigProperty.builder()
                        .type("type")
                        .build()))
                .build())
        .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.EKSv2;

var loggingProperty = new LoggingProperty {
    ClusterLogging = new ClusterLoggingProperty {
        EnabledTypes = new [] { new LoggingTypeConfigProperty {
            Type = "type"
        } }
    }
};
```

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"

loggingProperty := &LoggingProperty{
	ClusterLogging: &ClusterLoggingProperty{
		EnabledTypes: []interface{}{
			&LoggingTypeConfigProperty{
				Type: jsii.String("type"),
			},
		},
	},
}
```

## Properties

- `clusterLogging`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnCluster.ClusterLoggingProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_eks_v2.CfnCluster.ClusterLoggingProperty.html) — The cluster control plane logging configuration for your cluster.
