Class: AWSCDK::Budgets::CfnBudget::NotificationProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Budgets::CfnBudget::NotificationProperty
- Defined in:
- budgets/cfn_budget.rb
Overview
A notification that's associated with a budget. A budget can have up to ten notifications.
Each notification must have at least one subscriber. A notification can have one SNS subscriber and up to 10 email subscribers, for a total of 11 subscribers.
For example, if you have a budget for 200 dollars and you want to be notified when you go over 160 dollars, create a notification with the following parameters:
- A notificationType of
ACTUAL - A
threshold_typeofPERCENTAGE - A
comparison_operatorofGREATER_THAN - A notification
thresholdof80
Instance Attribute Summary collapse
-
#comparison_operator ⇒ String
readonly
The comparison that's used for this notification.
-
#notification_type ⇒ String
readonly
Specifies whether the notification is for how much you have spent (
ACTUAL) or for how much that you're forecasted to spend (FORECASTED). -
#threshold ⇒ Numeric
readonly
The threshold that's associated with a notification.
-
#threshold_type ⇒ String?
readonly
The type of threshold for a notification.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(comparison_operator:, notification_type:, threshold:, threshold_type: nil) ⇒ NotificationProperty
constructor
A new instance of NotificationProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(comparison_operator:, notification_type:, threshold:, threshold_type: nil) ⇒ NotificationProperty
Returns a new instance of NotificationProperty.
1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 |
# File 'budgets/cfn_budget.rb', line 1151 def initialize(comparison_operator:, notification_type:, threshold:, threshold_type: nil) @comparison_operator = comparison_operator Jsii::Type.check_type(@comparison_operator, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "comparisonOperator") @notification_type = notification_type Jsii::Type.check_type(@notification_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "notificationType") @threshold = threshold Jsii::Type.check_type(@threshold, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "threshold") @threshold_type = threshold_type Jsii::Type.check_type(@threshold_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "thresholdType") unless @threshold_type.nil? end |
Instance Attribute Details
#comparison_operator ⇒ String (readonly)
The comparison that's used for this notification.
1166 1167 1168 |
# File 'budgets/cfn_budget.rb', line 1166 def comparison_operator @comparison_operator end |
#notification_type ⇒ String (readonly)
Specifies whether the notification is for how much you have spent ( ACTUAL ) or for how much that you're forecasted to spend ( FORECASTED ).
1171 1172 1173 |
# File 'budgets/cfn_budget.rb', line 1171 def notification_type @notification_type end |
#threshold ⇒ Numeric (readonly)
The threshold that's associated with a notification.
Thresholds are always a percentage, and many customers find value being alerted between 50% - 200% of the budgeted amount. The maximum limit for your threshold is 1,000,000% above the budgeted amount.
1178 1179 1180 |
# File 'budgets/cfn_budget.rb', line 1178 def threshold @threshold end |
#threshold_type ⇒ String? (readonly)
The type of threshold for a notification.
For ABSOLUTE_VALUE thresholds, AWS notifies you when you go over or are forecasted to go over your total cost threshold. For PERCENTAGE thresholds, AWS notifies you when you go over or are forecasted to go over a certain percentage of your forecasted spend. For example, if you have a budget for 200 dollars and you have a PERCENTAGE threshold of 80%, AWS notifies you when you go over 160 dollars.
1185 1186 1187 |
# File 'budgets/cfn_budget.rb', line 1185 def threshold_type @threshold_type end |
Class Method Details
.jsii_properties ⇒ Object
1187 1188 1189 1190 1191 1192 1193 1194 |
# File 'budgets/cfn_budget.rb', line 1187 def self.jsii_properties { :comparison_operator => "comparisonOperator", :notification_type => "notificationType", :threshold => "threshold", :threshold_type => "thresholdType", } end |
Instance Method Details
#to_jsii ⇒ Object
1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 |
# File 'budgets/cfn_budget.rb', line 1196 def to_jsii result = {} result.merge!({ "comparisonOperator" => @comparison_operator, "notificationType" => @notification_type, "threshold" => @threshold, "thresholdType" => @threshold_type, }) result.compact end |