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

Add support for percentage-based thresholds #23

Merged
merged 2 commits into from Jan 17, 2023
Merged

Add support for percentage-based thresholds #23

merged 2 commits into from Jan 17, 2023

Conversation

keatomue
Copy link
Contributor

Description of changes

Adding support for ThresholdExpression on the AWS::CE::AnomalySubscription resource.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link

@kingsleyliao kingsleyliao left a comment

Choose a reason for hiding this comment

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

lgtm

@@ -68,6 +68,40 @@ public void handleRequest_Success() {
assertThat(response.getErrorCode()).isNull();
}

@Test
Copy link

@arodivya arodivya Jan 12, 2023

Choose a reason for hiding this comment

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

Do we need a similar test under UpdateHandler? Could that be a good place to document the nuances of Update for Threshold/ThresholdExpression?

Copy link
Contributor Author

@keatomue keatomue Jan 12, 2023

Choose a reason for hiding this comment

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

Sure, can add a similar unit test

Update: Added 👍

@@ -35,6 +37,7 @@ public static UpdateAnomalySubscriptionRequest buildUpdateAnomalySubscriptionReq
.subscriptionArn(model.getSubscriptionArn())
.subscriptionName(model.getSubscriptionName())
.threshold(model.getThreshold())
.thresholdExpression(model.getThresholdExpression() != null ? Utils.toExpressionFromJson(model.getThresholdExpression()) : null)

Choose a reason for hiding this comment

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

Could we add a comment to this method about acceptable inputs for Threshold and ThresholdExpression for updates

Copy link
Contributor Author

@keatomue keatomue Jan 12, 2023

Choose a reason for hiding this comment

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

Yep, will add

Update: Added 👍

@ronkorving
Copy link

ronkorving commented May 10, 2023

Did this ever get rolled out to ap-northeast-1? I get the following error when trying to create a changeset:

Template format error: Unrecognized resource types: [AWS::CE::AnomalyMonitor, AWS::CE::AnomalySubscription]

@keatomue
Copy link
Contributor Author

keatomue commented May 10, 2023

Hello,

AWS::CE::AnomalyMonitor and AWS::CE::AnomalySubscription resources in their entirety are unfortunately currently only available in the us-east-1 and cn-northwest-1 regions

We have plans to expand to all regions, but unfortunately for now that is the restriction

@ronkorving
Copy link

I know CFN docs don't mention regions, but It would've saved me a lot of time if the docs had mentioned that. Thanks for the response here though, I do appreciate it.

@keatomue keatomue deleted the percentageBasedThresholds branch September 28, 2023 17:48
@keatomue
Copy link
Contributor Author

Hello! Been a while, but we just released to every region: https://aws.amazon.com/about-aws/whats-new/2023/12/cost-anomaly-detection-cloudformation-region-support/

Including, of course, ap-northeast-1 like you were asking about.

Hopefully this helps!

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.

None yet

4 participants