Skip to content

Actual alarm name is also used as logic Id which prevents tokens from being used #492

Answered by ericxinzhang
ericxinzhang asked this question in Q&A
Discussion options

You must be logged in to vote

Finally I solved it using Aspects to loop through and remove the token from node id of all chilren:

    const idTokenPrefixRE = /\$\{.+\}/;
   
    this.monitoringFacade = new MonitoringFacade(this, "MonitoringDashboard", {});
    ...
    Aspects.of(this.monitoringFacade).add(
      asAspect((c) => {
        // Use Object.assign as node.id is a readonly property
        Object.assign(c.node, { id: c.node.id.replace(idTokenPrefixRE, "") });
      }),
    );

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ericxinzhang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant