Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cloudwatch): cross-account metrics in env-agnostic stack
In order to avoid generating unnecessary diffs to currently-deployed CloudWatch dashboards, in #5628 when adding support for cross-region/cross-account metrics, we only selectively render the new attributes into the graph (only when we estimate it will make a difference). The method chosen was: Render account/region if they're *definitely* different. However, this has the side effect that the new region and account attributes don't work at all in environment-agnostic stacks (because we won't know whether they'll be different or not, and we assume they will be). Whether the original behavior was wrong or not can be debated, but it's unintuitive for sure: users put in values that don't come back out in the usual, getting-started case. In this PR, change the decision to: Don't render account/region if they're *definitely* the same. This will fix the case of manual input to `Metric`, and since `attachTo()` won't take account and region from environment-agnostic stacks anyway, it also won't introduce unwanted diffs in most cases.
- Loading branch information