Budget
Budget configuration for a billing account.
To get more information about Budget, see:
- API documentation
- How-to Guides
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
Budget
Amount Args The budgeted amount for each usage period. Structure is documented below.
- Billing
Account string ID of the billing account to set a budget on.
- Threshold
Rules List<BudgetThreshold Rule Args> Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget. Structure is documented below.
- All
Updates BudgetRule All Updates Rule Args 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 BudgetBudget Filter Args Filters that define which resources are used to compute the actual spend against the budget. Structure is documented below.
- Display
Name string User data for display name in UI. Must be <= 60 chars.
- Amount
Budget
Amount The budgeted amount for each usage period. Structure is documented below.
- Billing
Account string ID of the billing account to set a budget on.
- Threshold
Rules []BudgetThreshold Rule Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget. Structure is documented below.
- All
Updates BudgetRule All Updates Rule 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 BudgetBudget Filter Filters that define which resources are used to compute the actual spend against the budget. Structure is documented below.
- Display
Name string User data for display name in UI. Must be <= 60 chars.
- amount
Budget
Amount The budgeted amount for each usage period. Structure is documented below.
- billing
Account string ID of the billing account to set a budget on.
- threshold
Rules BudgetThreshold Rule[] Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget. Structure is documented below.
- all
Updates BudgetRule All Updates Rule 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 BudgetBudget Filter Filters that define which resources are used to compute the actual spend against the budget. Structure is documented below.
- display
Name string User data for display name in UI. Must be <= 60 chars.
- amount
Dict[Budget
Amount] 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[BudgetThreshold Rule] Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget. Structure is documented below.
- all_
updates_ Dict[Budgetrule All Updates Rule] 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[BudgetBudget Filter] 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:
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): Budgetstatic 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:
- All
Updates BudgetRule All Updates Rule Args 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
Budget
Amount Args The budgeted amount for each usage period. Structure is documented below.
- Billing
Account string ID of the billing account to set a budget on.
- Budget
Filter BudgetBudget Filter Args Filters that define which resources are used to compute the actual spend against the budget. Structure is documented below.
- Display
Name 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}.
- Threshold
Rules List<BudgetThreshold Rule Args> Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget. Structure is documented below.
- All
Updates BudgetRule All Updates Rule 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
Budget
Amount The budgeted amount for each usage period. Structure is documented below.
- Billing
Account string ID of the billing account to set a budget on.
- Budget
Filter BudgetBudget Filter Filters that define which resources are used to compute the actual spend against the budget. Structure is documented below.
- Display
Name 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}.
- Threshold
Rules []BudgetThreshold Rule Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget. Structure is documented below.
- all
Updates BudgetRule All Updates Rule 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
Budget
Amount The budgeted amount for each usage period. Structure is documented below.
- billing
Account string ID of the billing account to set a budget on.
- budget
Filter BudgetBudget Filter Filters that define which resources are used to compute the actual spend against the budget. Structure is documented below.
- display
Name 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}.
- threshold
Rules BudgetThreshold Rule[] Rules that trigger alerts (notifications of thresholds being crossed) when spend exceeds the specified percentages of the budget. Structure is documented below.
- all_
updates_ Dict[Budgetrule All Updates Rule] 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[Budget
Amount] 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[BudgetBudget Filter] 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[BudgetThreshold Rule] 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
- Pubsub
Topic 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.
- Schema
Version 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.
- Pubsub
Topic 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.
- Schema
Version 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.
- pubsub
Topic 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.
- schema
Version 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.
- pubsub
Topic 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.
- schema
Version 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
- Specified
Amount BudgetAmount Specified Amount Args 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.
- Specified
Amount BudgetAmount Specified Amount 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.
- specified
Amount BudgetAmount Specified Amount 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.
- specified
Amount Dict[BudgetAmount Specified Amount] 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
- Currency
Code 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.
- Currency
Code 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.
- currency
Code 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.
- currency
Code 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
- Credit
Types stringTreatment 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.
- Credit
Types stringTreatment 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.
- credit
Types stringTreatment 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.
- credit
Types strTreatment 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
- Threshold
Percent double Send an alert when this threshold is exceeded. This is a 1.0-based percentage, so 0.5 = 50%. Must be >= 0.
- Spend
Basis string The type of basis used to determine if spend has passed the threshold.
- Threshold
Percent float64 Send an alert when this threshold is exceeded. This is a 1.0-based percentage, so 0.5 = 50%. Must be >= 0.
- Spend
Basis string The type of basis used to determine if spend has passed the threshold.
- threshold
Percent number Send an alert when this threshold is exceeded. This is a 1.0-based percentage, so 0.5 = 50%. Must be >= 0.
- spend
Basis string The type of basis used to determine if spend has passed the threshold.
- threshold
Percent float Send an alert when this threshold is exceeded. This is a 1.0-based percentage, so 0.5 = 50%. Must be >= 0.
- spend
Basis 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-betaTerraform Provider.