You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::Budgets::Client

Inherits:
Seahorse::Client::Base show all
Defined in:
(unknown)

Overview

An API client for AWS Budgets. To construct a client, you need to configure a :region and :credentials.

budgets = Aws::Budgets::Client.new(
  region: region_name,
  credentials: credentials,
  # ...
)

See #initialize for a full list of supported configuration options.

Region

You can configure a default region in the following locations:

  • ENV['AWS_REGION']
  • Aws.config[:region]

Go here for a list of supported regions.

Credentials

Default credentials are loaded automatically from the following locations:

  • ENV['AWS_ACCESS_KEY_ID'] and ENV['AWS_SECRET_ACCESS_KEY']
  • Aws.config[:credentials]
  • The shared credentials ini file at ~/.aws/credentials (more information)
  • From an instance profile when running on EC2

You can also construct a credentials object from one of the following classes:

Alternatively, you configure credentials with :access_key_id and :secret_access_key:

# load credentials from disk
creds = YAML.load(File.read('/path/to/secrets'))

Aws::Budgets::Client.new(
  access_key_id: creds['access_key_id'],
  secret_access_key: creds['secret_access_key']
)

Always load your credentials from outside your application. Avoid configuring credentials statically and never commit them to source control.

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

Constructor collapse

API Operations collapse

Instance Method Summary collapse

Methods inherited from Seahorse::Client::Base

add_plugin, api, #build_request, clear_plugins, define, new, #operation, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(options = {}) ⇒ Aws::Budgets::Client

Constructs an API client.

