# MixinApplicator

Applies mixins to constructs.

Obtainable from: [Mixins.of](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Mixins.html#of)
Returned by: MixinApplicator.apply, MixinApplicator.requireAll, MixinApplicator.requireAny

- Source: [`core/lib/mixins/applicator.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/core/lib/mixins/applicator.ts#L25)
- Type last changed: v2.241.0 · 2 Mar 2026

## 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';

declare const constructSelector: cdk.IConstructSelector;
const mixinApplicator = new cdk.MixinApplicator(this, /* all optional props */ constructSelector);
```

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

# construct_selector: cdk.IConstructSelector

mixin_applicator = cdk.MixinApplicator(self, construct_selector)
```

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

IConstructSelector constructSelector;

MixinApplicator mixinApplicator = new MixinApplicator(this, constructSelector);
```

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;

IConstructSelector constructSelector;

var mixinApplicator = new MixinApplicator(this, constructSelector);
```

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"

var constructSelector IConstructSelector

mixinApplicator := cdk.NewMixinApplicator(this, constructSelector)
```

## Initializer

TypeScript:

```ts
new MixinApplicator(scope: IConstruct, selector?: IConstructSelector)
```

Python:

```python
MixinApplicator(scope: IConstruct, selector: typing.Optional[IConstructSelector] = None)
```

Java:

```java
new MixinApplicator(IConstruct scope, IConstructSelector selector)
```

C# / .NET:

```csharp
new MixinApplicator(IConstruct scope, IConstructSelector? selector = null)
```

Golang:

```go
NewMixinApplicator(Scope IConstruct, Selector IConstructSelector)
```

## Properties

- `report`: [MixinApplication](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.MixinApplication.html)[] — Returns the successful mixin applications.

- `selectedConstructs`: [IConstruct](https://docs.aws.amazon.com/cdk/api/v2/docs/constructs.IConstruct.html)[] — The constructs that match the selector in the given scope.

## Methods

- `apply(...mixins: IMixin[]): MixinApplicator // chainable` — Applies a mixin to selected constructs.

- `requireAll(): MixinApplicator // chainable` — Requires all selected constructs to support the applied mixins.

  Will only check for future call of `apply()`.
  Set this before calling `apply()` to take effect.

  ```ts
  Mixins.of(scope)
    .requireAll()
    .apply(new MyMixin());
  ```

- `requireAny(): MixinApplicator // chainable` — Requires at least one mixin to be successfully applied.

  Will only check for future call of `apply()`.
  Set this before calling `apply()` to take effect.

  ```ts
  Mixins.of(scope)
    .requireAny()
    .apply(new MyMixin());
  ```
