Skip to content

Data Source: azurermConsumptionBudgetSubscription

Use this data source to access information about an existing Consumption Budget for a specific subscription.

Example Usage

import * as cdktf from "cdktf";
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
new cdktf.TerraformOutput(this, "id", {
  value: "${data.azurerm_consumption_budget.example.id}",
});
new azurerm.dataAzurermConsumptionBudgetSubscription.DataAzurermConsumptionBudgetSubscription(
  this,
  "example",
  {
    name: "existing",
    subscription_id: "/subscriptions/00000000-0000-0000-0000-000000000000/",
  }
);

Arguments Reference

The following arguments are supported:

  • name - (Required) The name of this Consumption Budget.

  • subscriptionId - (Required) The ID of the subscription.

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

  • id - The ID of the Consumption Budget.

  • amount - The total amount of cost to track with the budget.

  • filter - A filter block as defined below.

  • notification - A notification block as defined below.

  • timeGrain - The time covered by a budget.

  • timePeriod - A timePeriod block as defined below.


A dimension block exports the following:

  • name - The name of the column used for the filter.

  • operator - The operator to used for comparison.

  • values - A values block as defined below.


A filter block exports the following:

  • dimension - A dimension block as defined below.

  • not - A not block as defined below.

  • tag - A tag block as defined below.

-> Note: The order of multiple filter entries is not guaranteed to be consistent by the API.


A not block exports the following:

  • dimension - A dimension block as defined above.

  • tag - A tag block as defined below.


A notification block exports the following:

  • contactEmails - A list of email addresses to send the budget notification to when the threshold is exceeded.

  • contactGroups - A list of Action Group IDs to send the budget notification to when the threshold is exceeded.

  • contactRoles - A list of contact roles to send the budget notification to when the threshold is exceeded.

  • enabled - Whether the notification is enabled.

  • operator - The comparison operator for the notification.

  • threshold - Threshold value associated with the notification.

-> Note: The order of multiple notification entries is not guaranteed to be consistent by the API.


A tag block exports the following:

  • name - The name of the tag to use for the filter.

  • operator - The operator to used for comparison.

  • values - A list of values for the tag.


A timePeriod block exports the following:

  • endDate - The end date for the budget.

  • startDate - The start date for the budget.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • read - (Defaults to 5 minutes) Used when retrieving the Consumption Budget.