constructor()

in lib/qldb-tables-provisioning.ts [41:59]


    constructor(scope: cdk.Construct, id: string, props: CrForProvQldbTablesProps) {
        super(scope, id);

        // Set up signleton - i.e. make sure there is only one instance of QldbTablesProvider existing in the stack. 
        const stack = cdk.Stack.of(this);
        const uid = 'ProvisionQldbTablesProvider';
        const myProvider = stack.node.tryFindChild(uid) as QldbTablesProvider || new QldbTablesProvider(stack, uid);

        new cdk.CustomResource(this, 'Resoure', {
            resourceType: 'Custom::CrForProvQldbTables',
            properties: {
                LedgerName: props.ledgerName,
                TableNameList: props.tableNameList,
                CustomResourceId: props.customResourceId,
                Description: props.description 
            },
            serviceToken: myProvider.provider.serviceToken
        });
    }