# MissingRemovalPolicies

Manages removal policies for resources without existing policies within a construct scope.

Obtainable from: MissingRemovalPolicies.of

- Source: [`core/lib/removal-policies.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/core/lib/removal-policies.ts#L186)
- Type last changed: v2.183.0 · 12 Mar 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
const missingRemovalPolicies = cdk.MissingRemovalPolicies.of(this);
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk

missing_removal_policies = cdk.MissingRemovalPolicies.of(self)
```

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

MissingRemovalPolicies missingRemovalPolicies = MissingRemovalPolicies.of(this);
```

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;

var missingRemovalPolicies = MissingRemovalPolicies.Of(this);
```

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 cdk "github.com/aws/aws-cdk-go/awscdk"

missingRemovalPolicies := cdk.MissingRemovalPolicies_Of(this)
```

## Methods

- `apply(policy: RemovalPolicy, props?: RemovalPolicyProps): void` — Apply a removal policy only to resources without existing policies within this scope.

  **Parameters**

  - `policy` — The removal policy to apply.
  - `props` — Configuration options.

- `destroy(props?: RemovalPolicyProps): void` — Apply DESTROY removal policy only to resources without existing policies within this scope.

  **Parameters**

  - `props` — Configuration options.

- `of(scope: IConstruct): MissingRemovalPolicies // chainable` (static) — Returns the missing removal policies API for the given scope.

  **Parameters**

  - `scope` — The scope.

- `retain(props?: RemovalPolicyProps): void` — Apply RETAIN removal policy only to resources without existing policies within this scope.

  **Parameters**

  - `props` — Configuration options.

- `retainOnUpdateOrDelete(props?: RemovalPolicyProps): void` — Apply RETAIN_ON_UPDATE_OR_DELETE removal policy only to resources without existing policies within this scope.

  **Parameters**

  - `props` — Configuration options.

- `snapshot(props?: RemovalPolicyProps): void` — Apply SNAPSHOT removal policy only to resources without existing policies within this scope.

  **Parameters**

  - `props` — Configuration options.
