# AutoPatchConfigProperty

The configuration for automatic patching of the instance group.

Enables workload-aware, patch-level AMI updates.

- Source: Generated at build time
- Type last changed: v2.264.0 · 10 Aug 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_sagemaker as sagemaker } from 'aws-cdk-lib';
const autoPatchConfigProperty: sagemaker.CfnCluster.AutoPatchConfigProperty = {
  patchingStrategy: 'patchingStrategy',

  // the properties below are optional
  deploymentConfig: {
    autoRollbackConfiguration: [{
      alarmName: 'alarmName',
    }],
    rollingUpdatePolicy: {
      maximumBatchSize: {
        type: 'type',
        value: 123,
      },

      // the properties below are optional
      rollbackMaximumBatchSize: {
        type: 'type',
        value: 123,
      },
    },
    waitIntervalInSeconds: 123,
  },
  patchSchedule: {
    nextPatchDate: 'nextPatchDate',
  },
};
```

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_sagemaker as sagemaker

auto_patch_config_property = sagemaker.CfnCluster.AutoPatchConfigProperty(
    patching_strategy="patchingStrategy",

    # the properties below are optional
    deployment_config=sagemaker.CfnCluster.DeploymentConfigProperty(
        auto_rollback_configuration=[sagemaker.CfnCluster.AlarmDetailsProperty(
            alarm_name="alarmName"
        )],
        rolling_update_policy=sagemaker.CfnCluster.RollingUpdatePolicyProperty(
            maximum_batch_size=sagemaker.CfnCluster.CapacitySizeConfigProperty(
                type="type",
                value=123
            ),

            # the properties below are optional
            rollback_maximum_batch_size=sagemaker.CfnCluster.CapacitySizeConfigProperty(
                type="type",
                value=123
            )
        ),
        wait_interval_in_seconds=123
    ),
    patch_schedule=sagemaker.CfnCluster.PatchScheduleProperty(
        next_patch_date="nextPatchDate"
    )
)
```

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

AutoPatchConfigProperty autoPatchConfigProperty = AutoPatchConfigProperty.builder()
        .patchingStrategy("patchingStrategy")

        // the properties below are optional
        .deploymentConfig(DeploymentConfigProperty.builder()
                .autoRollbackConfiguration(List.of(AlarmDetailsProperty.builder()
                        .alarmName("alarmName")
                        .build()))
                .rollingUpdatePolicy(RollingUpdatePolicyProperty.builder()
                        .maximumBatchSize(CapacitySizeConfigProperty.builder()
                                .type("type")
                                .value(123)
                                .build())

                        // the properties below are optional
                        .rollbackMaximumBatchSize(CapacitySizeConfigProperty.builder()
                                .type("type")
                                .value(123)
                                .build())
                        .build())
                .waitIntervalInSeconds(123)
                .build())
        .patchSchedule(PatchScheduleProperty.builder()
                .nextPatchDate("nextPatchDate")
                .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.Sagemaker;

var autoPatchConfigProperty = new AutoPatchConfigProperty {
    PatchingStrategy = "patchingStrategy",

    // the properties below are optional
    DeploymentConfig = new DeploymentConfigProperty {
        AutoRollbackConfiguration = new [] { new AlarmDetailsProperty {
            AlarmName = "alarmName"
        } },
        RollingUpdatePolicy = new RollingUpdatePolicyProperty {
            MaximumBatchSize = new CapacitySizeConfigProperty {
                Type = "type",
                Value = 123
            },

            // the properties below are optional
            RollbackMaximumBatchSize = new CapacitySizeConfigProperty {
                Type = "type",
                Value = 123
            }
        },
        WaitIntervalInSeconds = 123
    },
    PatchSchedule = new PatchScheduleProperty {
        NextPatchDate = "nextPatchDate"
    }
};
```

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"

autoPatchConfigProperty := &AutoPatchConfigProperty{
	PatchingStrategy: jsii.String("patchingStrategy"),

	// the properties below are optional
	DeploymentConfig: &DeploymentConfigProperty{
		AutoRollbackConfiguration: []interface{}{
			&AlarmDetailsProperty{
				AlarmName: jsii.String("alarmName"),
			},
		},
		RollingUpdatePolicy: &RollingUpdatePolicyProperty{
			MaximumBatchSize: &CapacitySizeConfigProperty{
				Type: jsii.String("type"),
				Value: jsii.Number(123),
			},

			// the properties below are optional
			RollbackMaximumBatchSize: &CapacitySizeConfigProperty{
				Type: jsii.String("type"),
				Value: jsii.Number(123),
			},
		},
		WaitIntervalInSeconds: jsii.Number(123),
	},
	PatchSchedule: &PatchScheduleProperty{
		NextPatchDate: jsii.String("nextPatchDate"),
	},
}
```

## Properties

- `deploymentConfig`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnCluster.DeploymentConfigProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sagemaker.CfnCluster.DeploymentConfigProperty.html) — The configuration to use when updating the AMI versions.

- `patchingStrategy`: string (required) — The patching strategy that determines when and how instances are patched.

  WhenIdle patches instances as they become idle. WhenAllIdle patches all instances when they are all idle.

- `patchSchedule`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnCluster.PatchScheduleProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sagemaker.CfnCluster.PatchScheduleProperty.html) — The schedule configuration for automatic patching.
