-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow specifying regions/accounts at a more granular level (#533)
This allows users to target different regions/account for specific things within a facade rather than relying on 1 facade per region/account with the facade's global settings, so something like: ```ts this.facade .monitorDynamoTable({ ..., }) .monitorDynamoTable({ ..., region: <some_other_region>, account: <some_other_account>, }) ``` --- _By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license_
- Loading branch information
1 parent
8ee4010
commit 4801636
Showing
46 changed files
with
4,703 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,33 @@ | ||
import { MetricFactory } from "./MetricFactory"; | ||
|
||
export interface BaseMetricFactoryProps { | ||
// TODO: this will eventually include other common things like account/region | ||
/** | ||
* Region where the metrics exist. | ||
* | ||
* @default The region configured by the construct holding the Monitoring construct | ||
* @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Cross-Account-Cross-Region.html | ||
*/ | ||
readonly region?: string; | ||
|
||
/** | ||
* Account where the metrics exist. | ||
* | ||
* @default The account configured by the construct holding the Monitoring construct | ||
* @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Cross-Account-Cross-Region.html | ||
*/ | ||
readonly account?: string; | ||
} | ||
|
||
export abstract class BaseMetricFactory< | ||
PropsType extends BaseMetricFactoryProps, | ||
> { | ||
protected readonly metricFactory: MetricFactory; | ||
protected readonly account?: string; | ||
protected readonly region?: string; | ||
|
||
constructor(metricFactory: MetricFactory, _props: PropsType) { | ||
constructor(metricFactory: MetricFactory, props: PropsType) { | ||
this.metricFactory = metricFactory; | ||
this.account = props.account; | ||
this.region = props.region; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.