We recommend using Azure Native.
Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi
azure.consumption.getBudgetSubscription
Explore with Pulumi AI
Use this data source to access information about an existing Consumption Budget for a specific subscription.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.consumption.getBudgetSubscription({
name: "existing",
subscriptionId: "/subscriptions/00000000-0000-0000-0000-000000000000/",
});
export const id = exampleAzurermConsumptionBudget.id;
import pulumi
import pulumi_azure as azure
example = azure.consumption.get_budget_subscription(name="existing",
subscription_id="/subscriptions/00000000-0000-0000-0000-000000000000/")
pulumi.export("id", example_azurerm_consumption_budget["id"])
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/consumption"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := consumption.LookupBudgetSubscription(ctx, &consumption.LookupBudgetSubscriptionArgs{
Name: "existing",
SubscriptionId: "/subscriptions/00000000-0000-0000-0000-000000000000/",
}, nil)
if err != nil {
return err
}
ctx.Export("id", exampleAzurermConsumptionBudget.Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.Consumption.GetBudgetSubscription.Invoke(new()
{
Name = "existing",
SubscriptionId = "/subscriptions/00000000-0000-0000-0000-000000000000/",
});
return new Dictionary<string, object?>
{
["id"] = exampleAzurermConsumptionBudget.Id,
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.consumption.ConsumptionFunctions;
import com.pulumi.azure.consumption.inputs.GetBudgetSubscriptionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var example = ConsumptionFunctions.getBudgetSubscription(GetBudgetSubscriptionArgs.builder()
.name("existing")
.subscriptionId("/subscriptions/00000000-0000-0000-0000-000000000000/")
.build());
ctx.export("id", exampleAzurermConsumptionBudget.id());
}
}
variables:
example:
fn::invoke:
function: azure:consumption:getBudgetSubscription
arguments:
name: existing
subscriptionId: /subscriptions/00000000-0000-0000-0000-000000000000/
outputs:
id: ${exampleAzurermConsumptionBudget.id}
Using getBudgetSubscription
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getBudgetSubscription(args: GetBudgetSubscriptionArgs, opts?: InvokeOptions): Promise<GetBudgetSubscriptionResult>
function getBudgetSubscriptionOutput(args: GetBudgetSubscriptionOutputArgs, opts?: InvokeOptions): Output<GetBudgetSubscriptionResult>def get_budget_subscription(name: Optional[str] = None,
subscription_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetBudgetSubscriptionResult
def get_budget_subscription_output(name: Optional[pulumi.Input[str]] = None,
subscription_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetBudgetSubscriptionResult]func LookupBudgetSubscription(ctx *Context, args *LookupBudgetSubscriptionArgs, opts ...InvokeOption) (*LookupBudgetSubscriptionResult, error)
func LookupBudgetSubscriptionOutput(ctx *Context, args *LookupBudgetSubscriptionOutputArgs, opts ...InvokeOption) LookupBudgetSubscriptionResultOutput> Note: This function is named LookupBudgetSubscription in the Go SDK.
public static class GetBudgetSubscription
{
public static Task<GetBudgetSubscriptionResult> InvokeAsync(GetBudgetSubscriptionArgs args, InvokeOptions? opts = null)
public static Output<GetBudgetSubscriptionResult> Invoke(GetBudgetSubscriptionInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetBudgetSubscriptionResult> getBudgetSubscription(GetBudgetSubscriptionArgs args, InvokeOptions options)
public static Output<GetBudgetSubscriptionResult> getBudgetSubscription(GetBudgetSubscriptionArgs args, InvokeOptions options)
fn::invoke:
function: azure:consumption/getBudgetSubscription:getBudgetSubscription
arguments:
# arguments dictionaryThe following arguments are supported:
- Name string
- The name of this Consumption Budget.
- Subscription
Id string - The ID of the subscription.
- Name string
- The name of this Consumption Budget.
- Subscription
Id string - The ID of the subscription.
- name String
- The name of this Consumption Budget.
- subscription
Id String - The ID of the subscription.
- name string
- The name of this Consumption Budget.
- subscription
Id string - The ID of the subscription.
- name str
- The name of this Consumption Budget.
- subscription_
id str - The ID of the subscription.
- name String
- The name of this Consumption Budget.
- subscription
Id String - The ID of the subscription.
getBudgetSubscription Result
The following output properties are available:
- Amount double
- The total amount of cost to track with the budget.
- Filters
List<Get
Budget Subscription Filter> - A
filterblock as defined below. - Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- The name of the tag to use for the filter.
- Notifications
List<Get
Budget Subscription Notification> - A
notificationblock as defined below. - Subscription
Id string - Time
Grain string - The time covered by a budget.
- Time
Periods List<GetBudget Subscription Time Period> - A
time_periodblock as defined below.
- Amount float64
- The total amount of cost to track with the budget.
- Filters
[]Get
Budget Subscription Filter - A
filterblock as defined below. - Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- The name of the tag to use for the filter.
- Notifications
[]Get
Budget Subscription Notification - A
notificationblock as defined below. - Subscription
Id string - Time
Grain string - The time covered by a budget.
- Time
Periods []GetBudget Subscription Time Period - A
time_periodblock as defined below.
- amount Double
- The total amount of cost to track with the budget.
- filters
List<Get
Budget Subscription Filter> - A
filterblock as defined below. - id String
- The provider-assigned unique ID for this managed resource.
- name String
- The name of the tag to use for the filter.
- notifications
List<Get
Budget Subscription Notification> - A
notificationblock as defined below. - subscription
Id String - time
Grain String - The time covered by a budget.
- time
Periods List<GetBudget Subscription Time Period> - A
time_periodblock as defined below.
- amount number
- The total amount of cost to track with the budget.
- filters
Get
Budget Subscription Filter[] - A
filterblock as defined below. - id string
- The provider-assigned unique ID for this managed resource.
- name string
- The name of the tag to use for the filter.
- notifications
Get
Budget Subscription Notification[] - A
notificationblock as defined below. - subscription
Id string - time
Grain string - The time covered by a budget.
- time
Periods GetBudget Subscription Time Period[] - A
time_periodblock as defined below.
- amount float
- The total amount of cost to track with the budget.
- filters
Sequence[Get
Budget Subscription Filter] - A
filterblock as defined below. - id str
- The provider-assigned unique ID for this managed resource.
- name str
- The name of the tag to use for the filter.
- notifications
Sequence[Get
Budget Subscription Notification] - A
notificationblock as defined below. - subscription_
id str - time_
grain str - The time covered by a budget.
- time_
periods Sequence[GetBudget Subscription Time Period] - A
time_periodblock as defined below.
- amount Number
- The total amount of cost to track with the budget.
- filters List<Property Map>
- A
filterblock as defined below. - id String
- The provider-assigned unique ID for this managed resource.
- name String
- The name of the tag to use for the filter.
- notifications List<Property Map>
- A
notificationblock as defined below. - subscription
Id String - time
Grain String - The time covered by a budget.
- time
Periods List<Property Map> - A
time_periodblock as defined below.
Supporting Types
GetBudgetSubscriptionFilter
- Dimensions
List<Get
Budget Subscription Filter Dimension> - A
dimensionblock as defined above. - Nots
List<Get
Budget Subscription Filter Not> - A
notblock as defined below. -
List<Get
Budget Subscription Filter Tag> - A
tagblock as defined below.
- Dimensions
[]Get
Budget Subscription Filter Dimension - A
dimensionblock as defined above. - Nots
[]Get
Budget Subscription Filter Not - A
notblock as defined below. -
[]Get
Budget Subscription Filter Tag - A
tagblock as defined below.
- dimensions
List<Get
Budget Subscription Filter Dimension> - A
dimensionblock as defined above. - nots
List<Get
Budget Subscription Filter Not> - A
notblock as defined below. -
List<Get
Budget Subscription Filter Tag> - A
tagblock as defined below.
- dimensions
Get
Budget Subscription Filter Dimension[] - A
dimensionblock as defined above. - nots
Get
Budget Subscription Filter Not[] - A
notblock as defined below. -
Get
Budget Subscription Filter Tag[] - A
tagblock as defined below.
- dimensions
Sequence[Get
Budget Subscription Filter Dimension] - A
dimensionblock as defined above. - nots
Sequence[Get
Budget Subscription Filter Not] - A
notblock as defined below. -
Sequence[Get
Budget Subscription Filter Tag] - A
tagblock as defined below.
- dimensions List<Property Map>
- A
dimensionblock as defined above. - nots List<Property Map>
- A
notblock as defined below. - List<Property Map>
- A
tagblock as defined below.
GetBudgetSubscriptionFilterDimension
GetBudgetSubscriptionFilterNot
- Dimensions
List<Get
Budget Subscription Filter Not Dimension> - A
dimensionblock as defined above. -
List<Get
Budget Subscription Filter Not Tag> - A
tagblock as defined below.
- Dimensions
[]Get
Budget Subscription Filter Not Dimension - A
dimensionblock as defined above. -
[]Get
Budget Subscription Filter Not Tag - A
tagblock as defined below.
- dimensions
List<Get
Budget Subscription Filter Not Dimension> - A
dimensionblock as defined above. -
List<Get
Budget Subscription Filter Not Tag> - A
tagblock as defined below.
- dimensions
Get
Budget Subscription Filter Not Dimension[] - A
dimensionblock as defined above. -
Get
Budget Subscription Filter Not Tag[] - A
tagblock as defined below.
- dimensions
Sequence[Get
Budget Subscription Filter Not Dimension] - A
dimensionblock as defined above. -
Sequence[Get
Budget Subscription Filter Not Tag] - A
tagblock as defined below.
- dimensions List<Property Map>
- A
dimensionblock as defined above. - List<Property Map>
- A
tagblock as defined below.
GetBudgetSubscriptionFilterNotDimension
GetBudgetSubscriptionFilterNotTag
GetBudgetSubscriptionFilterTag
GetBudgetSubscriptionNotification
- Contact
Emails List<string> - A list of email addresses to send the budget notification to when the threshold is exceeded.
- Contact
Groups List<string> - A list of Action Group IDs to send the budget notification to when the threshold is exceeded.
- Contact
Roles List<string> - A list of contact roles to send the budget notification to when the threshold is exceeded.
- Enabled bool
- Whether the notification is enabled.
- Operator string
- The operator to used for comparison.
- Threshold int
- Threshold value associated with the notification.
- Threshold
Type string
- Contact
Emails []string - A list of email addresses to send the budget notification to when the threshold is exceeded.
- Contact
Groups []string - A list of Action Group IDs to send the budget notification to when the threshold is exceeded.
- Contact
Roles []string - A list of contact roles to send the budget notification to when the threshold is exceeded.
- Enabled bool
- Whether the notification is enabled.
- Operator string
- The operator to used for comparison.
- Threshold int
- Threshold value associated with the notification.
- Threshold
Type string
- contact
Emails List<String> - A list of email addresses to send the budget notification to when the threshold is exceeded.
- contact
Groups List<String> - A list of Action Group IDs to send the budget notification to when the threshold is exceeded.
- contact
Roles List<String> - A list of contact roles to send the budget notification to when the threshold is exceeded.
- enabled Boolean
- Whether the notification is enabled.
- operator String
- The operator to used for comparison.
- threshold Integer
- Threshold value associated with the notification.
- threshold
Type String
- contact
Emails string[] - A list of email addresses to send the budget notification to when the threshold is exceeded.
- contact
Groups string[] - A list of Action Group IDs to send the budget notification to when the threshold is exceeded.
- contact
Roles string[] - A list of contact roles to send the budget notification to when the threshold is exceeded.
- enabled boolean
- Whether the notification is enabled.
- operator string
- The operator to used for comparison.
- threshold number
- Threshold value associated with the notification.
- threshold
Type string
- contact_
emails Sequence[str] - A list of email addresses to send the budget notification to when the threshold is exceeded.
- contact_
groups Sequence[str] - A list of Action Group IDs to send the budget notification to when the threshold is exceeded.
- contact_
roles Sequence[str] - A list of contact roles to send the budget notification to when the threshold is exceeded.
- enabled bool
- Whether the notification is enabled.
- operator str
- The operator to used for comparison.
- threshold int
- Threshold value associated with the notification.
- threshold_
type str
- contact
Emails List<String> - A list of email addresses to send the budget notification to when the threshold is exceeded.
- contact
Groups List<String> - A list of Action Group IDs to send the budget notification to when the threshold is exceeded.
- contact
Roles List<String> - A list of contact roles to send the budget notification to when the threshold is exceeded.
- enabled Boolean
- Whether the notification is enabled.
- operator String
- The operator to used for comparison.
- threshold Number
- Threshold value associated with the notification.
- threshold
Type String
GetBudgetSubscriptionTimePeriod
- end_
date str - The end date for the budget.
- start_
date str - The start date for the budget.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.