Options Hash (options):

  • :access_key_id (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :active_endpoint_cache (Boolean)

    When set to true, a thread polling for endpoints will be running in the background every 60 secs (default). Defaults to false. See Plugins::EndpointDiscovery for more details.

  • :convert_params (Boolean) — default: true

    When true, an attempt is made to coerce request parameters into the required types. See Plugins::ParamConverter for more details.

  • :credentials (required, Credentials)

    Your AWS credentials. The following locations will be searched in order for credentials:

    • :access_key_id, :secret_access_key, and :session_token options
    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
    • HOME/.aws/credentials shared credentials file
    • EC2 instance profile credentials See Plugins::RequestSigner for more details.
  • :disable_host_prefix_injection (Boolean)

    Set to true to disable SDK automatically adding host prefix to default service endpoint when available. See Plugins::EndpointPattern for more details.

  • :endpoint (String)

    A default endpoint is constructed from the :region. See Plugins::RegionalEndpoint for more details.

  • :endpoint_cache_max_entries (Integer)

    Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000. See Plugins::EndpointDiscovery for more details.

  • :endpoint_cache_max_threads (Integer)

    Used for the maximum threads in use for polling endpoints to be cached, defaults to 10. See Plugins::EndpointDiscovery for more details.

  • :endpoint_cache_poll_interval (Integer)

    When :endpoint_discovery and :active_endpoint_cache is enabled, Use this option to config the time interval in seconds for making requests fetching endpoints information. Defaults to 60 sec. See Plugins::EndpointDiscovery for more details.

  • :endpoint_discovery (Boolean)

    When set to true, endpoint discovery will be enabled for operations when available. Defaults to false. See Plugins::EndpointDiscovery for more details.

  • :http_continue_timeout (Float) — default: 1

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_idle_timeout (Integer) — default: 5

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_open_timeout (Integer) — default: 15

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_proxy (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_read_timeout (Integer) — default: 60

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_wire_trace (Boolean) — default: false

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the logger at. See Plugins::Logging for more details.

  • :log_formatter (Logging::LogFormatter)

    The log formatter. Defaults to Seahorse::Client::Logging::Formatter.default. See Plugins::Logging for more details.

  • :logger (Logger) — default: nil

    The Logger instance to send log messages to. If this option is not set, logging will be disabled. See Plugins::Logging for more details.

  • :profile (String)

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used. See Plugins::RequestSigner for more details.

  • :raise_response_errors (Boolean) — default: true

    When true, response errors are raised. See Seahorse::Client::Plugins::RaiseResponseErrors for more details.

  • :region (required, String)

    The AWS region to connect to. The region is used to construct the client endpoint. Defaults to ENV['AWS_REGION']. Also checks AMAZON_REGION and AWS_DEFAULT_REGION. See Plugins::RegionalEndpoint for more details.

  • :retry_limit (Integer) — default: 3

    The maximum number of times to retry failed requests. Only ~ 500 level server errors and certain ~ 400 level client errors are retried. Generally, these are throttling errors, data checksum errors, networking errors, timeout errors and auth errors from expired credentials. See Plugins::RetryErrors for more details.

  • :secret_access_key (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :session_token (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :simple_json (Boolean) — default: false

    Disables request parameter conversion, validation, and formatting. Also disable response data type conversions. This option is useful when you want to ensure the highest level of performance by avoiding overhead of walking request parameters and response data structures.

    When :simple_json is enabled, the request parameters hash must be formatted exactly as the DynamoDB API expects. See Plugins::Protocols::JsonRpc for more details.

  • :ssl_ca_bundle (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_directory (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_store (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_verify_peer (Boolean) — default: true

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :stub_responses (Boolean) — default: false

    Causes the client to return stubbed responses. By default fake responses are generated and returned. You can specify the response data to return or errors to raise by calling ClientStubs#stub_responses. See ClientStubs for more information.

    Please note When response stubbing is enabled, no HTTP requests are made, and retries are disabled. See Plugins::StubResponses for more details.

  • :validate_params (Boolean) — default: true

    When true, request parameters are validated before sending the request. See Plugins::ParamValidator for more details.

Instance Method Details

#create_budget(options = {}) ⇒ Struct

Creates a budget and, if included, notifications and subscribers.

Only one of BudgetLimit or PlannedBudgetLimits can be present in the syntax at one time. Use the syntax that matches your case. The Request Syntax section shows the BudgetLimit syntax. For PlannedBudgetLimits, see the Examples section.

Examples:

Request syntax with placeholder values


resp = client.create_budget({
  account_id: "AccountId", # required
  budget: { # required
    budget_name: "BudgetName", # required
    budget_limit: {
      amount: "NumericValue", # required
      unit: "UnitValue", # required
    },
    planned_budget_limits: {
      "GenericString" => {
        amount: "NumericValue", # required
        unit: "UnitValue", # required
      },
    },
    cost_filters: {
      "GenericString" => ["GenericString"],
    },
    cost_types: {
      include_tax: false,
      include_subscription: false,
      use_blended: false,
      include_refund: false,
      include_credit: false,
      include_upfront: false,
      include_recurring: false,
      include_other_subscription: false,
      include_support: false,
      include_discount: false,
      use_amortized: false,
    },
    time_unit: "DAILY", # required, accepts DAILY, MONTHLY, QUARTERLY, ANNUALLY
    time_period: {
      start: Time.now,
      end: Time.now,
    },
    calculated_spend: {
      actual_spend: { # required
        amount: "NumericValue", # required
        unit: "UnitValue", # required
      },
      forecasted_spend: {
        amount: "NumericValue", # required
        unit: "UnitValue", # required
      },
    },
    budget_type: "USAGE", # required, accepts USAGE, COST, RI_UTILIZATION, RI_COVERAGE, SAVINGS_PLANS_UTILIZATION, SAVINGS_PLANS_COVERAGE
    last_updated_time: Time.now,
  },
  notifications_with_subscribers: [
    {
      notification: { # required
        notification_type: "ACTUAL", # required, accepts ACTUAL, FORECASTED
        comparison_operator: "GREATER_THAN", # required, accepts GREATER_THAN, LESS_THAN, EQUAL_TO
        threshold: 1.0, # required
        threshold_type: "PERCENTAGE", # accepts PERCENTAGE, ABSOLUTE_VALUE
        notification_state: "OK", # accepts OK, ALARM
      },
      subscribers: [ # required
        {
          subscription_type: "SNS", # required, accepts SNS, EMAIL
          address: "SubscriberAddress", # required
        },
      ],
    },
  ],
})

Options Hash (options):

  • :account_id (required, String)

    The accountId that is associated with the budget.

  • :budget (required, Types::Budget)

    The budget object that you want to create.

  • :notifications_with_subscribers (Array<Types::NotificationWithSubscribers>)

    A notification that you want to associate with a budget. A budget can have up to five notifications, and each notification can have one SNS subscriber and up to 10 email subscribers. If you include notifications and subscribers in your CreateBudget call, AWS creates the notifications and subscribers for you.

Returns:

  • (Struct)

    Returns an empty response.

#create_budget_action(options = {}) ⇒ Types::CreateBudgetActionResponse

Creates a budget action.

Examples:

Request syntax with placeholder values


resp = client.create_budget_action({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
  notification_type: "ACTUAL", # required, accepts ACTUAL, FORECASTED
  action_type: "APPLY_IAM_POLICY", # required, accepts APPLY_IAM_POLICY, APPLY_SCP_POLICY, RUN_SSM_DOCUMENTS
  action_threshold: { # required
    action_threshold_value: 1.0, # required
    action_threshold_type: "PERCENTAGE", # required, accepts PERCENTAGE, ABSOLUTE_VALUE
  },
  definition: { # required
    iam_action_definition: {
      policy_arn: "PolicyArn", # required
      roles: ["Role"],
      groups: ["Group"],
      users: ["User"],
    },
    scp_action_definition: {
      policy_id: "PolicyId", # required
      target_ids: ["TargetId"], # required
    },
    ssm_action_definition: {
      action_sub_type: "STOP_EC2_INSTANCES", # required, accepts STOP_EC2_INSTANCES, STOP_RDS_INSTANCES
      region: "Region", # required
      instance_ids: ["InstanceId"], # required
    },
  },
  execution_role_arn: "RoleArn", # required
  approval_model: "AUTOMATIC", # required, accepts AUTOMATIC, MANUAL
  subscribers: [ # required
    {
      subscription_type: "SNS", # required, accepts SNS, EMAIL
      address: "SubscriberAddress", # required
    },
  ],
})

Response structure


resp. #=> String
resp.budget_name #=> String
resp.action_id #=> String

Options Hash (options):

  • :account_id (required, String)

    The account ID of the user. It should be a 12-digit number.

  • :budget_name (required, String)

    A string that represents the budget name. The ":" and "\" characters aren't allowed.

  • :notification_type (required, String)

    The type of a notification. It must be ACTUAL or FORECASTED.

  • :action_type (required, String)

    The type of action. This defines the type of tasks that can be carried out by this action. This field also determines the format for definition.

  • :action_threshold (required, Types::ActionThreshold)

    The trigger threshold of the action.

  • :definition (required, Types::Definition)

    Specifies all of the type-specific parameters.

  • :execution_role_arn (required, String)

    The role passed for action execution and reversion. Roles and actions must be in the same account.

  • :approval_model (required, String)

    This specifies if the action needs manual or automatic approval.

  • :subscribers (required, Array<Types::Subscriber>)

    A list of subscribers.

Returns:

#create_notification(options = {}) ⇒ Struct

Creates a notification. You must create the budget before you create the associated notification.

Examples:

Request syntax with placeholder values


resp = client.create_notification({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
  notification: { # required
    notification_type: "ACTUAL", # required, accepts ACTUAL, FORECASTED
    comparison_operator: "GREATER_THAN", # required, accepts GREATER_THAN, LESS_THAN, EQUAL_TO
    threshold: 1.0, # required
    threshold_type: "PERCENTAGE", # accepts PERCENTAGE, ABSOLUTE_VALUE
    notification_state: "OK", # accepts OK, ALARM
  },
  subscribers: [ # required
    {
      subscription_type: "SNS", # required, accepts SNS, EMAIL
      address: "SubscriberAddress", # required
    },
  ],
})

Options Hash (options):

  • :account_id (required, String)

    The accountId that is associated with the budget that you want to create a notification for.

  • :budget_name (required, String)

    The name of the budget that you want AWS to notify you about. Budget names must be unique within an account.

  • :notification (required, Types::Notification)

    The notification that you want to create.

  • :subscribers (required, Array<Types::Subscriber>)

    A list of subscribers that you want to associate with the notification. Each notification can have one SNS subscriber and up to 10 email subscribers.

Returns:

  • (Struct)

    Returns an empty response.

#create_subscriber(options = {}) ⇒ Struct

Creates a subscriber. You must create the associated budget and notification before you create the subscriber.

Examples:

Request syntax with placeholder values


resp = client.create_subscriber({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
  notification: { # required
    notification_type: "ACTUAL", # required, accepts ACTUAL, FORECASTED
    comparison_operator: "GREATER_THAN", # required, accepts GREATER_THAN, LESS_THAN, EQUAL_TO
    threshold: 1.0, # required
    threshold_type: "PERCENTAGE", # accepts PERCENTAGE, ABSOLUTE_VALUE
    notification_state: "OK", # accepts OK, ALARM
  },
  subscriber: { # required
    subscription_type: "SNS", # required, accepts SNS, EMAIL
    address: "SubscriberAddress", # required
  },
})

Options Hash (options):

  • :account_id (required, String)

    The accountId that is associated with the budget that you want to create a subscriber for.

  • :budget_name (required, String)

    The name of the budget that you want to subscribe to. Budget names must be unique within an account.

  • :notification (required, Types::Notification)

    The notification that you want to create a subscriber for.

  • :subscriber (required, Types::Subscriber)

    The subscriber that you want to associate with a budget notification.

Returns:

  • (Struct)

    Returns an empty response.

#delete_budget(options = {}) ⇒ Struct

Deletes a budget. You can delete your budget at any time.

Deleting a budget also deletes the notifications and subscribers that are associated with that budget.

Examples:

Request syntax with placeholder values


resp = client.delete_budget({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
})

Options Hash (options):

  • :account_id (required, String)

    The accountId that is associated with the budget that you want to delete.

  • :budget_name (required, String)

    The name of the budget that you want to delete.

Returns:

  • (Struct)

    Returns an empty response.

#delete_budget_action(options = {}) ⇒ Types::DeleteBudgetActionResponse

Deletes a budget action.

Examples:

Request syntax with placeholder values


resp = client.delete_budget_action({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
  action_id: "ActionId", # required
})

Response structure


resp. #=> String
resp.budget_name #=> String
resp.action.action_id #=> String
resp.action.budget_name #=> String
resp.action.notification_type #=> String, one of "ACTUAL", "FORECASTED"
resp.action.action_type #=> String, one of "APPLY_IAM_POLICY", "APPLY_SCP_POLICY", "RUN_SSM_DOCUMENTS"
resp.action.action_threshold.action_threshold_value #=> Float
resp.action.action_threshold.action_threshold_type #=> String, one of "PERCENTAGE", "ABSOLUTE_VALUE"
resp.action.definition.iam_action_definition.policy_arn #=> String
resp.action.definition.iam_action_definition.roles #=> Array
resp.action.definition.iam_action_definition.roles[0] #=> String
resp.action.definition.iam_action_definition.groups #=> Array
resp.action.definition.iam_action_definition.groups[0] #=> String
resp.action.definition.iam_action_definition.users #=> Array
resp.action.definition.iam_action_definition.users[0] #=> String
resp.action.definition.scp_action_definition.policy_id #=> String
resp.action.definition.scp_action_definition.target_ids #=> Array
resp.action.definition.scp_action_definition.target_ids[0] #=> String
resp.action.definition.ssm_action_definition.action_sub_type #=> String, one of "STOP_EC2_INSTANCES", "STOP_RDS_INSTANCES"
resp.action.definition.ssm_action_definition.region #=> String
resp.action.definition.ssm_action_definition.instance_ids #=> Array
resp.action.definition.ssm_action_definition.instance_ids[0] #=> String
resp.action.execution_role_arn #=> String
resp.action.approval_model #=> String, one of "AUTOMATIC", "MANUAL"
resp.action.status #=> String, one of "STANDBY", "PENDING", "EXECUTION_IN_PROGRESS", "EXECUTION_SUCCESS", "EXECUTION_FAILURE", "REVERSE_IN_PROGRESS", "REVERSE_SUCCESS", "REVERSE_FAILURE", "RESET_IN_PROGRESS", "RESET_FAILURE"
resp.action.subscribers #=> Array
resp.action.subscribers[0].subscription_type #=> String, one of "SNS", "EMAIL"
resp.action.subscribers[0].address #=> String

Options Hash (options):

  • :account_id (required, String)

    The account ID of the user. It should be a 12-digit number.

  • :budget_name (required, String)

    A string that represents the budget name. The ":" and "\" characters aren't allowed.

  • :action_id (required, String)

    A system-generated universally unique identifier (UUID) for the action.

Returns:

#delete_notification(options = {}) ⇒ Struct

Deletes a notification.

Deleting a notification also deletes the subscribers that are associated with the notification.

Examples:

Request syntax with placeholder values


resp = client.delete_notification({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
  notification: { # required
    notification_type: "ACTUAL", # required, accepts ACTUAL, FORECASTED
    comparison_operator: "GREATER_THAN", # required, accepts GREATER_THAN, LESS_THAN, EQUAL_TO
    threshold: 1.0, # required
    threshold_type: "PERCENTAGE", # accepts PERCENTAGE, ABSOLUTE_VALUE
    notification_state: "OK", # accepts OK, ALARM
  },
})

Options Hash (options):

  • :account_id (required, String)

    The accountId that is associated with the budget whose notification you want to delete.

  • :budget_name (required, String)

    The name of the budget whose notification you want to delete.

  • :notification (required, Types::Notification)

    The notification that you want to delete.

Returns:

  • (Struct)

    Returns an empty response.

#delete_subscriber(options = {}) ⇒ Struct

Deletes a subscriber.

Deleting the last subscriber to a notification also deletes the notification.

Examples:

Request syntax with placeholder values


resp = client.delete_subscriber({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
  notification: { # required
    notification_type: "ACTUAL", # required, accepts ACTUAL, FORECASTED
    comparison_operator: "GREATER_THAN", # required, accepts GREATER_THAN, LESS_THAN, EQUAL_TO
    threshold: 1.0, # required
    threshold_type: "PERCENTAGE", # accepts PERCENTAGE, ABSOLUTE_VALUE
    notification_state: "OK", # accepts OK, ALARM
  },
  subscriber: { # required
    subscription_type: "SNS", # required, accepts SNS, EMAIL
    address: "SubscriberAddress", # required
  },
})

Options Hash (options):

  • :account_id (required, String)

    The accountId that is associated with the budget whose subscriber you want to delete.

  • :budget_name (required, String)

    The name of the budget whose subscriber you want to delete.

  • :notification (required, Types::Notification)

    The notification whose subscriber you want to delete.

  • :subscriber (required, Types::Subscriber)

    The subscriber that you want to delete.

Returns:

  • (Struct)

    Returns an empty response.

#describe_budget(options = {}) ⇒ Types::DescribeBudgetResponse

Describes a budget.

The Request Syntax section shows the BudgetLimit syntax. For PlannedBudgetLimits, see the Examples section.

Examples:

Request syntax with placeholder values


resp = client.describe_budget({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
})

Response structure


resp.budget.budget_name #=> String
resp.budget.budget_limit.amount #=> String
resp.budget.budget_limit.unit #=> String
resp.budget.planned_budget_limits #=> Hash
resp.budget.planned_budget_limits["GenericString"].amount #=> String
resp.budget.planned_budget_limits["GenericString"].unit #=> String
resp.budget.cost_filters #=> Hash
resp.budget.cost_filters["GenericString"] #=> Array
resp.budget.cost_filters["GenericString"][0] #=> String
resp.budget.cost_types.include_tax #=> true/false
resp.budget.cost_types.include_subscription #=> true/false
resp.budget.cost_types.use_blended #=> true/false
resp.budget.cost_types.include_refund #=> true/false
resp.budget.cost_types.include_credit #=> true/false
resp.budget.cost_types.include_upfront #=> true/false
resp.budget.cost_types.include_recurring #=> true/false
resp.budget.cost_types.include_other_subscription #=> true/false
resp.budget.cost_types.include_support #=> true/false
resp.budget.cost_types.include_discount #=> true/false
resp.budget.cost_types.use_amortized #=> true/false
resp.budget.time_unit #=> String, one of "DAILY", "MONTHLY", "QUARTERLY", "ANNUALLY"
resp.budget.time_period.start #=> Time
resp.budget.time_period.end #=> Time
resp.budget.calculated_spend.actual_spend.amount #=> String
resp.budget.calculated_spend.actual_spend.unit #=> String
resp.budget.calculated_spend.forecasted_spend.amount #=> String
resp.budget.calculated_spend.forecasted_spend.unit #=> String
resp.budget.budget_type #=> String, one of "USAGE", "COST", "RI_UTILIZATION", "RI_COVERAGE", "SAVINGS_PLANS_UTILIZATION", "SAVINGS_PLANS_COVERAGE"
resp.budget.last_updated_time #=> Time

Options Hash (options):

  • :account_id (required, String)

    The accountId that is associated with the budget that you want a description of.

  • :budget_name (required, String)

    The name of the budget that you want a description of.

Returns:

#describe_budget_action(options = {}) ⇒ Types::DescribeBudgetActionResponse

Describes a budget action detail.

Examples:

Request syntax with placeholder values


resp = client.describe_budget_action({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
  action_id: "ActionId", # required
})

Response structure


resp. #=> String
resp.budget_name #=> String
resp.action.action_id #=> String
resp.action.budget_name #=> String
resp.action.notification_type #=> String, one of "ACTUAL", "FORECASTED"
resp.action.action_type #=> String, one of "APPLY_IAM_POLICY", "APPLY_SCP_POLICY", "RUN_SSM_DOCUMENTS"
resp.action.action_threshold.action_threshold_value #=> Float
resp.action.action_threshold.action_threshold_type #=> String, one of "PERCENTAGE", "ABSOLUTE_VALUE"
resp.action.definition.iam_action_definition.policy_arn #=> String
resp.action.definition.iam_action_definition.roles #=> Array
resp.action.definition.iam_action_definition.roles[0] #=> String
resp.action.definition.iam_action_definition.groups #=> Array
resp.action.definition.iam_action_definition.groups[0] #=> String
resp.action.definition.iam_action_definition.users #=> Array
resp.action.definition.iam_action_definition.users[0] #=> String
resp.action.definition.scp_action_definition.policy_id #=> String
resp.action.definition.scp_action_definition.target_ids #=> Array
resp.action.definition.scp_action_definition.target_ids[0] #=> String
resp.action.definition.ssm_action_definition.action_sub_type #=> String, one of "STOP_EC2_INSTANCES", "STOP_RDS_INSTANCES"
resp.action.definition.ssm_action_definition.region #=> String
resp.action.definition.ssm_action_definition.instance_ids #=> Array
resp.action.definition.ssm_action_definition.instance_ids[0] #=> String
resp.action.execution_role_arn #=> String
resp.action.approval_model #=> String, one of "AUTOMATIC", "MANUAL"
resp.action.status #=> String, one of "STANDBY", "PENDING", "EXECUTION_IN_PROGRESS", "EXECUTION_SUCCESS", "EXECUTION_FAILURE", "REVERSE_IN_PROGRESS", "REVERSE_SUCCESS", "REVERSE_FAILURE", "RESET_IN_PROGRESS", "RESET_FAILURE"
resp.action.subscribers #=> Array
resp.action.subscribers[0].subscription_type #=> String, one of "SNS", "EMAIL"
resp.action.subscribers[0].address #=> String

Options Hash (options):

  • :account_id (required, String)

    The account ID of the user. It should be a 12-digit number.

  • :budget_name (required, String)

    A string that represents the budget name. The ":" and "\" characters aren't allowed.

  • :action_id (required, String)

    A system-generated universally unique identifier (UUID) for the action.

Returns:

#describe_budget_action_histories(options = {}) ⇒ Types::DescribeBudgetActionHistoriesResponse

Describes a budget action history detail.

Examples:

Request syntax with placeholder values


resp = client.describe_budget_action_histories({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
  action_id: "ActionId", # required
  time_period: {
    start: Time.now,
    end: Time.now,
  },
  max_results: 1,
  next_token: "GenericString",
})

Response structure


resp.action_histories #=> Array
resp.action_histories[0].timestamp #=> Time
resp.action_histories[0].status #=> String, one of "STANDBY", "PENDING", "EXECUTION_IN_PROGRESS", "EXECUTION_SUCCESS", "EXECUTION_FAILURE", "REVERSE_IN_PROGRESS", "REVERSE_SUCCESS", "REVERSE_FAILURE", "RESET_IN_PROGRESS", "RESET_FAILURE"
resp.action_histories[0].event_type #=> String, one of "SYSTEM", "CREATE_ACTION", "DELETE_ACTION", "UPDATE_ACTION", "EXECUTE_ACTION"
resp.action_histories[0].action_history_details.message #=> String
resp.action_histories[0].action_history_details.action.action_id #=> String
resp.action_histories[0].action_history_details.action.budget_name #=> String
resp.action_histories[0].action_history_details.action.notification_type #=> String, one of "ACTUAL", "FORECASTED"
resp.action_histories[0].action_history_details.action.action_type #=> String, one of "APPLY_IAM_POLICY", "APPLY_SCP_POLICY", "RUN_SSM_DOCUMENTS"
resp.action_histories[0].action_history_details.action.action_threshold.action_threshold_value #=> Float
resp.action_histories[0].action_history_details.action.action_threshold.action_threshold_type #=> String, one of "PERCENTAGE", "ABSOLUTE_VALUE"
resp.action_histories[0].action_history_details.action.definition.iam_action_definition.policy_arn #=> String
resp.action_histories[0].action_history_details.action.definition.iam_action_definition.roles #=> Array
resp.action_histories[0].action_history_details.action.definition.iam_action_definition.roles[0] #=> String
resp.action_histories[0].action_history_details.action.definition.iam_action_definition.groups #=> Array
resp.action_histories[0].action_history_details.action.definition.iam_action_definition.groups[0] #=> String
resp.action_histories[0].action_history_details.action.definition.iam_action_definition.users #=> Array
resp.action_histories[0].action_history_details.action.definition.iam_action_definition.users[0] #=> String
resp.action_histories[0].action_history_details.action.definition.scp_action_definition.policy_id #=> String
resp.action_histories[0].action_history_details.action.definition.scp_action_definition.target_ids #=> Array
resp.action_histories[0].action_history_details.action.definition.scp_action_definition.target_ids[0] #=> String
resp.action_histories[0].action_history_details.action.definition.ssm_action_definition.action_sub_type #=> String, one of "STOP_EC2_INSTANCES", "STOP_RDS_INSTANCES"
resp.action_histories[0].action_history_details.action.definition.ssm_action_definition.region #=> String
resp.action_histories[0].action_history_details.action.definition.ssm_action_definition.instance_ids #=> Array
resp.action_histories[0].action_history_details.action.definition.ssm_action_definition.instance_ids[0] #=> String
resp.action_histories[0].action_history_details.action.execution_role_arn #=> String
resp.action_histories[0].action_history_details.action.approval_model #=> String, one of "AUTOMATIC", "MANUAL"
resp.action_histories[0].action_history_details.action.status #=> String, one of "STANDBY", "PENDING", "EXECUTION_IN_PROGRESS", "EXECUTION_SUCCESS", "EXECUTION_FAILURE", "REVERSE_IN_PROGRESS", "REVERSE_SUCCESS", "REVERSE_FAILURE", "RESET_IN_PROGRESS", "RESET_FAILURE"
resp.action_histories[0].action_history_details.action.subscribers #=> Array
resp.action_histories[0].action_history_details.action.subscribers[0].subscription_type #=> String, one of "SNS", "EMAIL"
resp.action_histories[0].action_history_details.action.subscribers[0].address #=> String
resp.next_token #=> String

Options Hash (options):

  • :account_id (required, String)

    The account ID of the user. It should be a 12-digit number.

  • :budget_name (required, String)

    A string that represents the budget name. The ":" and "\" characters aren't allowed.

  • :action_id (required, String)

    A system-generated universally unique identifier (UUID) for the action.

  • :time_period (Types::TimePeriod)

    The period of time that is covered by a budget. The period has a start date and an end date. The start date must come before the end date. There are no restrictions on the end date.

  • :max_results (Integer)

    An integer that represents how many entries a paginated response contains. The maximum is 100.

  • :next_token (String)

    A generic string.

Returns:

#describe_budget_actions_for_account(options = {}) ⇒ Types::DescribeBudgetActionsForAccountResponse

Describes all of the budget actions for an account.

Examples:

Request syntax with placeholder values


resp = client.({
  account_id: "AccountId", # required
  max_results: 1,
  next_token: "GenericString",
})

Response structure


resp.actions #=> Array
resp.actions[0].action_id #=> String
resp.actions[0].budget_name #=> String
resp.actions[0].notification_type #=> String, one of "ACTUAL", "FORECASTED"
resp.actions[0].action_type #=> String, one of "APPLY_IAM_POLICY", "APPLY_SCP_POLICY", "RUN_SSM_DOCUMENTS"
resp.actions[0].action_threshold.action_threshold_value #=> Float
resp.actions[0].action_threshold.action_threshold_type #=> String, one of "PERCENTAGE", "ABSOLUTE_VALUE"
resp.actions[0].definition.iam_action_definition.policy_arn #=> String
resp.actions[0].definition.iam_action_definition.roles #=> Array
resp.actions[0].definition.iam_action_definition.roles[0] #=> String
resp.actions[0].definition.iam_action_definition.groups #=> Array
resp.actions[0].definition.iam_action_definition.groups[0] #=> String
resp.actions[0].definition.iam_action_definition.users #=> Array
resp.actions[0].definition.iam_action_definition.users[0] #=> String
resp.actions[0].definition.scp_action_definition.policy_id #=> String
resp.actions[0].definition.scp_action_definition.target_ids #=> Array
resp.actions[0].definition.scp_action_definition.target_ids[0] #=> String
resp.actions[0].definition.ssm_action_definition.action_sub_type #=> String, one of "STOP_EC2_INSTANCES", "STOP_RDS_INSTANCES"
resp.actions[0].definition.ssm_action_definition.region #=> String
resp.actions[0].definition.ssm_action_definition.instance_ids #=> Array
resp.actions[0].definition.ssm_action_definition.instance_ids[0] #=> String
resp.actions[0].execution_role_arn #=> String
resp.actions[0].approval_model #=> String, one of "AUTOMATIC", "MANUAL"
resp.actions[0].status #=> String, one of "STANDBY", "PENDING", "EXECUTION_IN_PROGRESS", "EXECUTION_SUCCESS", "EXECUTION_FAILURE", "REVERSE_IN_PROGRESS", "REVERSE_SUCCESS", "REVERSE_FAILURE", "RESET_IN_PROGRESS", "RESET_FAILURE"
resp.actions[0].subscribers #=> Array
resp.actions[0].subscribers[0].subscription_type #=> String, one of "SNS", "EMAIL"
resp.actions[0].subscribers[0].address #=> String
resp.next_token #=> String

Options Hash (options):

  • :account_id (required, String)

    The account ID of the user. It should be a 12-digit number.

  • :max_results (Integer)

    An integer that represents how many entries a paginated response contains. The maximum is 100.

  • :next_token (String)

    A generic string.

Returns:

#describe_budget_actions_for_budget(options = {}) ⇒ Types::DescribeBudgetActionsForBudgetResponse

Describes all of the budget actions for a budget.

Examples:

Request syntax with placeholder values


resp = client.describe_budget_actions_for_budget({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
  max_results: 1,
  next_token: "GenericString",
})

Response structure


resp.actions #=> Array
resp.actions[0].action_id #=> String
resp.actions[0].budget_name #=> String
resp.actions[0].notification_type #=> String, one of "ACTUAL", "FORECASTED"
resp.actions[0].action_type #=> String, one of "APPLY_IAM_POLICY", "APPLY_SCP_POLICY", "RUN_SSM_DOCUMENTS"
resp.actions[0].action_threshold.action_threshold_value #=> Float
resp.actions[0].action_threshold.action_threshold_type #=> String, one of "PERCENTAGE", "ABSOLUTE_VALUE"
resp.actions[0].definition.iam_action_definition.policy_arn #=> String
resp.actions[0].definition.iam_action_definition.roles #=> Array
resp.actions[0].definition.iam_action_definition.roles[0] #=> String
resp.actions[0].definition.iam_action_definition.groups #=> Array
resp.actions[0].definition.iam_action_definition.groups[0] #=> String
resp.actions[0].definition.iam_action_definition.users #=> Array
resp.actions[0].definition.iam_action_definition.users[0] #=> String
resp.actions[0].definition.scp_action_definition.policy_id #=> String
resp.actions[0].definition.scp_action_definition.target_ids #=> Array
resp.actions[0].definition.scp_action_definition.target_ids[0] #=> String
resp.actions[0].definition.ssm_action_definition.action_sub_type #=> String, one of "STOP_EC2_INSTANCES", "STOP_RDS_INSTANCES"
resp.actions[0].definition.ssm_action_definition.region #=> String
resp.actions[0].definition.ssm_action_definition.instance_ids #=> Array
resp.actions[0].definition.ssm_action_definition.instance_ids[0] #=> String
resp.actions[0].execution_role_arn #=> String
resp.actions[0].approval_model #=> String, one of "AUTOMATIC", "MANUAL"
resp.actions[0].status #=> String, one of "STANDBY", "PENDING", "EXECUTION_IN_PROGRESS", "EXECUTION_SUCCESS", "EXECUTION_FAILURE", "REVERSE_IN_PROGRESS", "REVERSE_SUCCESS", "REVERSE_FAILURE", "RESET_IN_PROGRESS", "RESET_FAILURE"
resp.actions[0].subscribers #=> Array
resp.actions[0].subscribers[0].subscription_type #=> String, one of "SNS", "EMAIL"
resp.actions[0].subscribers[0].address #=> String
resp.next_token #=> String

Options Hash (options):

  • :account_id (required, String)

    The account ID of the user. It should be a 12-digit number.

  • :budget_name (required, String)

    A string that represents the budget name. The ":" and "\" characters aren't allowed.

  • :max_results (Integer)

    An integer that represents how many entries a paginated response contains. The maximum is 100.

  • :next_token (String)

    A generic string.

Returns:

#describe_budget_performance_history(options = {}) ⇒ Types::DescribeBudgetPerformanceHistoryResponse

Describes the history for DAILY, MONTHLY, and QUARTERLY budgets. Budget history isn't available for ANNUAL budgets.

Examples:

Request syntax with placeholder values


resp = client.describe_budget_performance_history({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
  time_period: {
    start: Time.now,
    end: Time.now,
  },
  max_results: 1,
  next_token: "GenericString",
})

Response structure


resp.budget_performance_history.budget_name #=> String
resp.budget_performance_history.budget_type #=> String, one of "USAGE", "COST", "RI_UTILIZATION", "RI_COVERAGE", "SAVINGS_PLANS_UTILIZATION", "SAVINGS_PLANS_COVERAGE"
resp.budget_performance_history.cost_filters #=> Hash
resp.budget_performance_history.cost_filters["GenericString"] #=> Array
resp.budget_performance_history.cost_filters["GenericString"][0] #=> String
resp.budget_performance_history.cost_types.include_tax #=> true/false
resp.budget_performance_history.cost_types.include_subscription #=> true/false
resp.budget_performance_history.cost_types.use_blended #=> true/false
resp.budget_performance_history.cost_types.include_refund #=> true/false
resp.budget_performance_history.cost_types.include_credit #=> true/false
resp.budget_performance_history.cost_types.include_upfront #=> true/false
resp.budget_performance_history.cost_types.include_recurring #=> true/false
resp.budget_performance_history.cost_types.include_other_subscription #=> true/false
resp.budget_performance_history.cost_types.include_support #=> true/false
resp.budget_performance_history.cost_types.include_discount #=> true/false
resp.budget_performance_history.cost_types.use_amortized #=> true/false
resp.budget_performance_history.time_unit #=> String, one of "DAILY", "MONTHLY", "QUARTERLY", "ANNUALLY"
resp.budget_performance_history.budgeted_and_actual_amounts_list #=> Array
resp.budget_performance_history.budgeted_and_actual_amounts_list[0].budgeted_amount.amount #=> String
resp.budget_performance_history.budgeted_and_actual_amounts_list[0].budgeted_amount.unit #=> String
resp.budget_performance_history.budgeted_and_actual_amounts_list[0].actual_amount.amount #=> String
resp.budget_performance_history.budgeted_and_actual_amounts_list[0].actual_amount.unit #=> String
resp.budget_performance_history.budgeted_and_actual_amounts_list[0].time_period.start #=> Time
resp.budget_performance_history.budgeted_and_actual_amounts_list[0].time_period.end #=> Time
resp.next_token #=> String

Options Hash (options):

  • :account_id (required, String)

    The account ID of the user. It should be a 12-digit number.

  • :budget_name (required, String)

    A string that represents the budget name. The ":" and "\" characters aren't allowed.

  • :time_period (Types::TimePeriod)

    Retrieves how often the budget went into an ALARM state for the specified time period.

  • :max_results (Integer)

    An integer that represents how many entries a paginated response contains. The maximum is 100.

  • :next_token (String)

    A generic string.

Returns:

#describe_budgets(options = {}) ⇒ Types::DescribeBudgetsResponse

Lists the budgets that are associated with an account.

The Request Syntax section shows the BudgetLimit syntax. For PlannedBudgetLimits, see the Examples section.

Examples:

Request syntax with placeholder values


resp = client.describe_budgets({
  account_id: "AccountId", # required
  max_results: 1,
  next_token: "GenericString",
})

Response structure


resp.budgets #=> Array
resp.budgets[0].budget_name #=> String
resp.budgets[0].budget_limit.amount #=> String
resp.budgets[0].budget_limit.unit #=> String
resp.budgets[0].planned_budget_limits #=> Hash
resp.budgets[0].planned_budget_limits["GenericString"].amount #=> String
resp.budgets[0].planned_budget_limits["GenericString"].unit #=> String
resp.budgets[0].cost_filters #=> Hash
resp.budgets[0].cost_filters["GenericString"] #=> Array
resp.budgets[0].cost_filters["GenericString"][0] #=> String
resp.budgets[0].cost_types.include_tax #=> true/false
resp.budgets[0].cost_types.include_subscription #=> true/false
resp.budgets[0].cost_types.use_blended #=> true/false
resp.budgets[0].cost_types.include_refund #=> true/false
resp.budgets[0].cost_types.include_credit #=> true/false
resp.budgets[0].cost_types.include_upfront #=> true/false
resp.budgets[0].cost_types.include_recurring #=> true/false
resp.budgets[0].cost_types.include_other_subscription #=> true/false
resp.budgets[0].cost_types.include_support #=> true/false
resp.budgets[0].cost_types.include_discount #=> true/false
resp.budgets[0].cost_types.use_amortized #=> true/false
resp.budgets[0].time_unit #=> String, one of "DAILY", "MONTHLY", "QUARTERLY", "ANNUALLY"
resp.budgets[0].time_period.start #=> Time
resp.budgets[0].time_period.end #=> Time
resp.budgets[0].calculated_spend.actual_spend.amount #=> String
resp.budgets[0].calculated_spend.actual_spend.unit #=> String
resp.budgets[0].calculated_spend.forecasted_spend.amount #=> String
resp.budgets[0].calculated_spend.forecasted_spend.unit #=> String
resp.budgets[0].budget_type #=> String, one of "USAGE", "COST", "RI_UTILIZATION", "RI_COVERAGE", "SAVINGS_PLANS_UTILIZATION", "SAVINGS_PLANS_COVERAGE"
resp.budgets[0].last_updated_time #=> Time
resp.next_token #=> String

Options Hash (options):

  • :account_id (required, String)

    The accountId that is associated with the budgets that you want descriptions of.

  • :max_results (Integer)

    An optional integer that represents how many entries a paginated response contains. The maximum is 100.

  • :next_token (String)

    The pagination token that you include in your request to indicate the next set of results that you want to retrieve.

Returns:

#describe_notifications_for_budget(options = {}) ⇒ Types::DescribeNotificationsForBudgetResponse

Lists the notifications that are associated with a budget.

Examples:

Request syntax with placeholder values


resp = client.describe_notifications_for_budget({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
  max_results: 1,
  next_token: "GenericString",
})

Response structure


resp.notifications #=> Array
resp.notifications[0].notification_type #=> String, one of "ACTUAL", "FORECASTED"
resp.notifications[0].comparison_operator #=> String, one of "GREATER_THAN", "LESS_THAN", "EQUAL_TO"
resp.notifications[0].threshold #=> Float
resp.notifications[0].threshold_type #=> String, one of "PERCENTAGE", "ABSOLUTE_VALUE"
resp.notifications[0].notification_state #=> String, one of "OK", "ALARM"
resp.next_token #=> String

Options Hash (options):

  • :account_id (required, String)

    The accountId that is associated with the budget whose notifications you want descriptions of.

  • :budget_name (required, String)

    The name of the budget whose notifications you want descriptions of.

  • :max_results (Integer)

    An optional integer that represents how many entries a paginated response contains. The maximum is 100.

  • :next_token (String)

    The pagination token that you include in your request to indicate the next set of results that you want to retrieve.

Returns:

#describe_subscribers_for_notification(options = {}) ⇒ Types::DescribeSubscribersForNotificationResponse

Lists the subscribers that are associated with a notification.

Examples:

Request syntax with placeholder values


resp = client.describe_subscribers_for_notification({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
  notification: { # required
    notification_type: "ACTUAL", # required, accepts ACTUAL, FORECASTED
    comparison_operator: "GREATER_THAN", # required, accepts GREATER_THAN, LESS_THAN, EQUAL_TO
    threshold: 1.0, # required
    threshold_type: "PERCENTAGE", # accepts PERCENTAGE, ABSOLUTE_VALUE
    notification_state: "OK", # accepts OK, ALARM
  },
  max_results: 1,
  next_token: "GenericString",
})

Response structure


resp.subscribers #=> Array
resp.subscribers[0].subscription_type #=> String, one of "SNS", "EMAIL"
resp.subscribers[0].address #=> String
resp.next_token #=> String

Options Hash (options):

  • :account_id (required, String)

    The accountId that is associated with the budget whose subscribers you want descriptions of.

  • :budget_name (required, String)

    The name of the budget whose subscribers you want descriptions of.

  • :notification (required, Types::Notification)

    The notification whose subscribers you want to list.

  • :max_results (Integer)

    An optional integer that represents how many entries a paginated response contains. The maximum is 100.

  • :next_token (String)

    The pagination token that you include in your request to indicate the next set of results that you want to retrieve.

Returns:

#execute_budget_action(options = {}) ⇒ Types::ExecuteBudgetActionResponse

Executes a budget action.

Examples:

Request syntax with placeholder values


resp = client.execute_budget_action({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
  action_id: "ActionId", # required
  execution_type: "APPROVE_BUDGET_ACTION", # required, accepts APPROVE_BUDGET_ACTION, RETRY_BUDGET_ACTION, REVERSE_BUDGET_ACTION, RESET_BUDGET_ACTION
})

Response structure


resp. #=> String
resp.budget_name #=> String
resp.action_id #=> String
resp.execution_type #=> String, one of "APPROVE_BUDGET_ACTION", "RETRY_BUDGET_ACTION", "REVERSE_BUDGET_ACTION", "RESET_BUDGET_ACTION"

Options Hash (options):

  • :account_id (required, String)

    The account ID of the user. It should be a 12-digit number.

  • :budget_name (required, String)

    A string that represents the budget name. The ":" and "\" characters aren't allowed.

  • :action_id (required, String)

    A system-generated universally unique identifier (UUID) for the action.

  • :execution_type (required, String)

    The type of execution.

Returns:

#update_budget(options = {}) ⇒ Struct

Updates a budget. You can change every part of a budget except for the budgetName and the calculatedSpend. When you modify a budget, the calculatedSpend drops to zero until AWS has new usage data to use for forecasting.

Only one of BudgetLimit or PlannedBudgetLimits can be present in the syntax at one time. Use the syntax that matches your case. The Request Syntax section shows the BudgetLimit syntax. For PlannedBudgetLimits, see the Examples section.

Examples:

Request syntax with placeholder values


resp = client.update_budget({
  account_id: "AccountId", # required
  new_budget: { # required
    budget_name: "BudgetName", # required
    budget_limit: {
      amount: "NumericValue", # required
      unit: "UnitValue", # required
    },
    planned_budget_limits: {
      "GenericString" => {
        amount: "NumericValue", # required
        unit: "UnitValue", # required
      },
    },
    cost_filters: {
      "GenericString" => ["GenericString"],
    },
    cost_types: {
      include_tax: false,
      include_subscription: false,
      use_blended: false,
      include_refund: false,
      include_credit: false,
      include_upfront: false,
      include_recurring: false,
      include_other_subscription: false,
      include_support: false,
      include_discount: false,
      use_amortized: false,
    },
    time_unit: "DAILY", # required, accepts DAILY, MONTHLY, QUARTERLY, ANNUALLY
    time_period: {
      start: Time.now,
      end: Time.now,
    },
    calculated_spend: {
      actual_spend: { # required
        amount: "NumericValue", # required
        unit: "UnitValue", # required
      },
      forecasted_spend: {
        amount: "NumericValue", # required
        unit: "UnitValue", # required
      },
    },
    budget_type: "USAGE", # required, accepts USAGE, COST, RI_UTILIZATION, RI_COVERAGE, SAVINGS_PLANS_UTILIZATION, SAVINGS_PLANS_COVERAGE
    last_updated_time: Time.now,
  },
})

Options Hash (options):

  • :account_id (required, String)

    The accountId that is associated with the budget that you want to update.

  • :new_budget (required, Types::Budget)

    The budget that you want to update your budget to.

Returns:

  • (Struct)

    Returns an empty response.

#update_budget_action(options = {}) ⇒ Types::UpdateBudgetActionResponse

Updates a budget action.

Examples:

Request syntax with placeholder values


resp = client.update_budget_action({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
  action_id: "ActionId", # required
  notification_type: "ACTUAL", # accepts ACTUAL, FORECASTED
  action_threshold: {
    action_threshold_value: 1.0, # required
    action_threshold_type: "PERCENTAGE", # required, accepts PERCENTAGE, ABSOLUTE_VALUE
  },
  definition: {
    iam_action_definition: {
      policy_arn: "PolicyArn", # required
      roles: ["Role"],
      groups: ["Group"],
      users: ["User"],
    },
    scp_action_definition: {
      policy_id: "PolicyId", # required
      target_ids: ["TargetId"], # required
    },
    ssm_action_definition: {
      action_sub_type: "STOP_EC2_INSTANCES", # required, accepts STOP_EC2_INSTANCES, STOP_RDS_INSTANCES
      region: "Region", # required
      instance_ids: ["InstanceId"], # required
    },
  },
  execution_role_arn: "RoleArn",
  approval_model: "AUTOMATIC", # accepts AUTOMATIC, MANUAL
  subscribers: [
    {
      subscription_type: "SNS", # required, accepts SNS, EMAIL
      address: "SubscriberAddress", # required
    },
  ],
})

Response structure


resp. #=> String
resp.budget_name #=> String
resp.old_action.action_id #=> String
resp.old_action.budget_name #=> String
resp.old_action.notification_type #=> String, one of "ACTUAL", "FORECASTED"
resp.old_action.action_type #=> String, one of "APPLY_IAM_POLICY", "APPLY_SCP_POLICY", "RUN_SSM_DOCUMENTS"
resp.old_action.action_threshold.action_threshold_value #=> Float
resp.old_action.action_threshold.action_threshold_type #=> String, one of "PERCENTAGE", "ABSOLUTE_VALUE"
resp.old_action.definition.iam_action_definition.policy_arn #=> String
resp.old_action.definition.iam_action_definition.roles #=> Array
resp.old_action.definition.iam_action_definition.roles[0] #=> String
resp.old_action.definition.iam_action_definition.groups #=> Array
resp.old_action.definition.iam_action_definition.groups[0] #=> String
resp.old_action.definition.iam_action_definition.users #=> Array
resp.old_action.definition.iam_action_definition.users[0] #=> String
resp.old_action.definition.scp_action_definition.policy_id #=> String
resp.old_action.definition.scp_action_definition.target_ids #=> Array
resp.old_action.definition.scp_action_definition.target_ids[0] #=> String
resp.old_action.definition.ssm_action_definition.action_sub_type #=> String, one of "STOP_EC2_INSTANCES", "STOP_RDS_INSTANCES"
resp.old_action.definition.ssm_action_definition.region #=> String
resp.old_action.definition.ssm_action_definition.instance_ids #=> Array
resp.old_action.definition.ssm_action_definition.instance_ids[0] #=> String
resp.old_action.execution_role_arn #=> String
resp.old_action.approval_model #=> String, one of "AUTOMATIC", "MANUAL"
resp.old_action.status #=> String, one of "STANDBY", "PENDING", "EXECUTION_IN_PROGRESS", "EXECUTION_SUCCESS", "EXECUTION_FAILURE", "REVERSE_IN_PROGRESS", "REVERSE_SUCCESS", "REVERSE_FAILURE", "RESET_IN_PROGRESS", "RESET_FAILURE"
resp.old_action.subscribers #=> Array
resp.old_action.subscribers[0].subscription_type #=> String, one of "SNS", "EMAIL"
resp.old_action.subscribers[0].address #=> String
resp.new_action.action_id #=> String
resp.new_action.budget_name #=> String
resp.new_action.notification_type #=> String, one of "ACTUAL", "FORECASTED"
resp.new_action.action_type #=> String, one of "APPLY_IAM_POLICY", "APPLY_SCP_POLICY", "RUN_SSM_DOCUMENTS"
resp.new_action.action_threshold.action_threshold_value #=> Float
resp.new_action.action_threshold.action_threshold_type #=> String, one of "PERCENTAGE", "ABSOLUTE_VALUE"
resp.new_action.definition.iam_action_definition.policy_arn #=> String
resp.new_action.definition.iam_action_definition.roles #=> Array
resp.new_action.definition.iam_action_definition.roles[0] #=> String
resp.new_action.definition.iam_action_definition.groups #=> Array
resp.new_action.definition.iam_action_definition.groups[0] #=> String
resp.new_action.definition.iam_action_definition.users #=> Array
resp.new_action.definition.iam_action_definition.users[0] #=> String
resp.new_action.definition.scp_action_definition.policy_id #=> String
resp.new_action.definition.scp_action_definition.target_ids #=> Array
resp.new_action.definition.scp_action_definition.target_ids[0] #=> String
resp.new_action.definition.ssm_action_definition.action_sub_type #=> String, one of "STOP_EC2_INSTANCES", "STOP_RDS_INSTANCES"
resp.new_action.definition.ssm_action_definition.region #=> String
resp.new_action.definition.ssm_action_definition.instance_ids #=> Array
resp.new_action.definition.ssm_action_definition.instance_ids[0] #=> String
resp.new_action.execution_role_arn #=> String
resp.new_action.approval_model #=> String, one of "AUTOMATIC", "MANUAL"
resp.new_action.status #=> String, one of "STANDBY", "PENDING", "EXECUTION_IN_PROGRESS", "EXECUTION_SUCCESS", "EXECUTION_FAILURE", "REVERSE_IN_PROGRESS", "REVERSE_SUCCESS", "REVERSE_FAILURE", "RESET_IN_PROGRESS", "RESET_FAILURE"
resp.new_action.subscribers #=> Array
resp.new_action.subscribers[0].subscription_type #=> String, one of "SNS", "EMAIL"
resp.new_action.subscribers[0].address #=> String

Options Hash (options):

  • :account_id (required, String)

    The account ID of the user. It should be a 12-digit number.

  • :budget_name (required, String)

    A string that represents the budget name. The ":" and "\" characters aren't allowed.

  • :action_id (required, String)

    A system-generated universally unique identifier (UUID) for the action.

  • :notification_type (String)

    The type of a notification. It must be ACTUAL or FORECASTED.

  • :action_threshold (Types::ActionThreshold)

    The trigger threshold of the action.

  • :definition (Types::Definition)

    Specifies all of the type-specific parameters.

  • :execution_role_arn (String)

    The role passed for action execution and reversion. Roles and actions must be in the same account.

  • :approval_model (String)

    This specifies if the action needs manual or automatic approval.

  • :subscribers (Array<Types::Subscriber>)

    A list of subscribers.

Returns:

#update_notification(options = {}) ⇒ Struct

Updates a notification.

Examples:

Request syntax with placeholder values


resp = client.update_notification({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
  old_notification: { # required
    notification_type: "ACTUAL", # required, accepts ACTUAL, FORECASTED
    comparison_operator: "GREATER_THAN", # required, accepts GREATER_THAN, LESS_THAN, EQUAL_TO
    threshold: 1.0, # required
    threshold_type: "PERCENTAGE", # accepts PERCENTAGE, ABSOLUTE_VALUE
    notification_state: "OK", # accepts OK, ALARM
  },
  new_notification: { # required
    notification_type: "ACTUAL", # required, accepts ACTUAL, FORECASTED
    comparison_operator: "GREATER_THAN", # required, accepts GREATER_THAN, LESS_THAN, EQUAL_TO
    threshold: 1.0, # required
    threshold_type: "PERCENTAGE", # accepts PERCENTAGE, ABSOLUTE_VALUE
    notification_state: "OK", # accepts OK, ALARM
  },
})

Options Hash (options):

  • :account_id (required, String)

    The accountId that is associated with the budget whose notification you want to update.

  • :budget_name (required, String)

    The name of the budget whose notification you want to update.

  • :old_notification (required, Types::Notification)

    The previous notification that is associated with a budget.

  • :new_notification (required, Types::Notification)

    The updated notification to be associated with a budget.

Returns:

  • (Struct)

    Returns an empty response.

#update_subscriber(options = {}) ⇒ Struct

Updates a subscriber.

Examples:

Request syntax with placeholder values


resp = client.update_subscriber({
  account_id: "AccountId", # required
  budget_name: "BudgetName", # required
  notification: { # required
    notification_type: "ACTUAL", # required, accepts ACTUAL, FORECASTED
    comparison_operator: "GREATER_THAN", # required, accepts GREATER_THAN, LESS_THAN, EQUAL_TO
    threshold: 1.0, # required
    threshold_type: "PERCENTAGE", # accepts PERCENTAGE, ABSOLUTE_VALUE
    notification_state: "OK", # accepts OK, ALARM
  },
  old_subscriber: { # required
    subscription_type: "SNS", # required, accepts SNS, EMAIL
    address: "SubscriberAddress", # required
  },
  new_subscriber: { # required
    subscription_type: "SNS", # required, accepts SNS, EMAIL
    address: "SubscriberAddress", # required
  },
})

Options Hash (options):

  • :account_id (required, String)

    The accountId that is associated with the budget whose subscriber you want to update.

  • :budget_name (required, String)

    The name of the budget whose subscriber you want to update.

  • :notification (required, Types::Notification)

    The notification whose subscriber you want to update.

  • :old_subscriber (required, Types::Subscriber)

    The previous subscriber that is associated with a budget notification.

  • :new_subscriber (required, Types::Subscriber)

    The updated subscriber that is associated with a budget notification.

Returns:

  • (Struct)

    Returns an empty response.

#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean

Waiters polls an API operation until a resource enters a desired state.

Basic Usage

Waiters will poll until they are succesful, they fail by entering a terminal state, or until a maximum number of attempts are made.

# polls in a loop, sleeping between attempts client.waiter_until(waiter_name, params)

Configuration

You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You configure waiters by passing a block to #wait_until:

# poll for ~25 seconds
client.wait_until(...) do |w|
  w.max_attempts = 5
  w.delay = 5
end

Callbacks

You can be notified before each polling attempt and before each delay. If you throw :success or :failure from these callbacks, it will terminate the waiter.

started_at = Time.now
client.wait_until(...) do |w|

  # disable max attempts
  w.max_attempts = nil

  # poll for 1 hour, instead of a number of attempts
  w.before_wait do |attempts, response|
    throw :failure if Time.now - started_at > 3600
  end

end

Handling Errors

When a waiter is successful, it returns true. When a waiter fails, it raises an error. All errors raised extend from Waiters::Errors::WaiterFailed.

begin
  client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
  # resource did not enter the desired state in time
end

Parameters:

  • waiter_name (Symbol)

    The name of the waiter. See #waiter_names for a full list of supported waiters.

  • params (Hash) (defaults to: {})

    Additional request parameters. See the #waiter_names for a list of supported waiters and what request they call. The called request determines the list of accepted parameters.

Yield Parameters:

Returns:

  • (Boolean)

    Returns true if the waiter was successful.

Raises:

  • (Errors::FailureStateError)

    Raised when the waiter terminates because the waiter has entered a state that it will not transition out of, preventing success.

  • (Errors::TooManyAttemptsError)

    Raised when the configured maximum number of attempts have been made, and the waiter is not yet successful.

  • (Errors::UnexpectedError)

    Raised when an error is encounted while polling for a resource that is not expected.

  • (Errors::NoSuchWaiterError)

    Raised when you request to wait for an unknown state.

#waiter_namesArray<Symbol>

Returns the list of supported waiters. The following table lists the supported waiters and the client method they call:

Waiter NameClient MethodDefault Delay:Default Max Attempts:

Returns:

  • (Array<Symbol>)

    the list of supported waiters.