Budget

Budget configuration for a billing account.

To get more information about Budget, see:

Create a Budget Resource

new Budget(name: string, args: BudgetArgs, opts?: CustomResourceOptions);
def Budget(resource_name, opts=None, all_updates_rule=None, amount=None, billing_account=None, budget_filter=None, display_name=None, threshold_rules=None, __props__=None);
func NewBudget(ctx *Context, name string, args BudgetArgs, opts ...ResourceOption) (*Budget, error)
public Budget(string name, BudgetArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args BudgetArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args BudgetArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args BudgetArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Budget Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Budget resource accepts the following input properties:

Amount BudgetAmountArgs

The budgeted amount for each usage period. Structure is documented below.

BillingAccount string

ID of the billing account to set a budget on.

ThresholdRules List<BudgetThresholdRuleArgs>

Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget. Structure is documented below.

AllUpdatesRule BudgetAllUpdatesRuleArgs

Defines notifications that are sent on every update to the billing account’s spend, regardless of the thresholds defined using threshold rules. Structure is documented below.

BudgetFilter BudgetBudgetFilterArgs

Filters that define which resources are used to compute the actual spend against the budget. Structure is documented below.

DisplayName string

User data for display name in UI. Must be <= 60 chars.

Amount BudgetAmount

The budgeted amount for each usage period. Structure is documented below.

BillingAccount string

ID of the billing account to set a budget on.

ThresholdRules []BudgetThresholdRule

Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget. Structure is documented below.

AllUpdatesRule BudgetAllUpdatesRule

Defines notifications that are sent on every update to the billing account’s spend, regardless of the thresholds defined using threshold rules. Structure is documented below.

BudgetFilter BudgetBudgetFilter

Filters that define which resources are used to compute the actual spend against the budget. Structure is documented below.

DisplayName string

User data for display name in UI. Must be <= 60 chars.

amount BudgetAmount

The budgeted amount for each usage period. Structure is documented below.

billingAccount string

ID of the billing account to set a budget on.

thresholdRules BudgetThresholdRule[]

Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget. Structure is documented below.

allUpdatesRule BudgetAllUpdatesRule

Defines notifications that are sent on every update to the billing account’s spend, regardless of the thresholds defined using threshold rules. Structure is documented below.

budgetFilter BudgetBudgetFilter

Filters that define which resources are used to compute the actual spend against the budget. Structure is documented below.

displayName string

User data for display name in UI. Must be <= 60 chars.

amount Dict[BudgetAmount]

The budgeted amount for each usage period. Structure is documented below.

billing_account str

ID of the billing account to set a budget on.

threshold_rules List[BudgetThresholdRule]

Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget. Structure is documented below.

all_updates_rule Dict[BudgetAllUpdatesRule]

Defines notifications that are sent on every update to the billing account’s spend, regardless of the thresholds defined using threshold rules. Structure is documented below.

budget_filter Dict[BudgetBudgetFilter]

Filters that define which resources are used to compute the actual spend against the budget. Structure is documented below.

display_name str

User data for display name in UI. Must be <= 60 chars.

Outputs

All input properties are implicitly available as output properties. Additionally, the Budget resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Name string

Resource name of the budget. The resource name implies the scope of a budget. Values are of the form billingAccounts/{billingAccountId}/budgets/{budgetId}.

Id string
The provider-assigned unique ID for this managed resource.
Name string

Resource name of the budget. The resource name implies the scope of a budget. Values are of the form billingAccounts/{billingAccountId}/budgets/{budgetId}.

id string
The provider-assigned unique ID for this managed resource.
name string

Resource name of the budget. The resource name implies the scope of a budget. Values are of the form billingAccounts/{billingAccountId}/budgets/{budgetId}.

id str
The provider-assigned unique ID for this managed resource.
name str

Resource name of the budget. The resource name implies the scope of a budget. Values are of the form billingAccounts/{billingAccountId}/budgets/{budgetId}.

Look up an Existing Budget Resource

Get an existing Budget resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: BudgetState, opts?: CustomResourceOptions): Budget
static get(resource_name, id, opts=None, all_updates_rule=None, amount=None, billing_account=None, budget_filter=None, display_name=None, name=None, threshold_rules=None, __props__=None);
func GetBudget(ctx *Context, name string, id IDInput, state *BudgetState, opts ...ResourceOption) (*Budget, error)
public static Budget Get(string name, Input<string> id, BudgetState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

AllUpdatesRule BudgetAllUpdatesRuleArgs

Defines notifications that are sent on every update to the billing account’s spend, regardless of the thresholds defined using threshold rules. Structure is documented below.

Amount BudgetAmountArgs

The budgeted amount for each usage period. Structure is documented below.

BillingAccount string

ID of the billing account to set a budget on.

BudgetFilter BudgetBudgetFilterArgs

Filters that define which resources are used to compute the actual spend against the budget. Structure is documented below.

DisplayName string

User data for display name in UI. Must be <= 60 chars.

Name string

Resource name of the budget. The resource name implies the scope of a budget. Values are of the form billingAccounts/{billingAccountId}/budgets/{budgetId}.

ThresholdRules List<BudgetThresholdRuleArgs>

Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget. Structure is documented below.

AllUpdatesRule BudgetAllUpdatesRule

Defines notifications that are sent on every update to the billing account’s spend, regardless of the thresholds defined using threshold rules. Structure is documented below.

Amount BudgetAmount

The budgeted amount for each usage period. Structure is documented below.

BillingAccount string

ID of the billing account to set a budget on.

BudgetFilter BudgetBudgetFilter

Filters that define which resources are used to compute the actual spend against the budget. Structure is documented below.

DisplayName string

User data for display name in UI. Must be <= 60 chars.

Name string

Resource name of the budget. The resource name implies the scope of a budget. Values are of the form billingAccounts/{billingAccountId}/budgets/{budgetId}.

ThresholdRules []BudgetThresholdRule

Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget. Structure is documented below.

allUpdatesRule BudgetAllUpdatesRule

Defines notifications that are sent on every update to the billing account’s spend, regardless of the thresholds defined using threshold rules. Structure is documented below.

amount BudgetAmount

The budgeted amount for each usage period. Structure is documented below.

billingAccount string

ID of the billing account to set a budget on.

budgetFilter BudgetBudgetFilter

Filters that define which resources are used to compute the actual spend against the budget. Structure is documented below.

displayName string

User data for display name in UI. Must be <= 60 chars.

name string

Resource name of the budget. The resource name implies the scope of a budget. Values are of the form billingAccounts/{billingAccountId}/budgets/{budgetId}.

thresholdRules BudgetThresholdRule[]

Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget. Structure is documented below.

all_updates_rule Dict[BudgetAllUpdatesRule]

Defines notifications that are sent on every update to the billing account’s spend, regardless of the thresholds defined using threshold rules. Structure is documented below.

amount Dict[BudgetAmount]

The budgeted amount for each usage period. Structure is documented below.

billing_account str

ID of the billing account to set a budget on.

budget_filter Dict[BudgetBudgetFilter]

Filters that define which resources are used to compute the actual spend against the budget. Structure is documented below.

display_name str

User data for display name in UI. Must be <= 60 chars.

name str

Resource name of the budget. The resource name implies the scope of a budget. Values are of the form billingAccounts/{billingAccountId}/budgets/{budgetId}.

threshold_rules List[BudgetThresholdRule]

Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget. Structure is documented below.

Supporting Types

BudgetAllUpdatesRule

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

PubsubTopic string

The name of the Cloud Pub/Sub topic where budget related messages will be published, in the form projects/{project_id}/topics/{topic_id}. Updates are sent at regular intervals to the topic.

SchemaVersion string

The schema version of the notification. Only “1.0” is accepted. It represents the JSON schema as defined in https://cloud.google.com/billing/docs/how-to/budgets#notification_format.

PubsubTopic string

The name of the Cloud Pub/Sub topic where budget related messages will be published, in the form projects/{project_id}/topics/{topic_id}. Updates are sent at regular intervals to the topic.

SchemaVersion string

The schema version of the notification. Only “1.0” is accepted. It represents the JSON schema as defined in https://cloud.google.com/billing/docs/how-to/budgets#notification_format.

pubsubTopic string

The name of the Cloud Pub/Sub topic where budget related messages will be published, in the form projects/{project_id}/topics/{topic_id}. Updates are sent at regular intervals to the topic.

schemaVersion string

The schema version of the notification. Only “1.0” is accepted. It represents the JSON schema as defined in https://cloud.google.com/billing/docs/how-to/budgets#notification_format.

pubsubTopic str

The name of the Cloud Pub/Sub topic where budget related messages will be published, in the form projects/{project_id}/topics/{topic_id}. Updates are sent at regular intervals to the topic.

schemaVersion str

The schema version of the notification. Only “1.0” is accepted. It represents the JSON schema as defined in https://cloud.google.com/billing/docs/how-to/budgets#notification_format.

BudgetAmount

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

SpecifiedAmount BudgetAmountSpecifiedAmountArgs

A specified amount to use as the budget. currencyCode is optional. If specified, it must match the currency of the billing account. The currencyCode is provided on output. Structure is documented below.

SpecifiedAmount BudgetAmountSpecifiedAmount

A specified amount to use as the budget. currencyCode is optional. If specified, it must match the currency of the billing account. The currencyCode is provided on output. Structure is documented below.

specifiedAmount BudgetAmountSpecifiedAmount

A specified amount to use as the budget. currencyCode is optional. If specified, it must match the currency of the billing account. The currencyCode is provided on output. Structure is documented below.

specifiedAmount Dict[BudgetAmountSpecifiedAmount]

A specified amount to use as the budget. currencyCode is optional. If specified, it must match the currency of the billing account. The currencyCode is provided on output. Structure is documented below.

BudgetAmountSpecifiedAmount

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

CurrencyCode string

The 3-letter currency code defined in ISO 4217.

Nanos int

Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If units is positive, nanos must be positive or zero. If units is zero, nanos can be positive, zero, or negative. If units is negative, nanos must be negative or zero. For example $-1.75 is represented as units=-1 and nanos=-750,000,000.

Units string

The whole units of the amount. For example if currencyCode is “USD”, then 1 unit is one US dollar.

CurrencyCode string

The 3-letter currency code defined in ISO 4217.

Nanos int

Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If units is positive, nanos must be positive or zero. If units is zero, nanos can be positive, zero, or negative. If units is negative, nanos must be negative or zero. For example $-1.75 is represented as units=-1 and nanos=-750,000,000.

Units string

The whole units of the amount. For example if currencyCode is “USD”, then 1 unit is one US dollar.

currencyCode string

The 3-letter currency code defined in ISO 4217.

nanos number

Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If units is positive, nanos must be positive or zero. If units is zero, nanos can be positive, zero, or negative. If units is negative, nanos must be negative or zero. For example $-1.75 is represented as units=-1 and nanos=-750,000,000.

units string

The whole units of the amount. For example if currencyCode is “USD”, then 1 unit is one US dollar.

currencyCode str

The 3-letter currency code defined in ISO 4217.

nanos float

Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If units is positive, nanos must be positive or zero. If units is zero, nanos can be positive, zero, or negative. If units is negative, nanos must be negative or zero. For example $-1.75 is represented as units=-1 and nanos=-750,000,000.

units str

The whole units of the amount. For example if currencyCode is “USD”, then 1 unit is one US dollar.

BudgetBudgetFilter

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

CreditTypesTreatment string

Specifies how credits should be treated when determining spend for threshold calculations.

Projects List<string>

A set of projects of the form projects/{project_id}, specifying that usage from only this set of projects should be included in the budget. If omitted, the report will include all usage for the billing account, regardless of which project the usage occurred on. Only zero or one project can be specified currently.

Services List<string>

A set of services of the form services/{service_id}, specifying that usage from only this set of services should be included in the budget. If omitted, the report will include usage for all the services. The service names are available through the Catalog API: https://cloud.google.com/billing/v1/how-tos/catalog-api.

CreditTypesTreatment string

Specifies how credits should be treated when determining spend for threshold calculations.

Projects []string

A set of projects of the form projects/{project_id}, specifying that usage from only this set of projects should be included in the budget. If omitted, the report will include all usage for the billing account, regardless of which project the usage occurred on. Only zero or one project can be specified currently.

Services []string

A set of services of the form services/{service_id}, specifying that usage from only this set of services should be included in the budget. If omitted, the report will include usage for all the services. The service names are available through the Catalog API: https://cloud.google.com/billing/v1/how-tos/catalog-api.

creditTypesTreatment string

Specifies how credits should be treated when determining spend for threshold calculations.

projects string[]

A set of projects of the form projects/{project_id}, specifying that usage from only this set of projects should be included in the budget. If omitted, the report will include all usage for the billing account, regardless of which project the usage occurred on. Only zero or one project can be specified currently.

services string[]

A set of services of the form services/{service_id}, specifying that usage from only this set of services should be included in the budget. If omitted, the report will include usage for all the services. The service names are available through the Catalog API: https://cloud.google.com/billing/v1/how-tos/catalog-api.

creditTypesTreatment str

Specifies how credits should be treated when determining spend for threshold calculations.

projects List[str]

A set of projects of the form projects/{project_id}, specifying that usage from only this set of projects should be included in the budget. If omitted, the report will include all usage for the billing account, regardless of which project the usage occurred on. Only zero or one project can be specified currently.

services List[str]

A set of services of the form services/{service_id}, specifying that usage from only this set of services should be included in the budget. If omitted, the report will include usage for all the services. The service names are available through the Catalog API: https://cloud.google.com/billing/v1/how-tos/catalog-api.

BudgetThresholdRule

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

ThresholdPercent double

Send an alert when this threshold is exceeded. This is a 1.0-based percentage, so 0.5 = 50%. Must be >= 0.

SpendBasis string

The type of basis used to determine if spend has passed the threshold.

ThresholdPercent float64

Send an alert when this threshold is exceeded. This is a 1.0-based percentage, so 0.5 = 50%. Must be >= 0.

SpendBasis string

The type of basis used to determine if spend has passed the threshold.

thresholdPercent number

Send an alert when this threshold is exceeded. This is a 1.0-based percentage, so 0.5 = 50%. Must be >= 0.

spendBasis string

The type of basis used to determine if spend has passed the threshold.

thresholdPercent float

Send an alert when this threshold is exceeded. This is a 1.0-based percentage, so 0.5 = 50%. Must be >= 0.

spendBasis str

The type of basis used to determine if spend has passed the threshold.

Package Details

Repository
https://github.com/pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.