# TableOptimizerConfigurationProperty

Specifies configuration details of a table optimizer.

- Source: Generated at build time
- Type last changed: v2.262.0 · 22 Jul 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_glue as glue } from 'aws-cdk-lib';
const tableOptimizerConfigurationProperty: glue.CfnTableOptimizer.TableOptimizerConfigurationProperty = {
  enabled: false,
  roleArn: 'roleArn',

  // the properties below are optional
  compactionConfiguration: {
    icebergConfiguration: {
      deleteFileThreshold: 123,
      minInputFiles: 123,
      strategy: 'strategy',
    },
  },
  orphanFileDeletionConfiguration: {
    icebergConfiguration: {
      location: 'location',
      orphanFileRetentionPeriodInDays: 123,
    },
  },
  retentionConfiguration: {
    icebergConfiguration: {
      cleanExpiredFiles: false,
      numberOfSnapshotsToRetain: 123,
      snapshotRetentionPeriodInDays: 123,
    },
  },
  vpcConfiguration: {
    glueConnectionName: 'glueConnectionName',
  },
};
```

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_glue as glue

table_optimizer_configuration_property = glue.CfnTableOptimizer.TableOptimizerConfigurationProperty(
    enabled=False,
    role_arn="roleArn",

    # the properties below are optional
    compaction_configuration=glue.CfnTableOptimizer.CompactionConfigurationProperty(
        iceberg_configuration=glue.CfnTableOptimizer.IcebergCompactionConfigurationProperty(
            delete_file_threshold=123,
            min_input_files=123,
            strategy="strategy"
        )
    ),
    orphan_file_deletion_configuration=glue.CfnTableOptimizer.OrphanFileDeletionConfigurationProperty(
        iceberg_configuration=glue.CfnTableOptimizer.IcebergConfigurationProperty(
            location="location",
            orphan_file_retention_period_in_days=123
        )
    ),
    retention_configuration=glue.CfnTableOptimizer.RetentionConfigurationProperty(
        iceberg_configuration=glue.CfnTableOptimizer.IcebergRetentionConfigurationProperty(
            clean_expired_files=False,
            number_of_snapshots_to_retain=123,
            snapshot_retention_period_in_days=123
        )
    ),
    vpc_configuration=glue.CfnTableOptimizer.VpcConfigurationProperty(
        glue_connection_name="glueConnectionName"
    )
)
```

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

TableOptimizerConfigurationProperty tableOptimizerConfigurationProperty = TableOptimizerConfigurationProperty.builder()
        .enabled(false)
        .roleArn("roleArn")

        // the properties below are optional
        .compactionConfiguration(CompactionConfigurationProperty.builder()
                .icebergConfiguration(IcebergCompactionConfigurationProperty.builder()
                        .deleteFileThreshold(123)
                        .minInputFiles(123)
                        .strategy("strategy")
                        .build())
                .build())
        .orphanFileDeletionConfiguration(OrphanFileDeletionConfigurationProperty.builder()
                .icebergConfiguration(IcebergConfigurationProperty.builder()
                        .location("location")
                        .orphanFileRetentionPeriodInDays(123)
                        .build())
                .build())
        .retentionConfiguration(RetentionConfigurationProperty.builder()
                .icebergConfiguration(IcebergRetentionConfigurationProperty.builder()
                        .cleanExpiredFiles(false)
                        .numberOfSnapshotsToRetain(123)
                        .snapshotRetentionPeriodInDays(123)
                        .build())
                .build())
        .vpcConfiguration(VpcConfigurationProperty.builder()
                .glueConnectionName("glueConnectionName")
                .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.Glue;

var tableOptimizerConfigurationProperty = new TableOptimizerConfigurationProperty {
    Enabled = false,
    RoleArn = "roleArn",

    // the properties below are optional
    CompactionConfiguration = new CompactionConfigurationProperty {
        IcebergConfiguration = new IcebergCompactionConfigurationProperty {
            DeleteFileThreshold = 123,
            MinInputFiles = 123,
            Strategy = "strategy"
        }
    },
    OrphanFileDeletionConfiguration = new OrphanFileDeletionConfigurationProperty {
        IcebergConfiguration = new IcebergConfigurationProperty {
            Location = "location",
            OrphanFileRetentionPeriodInDays = 123
        }
    },
    RetentionConfiguration = new RetentionConfigurationProperty {
        IcebergConfiguration = new IcebergRetentionConfigurationProperty {
            CleanExpiredFiles = false,
            NumberOfSnapshotsToRetain = 123,
            SnapshotRetentionPeriodInDays = 123
        }
    },
    VpcConfiguration = new VpcConfigurationProperty {
        GlueConnectionName = "glueConnectionName"
    }
};
```

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"

tableOptimizerConfigurationProperty := &TableOptimizerConfigurationProperty{
	Enabled: jsii.Boolean(false),
	RoleArn: jsii.String("roleArn"),

	// the properties below are optional
	CompactionConfiguration: &CompactionConfigurationProperty{
		IcebergConfiguration: &IcebergCompactionConfigurationProperty{
			DeleteFileThreshold: jsii.Number(123),
			MinInputFiles: jsii.Number(123),
			Strategy: jsii.String("strategy"),
		},
	},
	OrphanFileDeletionConfiguration: &OrphanFileDeletionConfigurationProperty{
		IcebergConfiguration: &IcebergConfigurationProperty{
			Location: jsii.String("location"),
			OrphanFileRetentionPeriodInDays: jsii.Number(123),
		},
	},
	RetentionConfiguration: &RetentionConfigurationProperty{
		IcebergConfiguration: &IcebergRetentionConfigurationProperty{
			CleanExpiredFiles: jsii.Boolean(false),
			NumberOfSnapshotsToRetain: jsii.Number(123),
			SnapshotRetentionPeriodInDays: jsii.Number(123),
		},
	},
	VpcConfiguration: &VpcConfigurationProperty{
		GlueConnectionName: jsii.String("glueConnectionName"),
	},
}
```

## Properties

- `compactionConfiguration`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnTableOptimizer.CompactionConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.CfnTableOptimizer.CompactionConfigurationProperty.html)

- `enabled`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) (required) — Whether the table optimization is enabled.

- `orphanFileDeletionConfiguration`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnTableOptimizer.OrphanFileDeletionConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.CfnTableOptimizer.OrphanFileDeletionConfigurationProperty.html) — `OrphanFileDeletionConfiguration` is a property that can be included within the TableOptimizer resource.

  It controls the automatic deletion of orphaned files - files that are not tracked by the table metadata, and older than the configured age limit.

- `retentionConfiguration`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnTableOptimizer.RetentionConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.CfnTableOptimizer.RetentionConfigurationProperty.html) — The configuration for a snapshot retention optimizer for Apache Iceberg tables.

- `roleArn`: string (required) — A role passed by the caller which gives the service permission to update the resources associated with the optimizer on the caller's behalf.

- `vpcConfiguration`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnTableOptimizer.VpcConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_glue.CfnTableOptimizer.VpcConfigurationProperty.html) — An object that describes the VPC configuration for a table optimizer.

  This configuration is necessary to perform optimization on tables that are in a customer VPC.
