Shims

class aws_cdk.Shims(*args: Any, **kwargs)

Bases: object

Converts between Mixins and Aspects.

Since Mixins and Aspects are both implementations of the visitor pattern, they can be converted from each other. Mixins are applied immediately (imperative), while Aspects are applied during synthesis (declarative).

Static Methods

classmethod as_aspect(mixin)

Wraps a Mixin as an Aspect.

The resulting Aspect defers the Mixin’s application to the synthesis phase. The Mixin’s supports() method is used to filter which constructs are visited.

Parameters:

mixin (IMixin) – The Mixin to wrap.

Return type:

IAspect

classmethod as_mixin(aspect)

Wraps an Aspect as a Mixin.

The resulting Mixin applies the Aspect’s visit() immediately to every node. The Aspect is applied to all constructs since Aspects don’t have a supports() filter.

Parameters:

aspect (IAspect) – The Aspect to wrap.

Return type:

IMixin