Skip to content
v2.274.0

PropertyInjectors Class ​

This is a collection of ProjectInjectors assigned to this scope.

It is keyed by constructUniqueId. There can be only one ProjectInjector for a constructUniqueId.

Example ​

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 propertyInjectors = cdk.PropertyInjectors.of(this);

Properties ​

The scope attached to Injectors.

Methods ​

add(...propsInjectors: IPropertyInjector[]): voiddef add(self, props_injectors: IPropertyInjector) -> Nonepublic void add(IPropertyInjector propsInjectors)public void Add(IPropertyInjector propsInjectors)func Add(PropsInjectors IPropertyInjector)#
Add a list of IPropertyInjectors to this collection of PropertyInjectors.
1 parameter

Parameters

  • propsInjectorsprops_injectorspropsInjectorspropsInjectorsPropsInjectors — - a list of IPropertyInjector.
for(uniqueId: string): IPropertyInjectordef for(self, unique_id: str) -> IPropertyInjectorpublic IPropertyInjector for(String uniqueId)public IPropertyInjector For(string uniqueId)func For(UniqueId *string) IPropertyInjector#
Get the PropertyInjector that is registered to the Construct's uniqueId.
1 parameter · returns

Parameters

  • uniqueIdunique_iduniqueIduniqueIdUniqueId — - the construct uniqueId.

Returns: - the IPropertyInjector for that construct uniqueId

hasPropertyInjectors(x: any): boolean@staticmethod def has_property_injectors(x: Any) -> boolpublic static Boolean hasPropertyInjectors(Object x)public static bool HasPropertyInjectors(object x)func HasPropertyInjectors(X interface{}) *boolstatic#
Return whether the given object has a PropertyInjectors property.

We do attribute detection since we can't reliably use 'instanceof'.

of(scope: IConstruct): PropertyInjectors // chainable@staticmethod def of(scope: IConstruct) -> PropertyInjectorspublic static PropertyInjectors of(IConstruct scope)public static PropertyInjectors Of(IConstruct scope)func Of(Scope IConstruct) PropertyInjectorsstatic#
Returns the `PropertyInjectors` object associated with a construct scope.

If PropertyInjectors object doesn't exist on this scope, then it creates one and attaches it to scope.

1 parameter

Parameters

  • scopescopescopescopeScope — The scope for which these PropertyInjectors will apply.
supportedClasses(): string[]def supported_classes(self, ) -> typing.List[str]public List<String> supportedClasses()public string[] SupportedClasses()func SupportedClasses() *[]*string#
This returns a list of the Constructs that are supporting by this PropertyInjectors.
returns

Returns: a list of string showing the supported Constructs.