Class: AWSCDK::Budgets::CfnBudget::SpendProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
budgets/cfn_budget.rb

Overview

The amount of cost or usage that's measured for a budget.

Cost example: A Spend for 3 USD of costs has the following parameters:

  • An Amount of 3
  • A Unit of USD

Usage example: A Spend for 3 GB of S3 usage has the following parameters:

  • An Amount of 3
  • A Unit of GB

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(amount:, unit:) ⇒ SpendProperty

Returns a new instance of SpendProperty.

Parameters:

  • amount (Numeric)

    The cost or usage amount that's associated with a budget forecast, actual spend, or budget threshold.

  • unit (String)

    The unit of measurement that's used for the budget forecast, actual spend, or budget threshold.



1314
1315
1316
1317
1318
1319
# File 'budgets/cfn_budget.rb', line 1314

def initialize(amount:, unit:)
  @amount = amount
  Jsii::Type.check_type(@amount, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "amount")
  @unit = unit
  Jsii::Type.check_type(@unit, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "unit")
end

Instance Attribute Details

#amountNumeric (readonly)

The cost or usage amount that's associated with a budget forecast, actual spend, or budget threshold.



1325
1326
1327
# File 'budgets/cfn_budget.rb', line 1325

def amount
  @amount
end

#unitString (readonly)

The unit of measurement that's used for the budget forecast, actual spend, or budget threshold.



1330
1331
1332
# File 'budgets/cfn_budget.rb', line 1330

def unit
  @unit
end

Class Method Details

.jsii_propertiesObject



1332
1333
1334
1335
1336
1337
# File 'budgets/cfn_budget.rb', line 1332

def self.jsii_properties
  {
    :amount => "amount",
    :unit => "unit",
  }
end

Instance Method Details

#to_jsiiObject



1339
1340
1341
1342
1343
1344
1345
1346
# File 'budgets/cfn_budget.rb', line 1339

def to_jsii
  result = {}
  result.merge!({
    "amount" => @amount,
    "unit" => @unit,
  })
  result.compact
end