Function Aspect

  • Decorator to add aspects to a stack.

    If this is used on a class, it will run the aspects on the stack after the stack is created.

    Example

    @Aspect((node) => {
    if (node instanceof CfnBucket) {
    node.bucketName = 'my-bucket';
    }
    })
    class MyStack extends Stack {
    constructor(scope: any, id: string) {
    super(scope, id);
    }
    }

    Parameters

    • aspect: IAspect | ((node: IConstruct) => void)

      the aspect to add which can be a function or an IAspect

    Returns any

Generated using TypeDoc