Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cloudwatch): support cross-environment search expressions #16539

Merged
merged 3 commits into from
Sep 27, 2021

Conversation

LeahHirst
Copy link
Contributor

@LeahHirst LeahHirst commented Sep 18, 2021

Fixes #9039 (also some prior discussion on #9034)

Currently CDK gives no way to specify account or region on MathExpressions which means it is not possible to run search expressions against environments other than the deployment environment.

The CloudWatch console currently has this capability, however the documentation still states that accountId or region should only be used on metric widgets. I've left feedback to ask whether this documentation is out of date or whether it is an undocumented feature.

This change adds in the searchAccount and searchRegion property which can be optionally specified for the Dashboards use case. When a MathExpression with a searchAccount or searchRegion set is attempted to be used within an Alarm, the change throws an error as Alarms do not support search expressions.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

…ironment math expressions (aws#9039)

Fixes: aws#9039

Currently CDK gives no way to specify account or region on MathExpressions which means it is not possible to run SEARCH or SERVICE_QUOTA expressions against environments other than the deployment environment.

The CloudWatch console currently has this capability, however the documentation still states that accountId or region should only be used on metric widgets: https://docs.aws.amazon.com/en_us/AmazonCloudWatch/latest/APIReference/CloudWatch-Dashboard-Body-Structure.html#CloudWatch-Dashboard-Properties-Metric-Widget-Object . I've left feedback to ask whether this documentation is out of date.

This change adds in these properties which can be optionally specified for Dashboards. For the Alarm use case, this change will throw an error if an account or region is provided and it does not match the deployment account/region.
@gitpod-io
Copy link

gitpod-io bot commented Sep 18, 2021

@LeahHirst LeahHirst changed the title feat(cloudwatch): support specifying account and region for cross-env… feat(cloudwatch): support cross-environment search expressions Sep 24, 2021
@mergify
Copy link
Contributor

mergify bot commented Sep 27, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: d48487d
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit c165138 into aws:master Sep 27, 2021
@mergify
Copy link
Contributor

mergify bot commented Sep 27, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this pull request Feb 21, 2022
…6539)

Fixes aws#9039 (also some prior discussion on aws#9034)

Currently CDK gives no way to specify account or region on MathExpressions which means it is not possible to run search expressions against environments other than the deployment environment.

The CloudWatch console currently has this capability, however [the documentation](https://docs.aws.amazon.com/en_us/AmazonCloudWatch/latest/APIReference/CloudWatch-Dashboard-Body-Structure.html#CloudWatch-Dashboard-Properties-Metric-Widget-Object) still states that `accountId` or `region` should only be used on metric widgets. I've left feedback to ask whether this documentation is out of date or whether it is an undocumented feature.

This change adds in the `searchAccount` and `searchRegion` property which can be optionally specified for the Dashboards use case. When a MathExpression with a searchAccount or searchRegion set is attempted to be used within an Alarm, the change throws an error as Alarms do not support search expressions.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[aws-cloudwatch] Support region and account in MathExpression
3 participants