Skip to content

fix(cloudwatch): render agnostic alarms in legacy style#17538

Merged
mergify[bot] merged 6 commits intomasterfrom
huijbers/cloudwatch-alarm-styles
Nov 17, 2021
Merged

fix(cloudwatch): render agnostic alarms in legacy style#17538
mergify[bot] merged 6 commits intomasterfrom
huijbers/cloudwatch-alarm-styles

Conversation

@rix0rrr
Copy link
Copy Markdown
Contributor

@rix0rrr rix0rrr commented Nov 17, 2021

Render legacy style alarms even if the user explicitly passes in the
Aws.ACCOUNT_ID token: we can compare these strings since we every call
to Aws.ACCOUNT_ID is guaranteed to return the same tokenized string.
Only switch to modern-style alarms if we cannot successfully determine
that they are definitely equal.

This simplifies one more case that would accidentally trigger new-style
alarms, which some SNS notification consumers are not equipped to handle.

Add a section to the README explaining the differences between old and
new-style alarms, and that SNS consumers need to pay attention to the
differences.


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

Render legacy style alarms even if the user explicitly passes in the
`Aws.ACCOUNT_ID` token: we can compare these strings since we every call
to `Aws.ACCOUNT_ID` is guaranteed to return the same tokenized string.
Only switch to modern-style alarms if we cannot successfully determine
that they are definitely equal.

This simplifies one more case that would accidentally trigger new-style
alarms, which some SNS notification consumers are not equipped to handle.

Add a section to the README explaining the differences between old and
new-style alarms, and that SNS consumers need to pay attention to the
differences.
@rix0rrr rix0rrr requested a review from a team November 17, 2021 10:49
@rix0rrr rix0rrr self-assigned this Nov 17, 2021
@gitpod-io
Copy link
Copy Markdown

gitpod-io bot commented Nov 17, 2021

@github-actions github-actions bot added the @aws-cdk/aws-cloudwatch Related to Amazon CloudWatch label Nov 17, 2021
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Nov 17, 2021

// if this is a region-agnostic stack, we can't assume anything about stat.account
// and therefore we assume its a cross-account call
if (Token.isUnresolved(stackAccount)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might as well remove this if entirely.

@rix0rrr rix0rrr requested review from a team and otaviomacedo November 17, 2021 16:04
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Nov 17, 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
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: 7c09c6b
  • 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 7c50ef8 into master Nov 17, 2021
@mergify mergify bot deleted the huijbers/cloudwatch-alarm-styles branch November 17, 2021 20:22
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Nov 17, 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
Render legacy style alarms even if the user explicitly passes in the
`Aws.ACCOUNT_ID` token: we can compare these strings since we every call
to `Aws.ACCOUNT_ID` is guaranteed to return the same tokenized string.
Only switch to modern-style alarms if we cannot successfully determine
that they are definitely equal.

This simplifies one more case that would accidentally trigger new-style
alarms, which some SNS notification consumers are not equipped to handle.

Add a section to the README explaining the differences between old and
new-style alarms, and that SNS consumers need to pay attention to the
differences.


----

*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

@aws-cdk/aws-cloudwatch Related to Amazon CloudWatch contribution/core This is a PR that came from AWS.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants