Module budgets

@pulumi/aws > budgets

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-aws repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-aws repo.

class Budget

extends CustomResource

Provides a budgets budget resource. Budgets use the cost visualisation provided by Cost Explorer to show you the status of your budgets, to provide forecasts of your estimated costs, and to track your AWS usage, including your free tier usage.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const ec2 = new aws.budgets.Budget("ec2", {
    budgetType: "COST",
    costFilters: {
        Service: "Amazon Elastic Compute Cloud - Compute",
    },
    limitAmount: "1200",
    limitUnit: "USD",
    notifications: [{
        comparisonOperator: "GREATER_THAN",
        notificationType: "FORECASTED",
        subscriberEmailAddresses: ["test@example.com"],
        threshold: 100,
        thresholdType: "PERCENTAGE",
    }],
    timePeriodEnd: "2087-06-15_00:00",
    timePeriodStart: "2017-07-01_00:00",
    timeUnit: "MONTHLY",
});

Create a budget for $100.

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const cost = new aws.budgets.Budget("cost", {
    // ...
    budgetType: "COST",
    limitAmount: "100",
    limitUnit: "USD",
});

Create a budget for s3 with a limit of 3 GB of storage.

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const s3 = new aws.budgets.Budget("s3", {
    // ...
    budgetType: "USAGE",
    limitAmount: "3",
    limitUnit: "GB",
});

This content is derived from https://github.com/terraform-providers/terraform-provider-aws/blob/master/website/docs/r/budgets_budget.html.markdown.

constructor

new Budget(name: string, args: BudgetArgs, opts?: pulumi.CustomResourceOptions)

Create a Budget resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: BudgetState, opts?: pulumi.CustomResourceOptions): Budget

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

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of Budget. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property accountId

public accountId: pulumi.Output<string>;

The ID of the target account for budget. Will use current user’s accountId by default if omitted.

property budgetType

public budgetType: pulumi.Output<string>;

Whether this budget tracks monetary cost or usage.

property costFilters

public costFilters: pulumi.Output<{[key: string]: any}>;

Map of CostFilters key/value pairs to apply to the budget.

property costTypes

public costTypes: pulumi.Output<{
    includeCredit: undefined | false | true;
    includeDiscount: undefined | false | true;
    includeOtherSubscription: undefined | false | true;
    includeRecurring: undefined | false | true;
    includeRefund: undefined | false | true;
    includeSubscription: undefined | false | true;
    includeSupport: undefined | false | true;
    includeTax: undefined | false | true;
    includeUpfront: undefined | false | true;
    useAmortized: undefined | false | true;
    useBlended: undefined | false | true;
}>;

Object containing CostTypes The types of cost included in a budget, such as tax and subscriptions..

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property limitAmount

public limitAmount: pulumi.Output<string>;

The amount of cost or usage being measured for a budget.

property limitUnit

public limitUnit: pulumi.Output<string>;

The unit of measurement used for the budget forecast, actual spend, or budget threshold, such as dollars or GB. See Spend documentation.

property name

public name: pulumi.Output<string>;

The name of a budget. Unique within accounts.

property namePrefix

public namePrefix: pulumi.Output<string>;

The prefix of the name of a budget. Unique within accounts.

property notifications

public notifications: pulumi.Output<{
    comparisonOperator: string;
    notificationType: string;
    subscriberEmailAddresses: string[];
    subscriberSnsTopicArns: string[];
    threshold: number;
    thresholdType: string;
}[] | undefined>;

Object containing Budget Notifications. Can be used multiple times to define more than one budget notification

property timePeriodEnd

public timePeriodEnd: pulumi.Output<string | undefined>;

The end of the time period covered by the budget. There are no restrictions on the end date. Format: 2017-01-01_12:00.

property timePeriodStart

public timePeriodStart: pulumi.Output<string>;

The start of the time period covered by the budget. The start date must come before the end date. Format: 2017-01-01_12:00.

property timeUnit

public timeUnit: pulumi.Output<string>;

The length of time until a budget resets the actual and forecasted spend. Valid values: MONTHLY, QUARTERLY, ANNUALLY.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

interface BudgetArgs

The set of arguments for constructing a Budget resource.

property accountId

accountId?: pulumi.Input<string>;

The ID of the target account for budget. Will use current user’s accountId by default if omitted.

property budgetType

budgetType: pulumi.Input<string>;

Whether this budget tracks monetary cost or usage.

property costFilters

costFilters?: pulumi.Input<{[key: string]: any}>;

Map of CostFilters key/value pairs to apply to the budget.

property costTypes

costTypes?: pulumi.Input<{
    includeCredit: pulumi.Input<boolean>;
    includeDiscount: pulumi.Input<boolean>;
    includeOtherSubscription: pulumi.Input<boolean>;
    includeRecurring: pulumi.Input<boolean>;
    includeRefund: pulumi.Input<boolean>;
    includeSubscription: pulumi.Input<boolean>;
    includeSupport: pulumi.Input<boolean>;
    includeTax: pulumi.Input<boolean>;
    includeUpfront: pulumi.Input<boolean>;
    useAmortized: pulumi.Input<boolean>;
    useBlended: pulumi.Input<boolean>;
}>;

Object containing CostTypes The types of cost included in a budget, such as tax and subscriptions..

property limitAmount

limitAmount: pulumi.Input<string>;

The amount of cost or usage being measured for a budget.

property limitUnit

limitUnit: pulumi.Input<string>;

The unit of measurement used for the budget forecast, actual spend, or budget threshold, such as dollars or GB. See Spend documentation.

property name

name?: pulumi.Input<string>;

The name of a budget. Unique within accounts.

property namePrefix

namePrefix?: pulumi.Input<string>;

The prefix of the name of a budget. Unique within accounts.

property notifications

notifications?: pulumi.Input<pulumi.Input<{
    comparisonOperator: pulumi.Input<string>;
    notificationType: pulumi.Input<string>;
    subscriberEmailAddresses: pulumi.Input<pulumi.Input<string>[]>;
    subscriberSnsTopicArns: pulumi.Input<pulumi.Input<string>[]>;
    threshold: pulumi.Input<number>;
    thresholdType: pulumi.Input<string>;
}>[]>;

Object containing Budget Notifications. Can be used multiple times to define more than one budget notification

property timePeriodEnd

timePeriodEnd?: pulumi.Input<string>;

The end of the time period covered by the budget. There are no restrictions on the end date. Format: 2017-01-01_12:00.

property timePeriodStart

timePeriodStart: pulumi.Input<string>;

The start of the time period covered by the budget. The start date must come before the end date. Format: 2017-01-01_12:00.

property timeUnit

timeUnit: pulumi.Input<string>;

The length of time until a budget resets the actual and forecasted spend. Valid values: MONTHLY, QUARTERLY, ANNUALLY.

interface BudgetState

Input properties used for looking up and filtering Budget resources.

property accountId

accountId?: pulumi.Input<string>;

The ID of the target account for budget. Will use current user’s accountId by default if omitted.

property budgetType

budgetType?: pulumi.Input<string>;

Whether this budget tracks monetary cost or usage.

property costFilters

costFilters?: pulumi.Input<{[key: string]: any}>;

Map of CostFilters key/value pairs to apply to the budget.

property costTypes

costTypes?: pulumi.Input<{
    includeCredit: pulumi.Input<boolean>;
    includeDiscount: pulumi.Input<boolean>;
    includeOtherSubscription: pulumi.Input<boolean>;
    includeRecurring: pulumi.Input<boolean>;
    includeRefund: pulumi.Input<boolean>;
    includeSubscription: pulumi.Input<boolean>;
    includeSupport: pulumi.Input<boolean>;
    includeTax: pulumi.Input<boolean>;
    includeUpfront: pulumi.Input<boolean>;
    useAmortized: pulumi.Input<boolean>;
    useBlended: pulumi.Input<boolean>;
}>;

Object containing CostTypes The types of cost included in a budget, such as tax and subscriptions..

property limitAmount

limitAmount?: pulumi.Input<string>;

The amount of cost or usage being measured for a budget.

property limitUnit

limitUnit?: pulumi.Input<string>;

The unit of measurement used for the budget forecast, actual spend, or budget threshold, such as dollars or GB. See Spend documentation.

property name

name?: pulumi.Input<string>;

The name of a budget. Unique within accounts.

property namePrefix

namePrefix?: pulumi.Input<string>;

The prefix of the name of a budget. Unique within accounts.

property notifications

notifications?: pulumi.Input<pulumi.Input<{
    comparisonOperator: pulumi.Input<string>;
    notificationType: pulumi.Input<string>;
    subscriberEmailAddresses: pulumi.Input<pulumi.Input<string>[]>;
    subscriberSnsTopicArns: pulumi.Input<pulumi.Input<string>[]>;
    threshold: pulumi.Input<number>;
    thresholdType: pulumi.Input<string>;
}>[]>;

Object containing Budget Notifications. Can be used multiple times to define more than one budget notification

property timePeriodEnd

timePeriodEnd?: pulumi.Input<string>;

The end of the time period covered by the budget. There are no restrictions on the end date. Format: 2017-01-01_12:00.

property timePeriodStart

timePeriodStart?: pulumi.Input<string>;

The start of the time period covered by the budget. The start date must come before the end date. Format: 2017-01-01_12:00.

property timeUnit

timeUnit?: pulumi.Input<string>;

The length of time until a budget resets the actual and forecasted spend. Valid values: MONTHLY, QUARTERLY, ANNUALLY.