# DeletionProtectionCheck

The deletion protection check options.

- Source: [`aws-appconfig/lib/util.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-appconfig/lib/util.ts#L4)
- Type last changed: v2.176.0 · 15 Jan 2025

## Example

```ts
declare const application: appconfig.Application;
declare const alarm: cloudwatch.Alarm;
declare const compositeAlarm: cloudwatch.CompositeAlarm;
declare const bucket: s3.Bucket;

// Environment deletion protection check
new appconfig.Environment(this, 'MyEnvironment', {
  application,
  deletionProtectionCheck: appconfig.DeletionProtectionCheck.APPLY,
});

// configuration profile with deletion protection check
new appconfig.HostedConfiguration(this, 'MyHostedConfigFromFile', {
  application,
  content: appconfig.ConfigurationContent.fromFile('config.json'),
  deletionProtectionCheck: appconfig.DeletionProtectionCheck.BYPASS,
});

new appconfig.SourcedConfiguration(this, 'MySourcedConfiguration', {
  application,
  location: appconfig.ConfigurationSource.fromBucket(bucket, 'path/to/file.json'),
  deletionProtectionCheck: appconfig.DeletionProtectionCheck.ACCOUNT_DEFAULT,
});
```

## Members

| Member | Description |
| --- | --- |
| `ACCOUNT_DEFAULT` | The default setting, which uses account-level deletion protection. |
| `APPLY` | Instructs the deletion protection check to run, even if deletion protection is disabled at the account level. |
| `BYPASS` | Instructs AWS AppConfig to bypass the deletion protection check and delete an environment or a configuration profile even if deletion protection would have otherwise prevented it. |

## Referenced by

- [`ConfigurationOptions`](/v2/docs/aws-cdk-lib.aws_appconfig.ConfigurationOptions).deletionProtectionCheck
- [`EnvironmentOptions`](/v2/docs/aws-cdk-lib.aws_appconfig.EnvironmentOptions).deletionProtectionCheck
- [`HostedConfiguration`](/v2/docs/aws-cdk-lib.aws_appconfig.HostedConfiguration).deletionProtectionCheck
- [`SourcedConfiguration`](/v2/docs/aws-cdk-lib.aws_appconfig.SourcedConfiguration).deletionProtectionCheck
