Skip to content

Commit 4217bb9

Browse files
fix: Use correct account when creating Console URLs in the case of cross-account monitoring (#322)
Cross account dashboards have been added in #311, but I noticed that the URLs would try to open the AWS Console in the wrong account. This PR fixes that. --- _By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license_
1 parent 3c1b645 commit 4217bb9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/facade/MonitoringFacade.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ export class MonitoringFacade extends MonitoringScope {
192192

193193
createAwsConsoleUrlFactory(): AwsConsoleUrlFactory {
194194
const stack = Stack.of(this);
195-
const awsAccountId = stack.account;
196-
const awsAccountRegion = stack.region;
195+
const awsAccountId = this.metricFactoryDefaults.account ?? stack.account;
196+
const awsAccountRegion = this.metricFactoryDefaults.region ?? stack.region;
197197
return new AwsConsoleUrlFactory({ awsAccountRegion, awsAccountId });
198198
}
199199

0 commit comments

Comments
 (0)