import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages a budgets budget resource. Budgets use the cost visualization 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. For more detailed documentation about each argument, refer to the [AWS official documentation](http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/data-type-budget.html). * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const ec2 = new aws.budgets.Budget("ec2", { * costFilters: [{ * name: "Service", * values: ["Amazon Elastic Compute Cloud - Compute"], * }], * notifications: [{ * comparisonOperator: "GREATER_THAN", * threshold: 100, * thresholdType: "PERCENTAGE", * notificationType: "FORECASTED", * subscriberEmailAddresses: ["test@example.com"], * }], * name: "budget-ec2-monthly", * budgetType: "COST", * limitAmount: "1200", * limitUnit: "USD", * timePeriodEnd: "2087-06-15_00:00", * timePeriodStart: "2017-07-01_00:00", * timeUnit: "MONTHLY", * tags: { * Tag1: "Value1", * Tag2: "Value2", * }, * }); * ``` * * Create a budget for *$100*. * * ```typescript * 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 with planned budget limits. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const cost = new aws.budgets.Budget("cost", {plannedLimits: [ * { * startTime: "2017-07-01_00:00", * amount: "100", * unit: "USD", * }, * { * startTime: "2017-08-01_00:00", * amount: "200", * unit: "USD", * }, * ]}); * ``` * * Create a budget for s3 with a limit of *3 GB* of storage. * * ```typescript * 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", * }); * ``` * * Create a Savings Plan Utilization Budget * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const savingsPlanUtilization = new aws.budgets.Budget("savings_plan_utilization", { * costTypes: { * includeCredit: false, * includeDiscount: false, * includeOtherSubscription: false, * includeRecurring: false, * includeRefund: false, * includeSubscription: true, * includeSupport: false, * includeTax: false, * includeUpfront: false, * useBlended: false, * }, * budgetType: "SAVINGS_PLANS_UTILIZATION", * limitAmount: "100.0", * limitUnit: "PERCENTAGE", * }); * ``` * * Create a RI Utilization Budget * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const riUtilization = new aws.budgets.Budget("ri_utilization", { * costTypes: { * includeCredit: false, * includeDiscount: false, * includeOtherSubscription: false, * includeRecurring: false, * includeRefund: false, * includeSubscription: true, * includeSupport: false, * includeTax: false, * includeUpfront: false, * useBlended: false, * }, * costFilters: [{ * name: "Service", * values: ["Amazon Relational Database Service"], * }], * budgetType: "RI_UTILIZATION", * limitAmount: "100.0", * limitUnit: "PERCENTAGE", * }); * ``` * * Create a cost filter using resource tags * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const cost = new aws.budgets.Budget("cost", {costFilters: [{ * name: "TagKeyValue", * values: [ * "aws:createdBy$Pulumi", * "user:business-unit$human_resources", * ], * }]}); * ``` * * Create a cost filter using resource tags, obtaining the tag value from a variable * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const cost = new aws.budgets.Budget("cost", {costFilters: [{ * name: "TagKeyValue", * values: [`TagKey${"$"}${tagValue}`], * }]}); * ``` * * Create a budget with a simple dimension filter for unblended costs * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const simple = new aws.budgets.Budget("simple", { * filterExpression: { * dimensions: { * key: "SERVICE", * values: ["Amazon Elastic Compute Cloud - Compute"], * }, * }, * name: "budget-ec2-filter", * budgetType: "COST", * limitAmount: "500", * limitUnit: "USD", * timeUnit: "MONTHLY", * metrics: "UnblendedCost", * }); * ``` * * Create a budget with AND filter for blended costs * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const andExample = new aws.budgets.Budget("and_example", { * filterExpression: { * ands: [ * { * dimensions: { * key: "SERVICE", * values: ["Amazon Elastic Compute Cloud - Compute"], * }, * }, * { * tags: { * key: "Environment", * values: ["Production"], * }, * }, * ], * }, * name: "budget-and-filter", * budgetType: "COST", * limitAmount: "1200", * limitUnit: "USD", * timeUnit: "MONTHLY", * metrics: "BlendedCost", * }); * ``` * * Create a budget with OR filter for amortized costs * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const orExample = new aws.budgets.Budget("or_example", { * filterExpression: { * ors: [ * { * dimensions: { * key: "SERVICE", * values: ["Amazon Elastic Compute Cloud - Compute"], * }, * }, * { * dimensions: { * key: "SERVICE", * values: ["Amazon Relational Database Service"], * }, * }, * ], * }, * name: "budget-or-filter", * budgetType: "COST", * limitAmount: "2000", * limitUnit: "USD", * timeUnit: "MONTHLY", * metrics: "AmortizedCost", * }); * ``` * * Create a budget with NOT filter for net unblended costs * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const notExample = new aws.budgets.Budget("not_example", { * filterExpression: { * not: { * dimensions: { * key: "REGION", * values: ["us-west-2"], * }, * }, * }, * name: "budget-not-filter", * budgetType: "COST", * limitAmount: "1000", * limitUnit: "USD", * timeUnit: "MONTHLY", * metrics: "NetUnblendedCost", * }); * ``` * * Create a budget with a compound filter for net amortized costs * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const compoundExample = new aws.budgets.Budget("compound_example", { * filterExpression: { * ors: [ * { * ands: [ * { * dimensions: { * key: "SERVICE", * values: ["Amazon Elastic Compute Cloud - Compute"], * }, * }, * { * tags: { * key: "Environment", * values: ["production"], * }, * }, * { * costCategories: { * key: "Environment", * values: ["production"], * }, * }, * ], * }, * { * not: { * dimensions: { * key: "REGION", * values: ["us-west-2"], * }, * }, * }, * ], * }, * notifications: [{ * comparisonOperator: "GREATER_THAN", * threshold: 100, * thresholdType: "PERCENTAGE", * notificationType: "FORECASTED", * subscriberEmailAddresses: ["test@example.com"], * }], * name: "budget-compound-filter", * budgetType: "COST", * limitAmount: "1500", * limitUnit: "USD", * timeUnit: "MONTHLY", * metrics: "NetAmortizedCost", * }); * ``` * * ## Import * * Using `pulumi import`, import budgets using `AccountID:BudgetName`. For example: * * ```sh * $ pulumi import aws:budgets/budget:Budget myBudget 123456789012:myBudget * ``` */ export declare class Budget extends pulumi.CustomResource { /** * Get an existing Budget resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: BudgetState, opts?: pulumi.CustomResourceOptions): Budget; /** * 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. */ static isInstance(obj: any): obj is Budget; /** * ID of the target account for budget. Uses the current user's account ID by default if omitted. */ readonly accountId: pulumi.Output; /** * ARN of the budget. */ readonly arn: pulumi.Output; /** * Object containing AutoAdjustData which determines the budget amount for an auto-adjusting budget. */ readonly autoAdjustData: pulumi.Output; /** * ARN of the billing view. */ readonly billingViewArn: pulumi.Output; /** * Whether this budget tracks monetary cost or usage. */ readonly budgetType: pulumi.Output; /** * List of CostFilter name/values pair to apply to budget. Conflicts with `filterExpression`. */ readonly costFilters: pulumi.Output; /** * Object containing CostTypes that defines the types of cost included in a budget, such as tax and subscriptions. */ readonly costTypes: pulumi.Output; /** * Object containing Filter Expression to apply to budget. Conflicts with `costFilter` and requires `metrics`. */ readonly filterExpression: pulumi.Output; /** * Amount of cost or usage being measured for a budget. */ readonly limitAmount: pulumi.Output; /** * Unit of measurement used for the budget forecast, actual spend, or budget threshold, such as dollars or GB. See [Spend](http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/data-type-spend.html) documentation. */ readonly limitUnit: pulumi.Output; /** * List containing definition for how the budget data is aggregated. Valid values are `UnblendedCost`, `BlendedCost`, `AmortizedCost`, `NetUnblendedCost`, `NetAmortizedCost`, `UsageQuantity`, `NormalizedUsageAmount`, and `Hours`. Conflicts with `costTypes` and requires `filterExpression`. */ readonly metrics: pulumi.Output; /** * Name of a budget. Unique within accounts. */ readonly name: pulumi.Output; /** * Prefix of the name of a budget. Unique within accounts. */ readonly namePrefix: pulumi.Output; /** * Object containing Budget Notifications. Can be used multiple times to define more than one budget notification. */ readonly notifications: pulumi.Output; /** * Object containing Planned Budget Limits. Can be used multiple times to plan more than one budget limit. See [PlannedBudgetLimits](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_Budget.html#awscostmanagement-Type-budgets_Budget-PlannedBudgetLimits) documentation. */ readonly plannedLimits: pulumi.Output; /** * Map of tags assigned to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. */ readonly tags: pulumi.Output<{ [key: string]: string; } | undefined>; /** * Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. */ readonly tagsAll: pulumi.Output<{ [key: string]: string; }>; /** * End of the time period covered by the budget. There are no restrictions on the end date. Format: `2017-01-01_12:00`. */ readonly timePeriodEnd: pulumi.Output; /** * Start of the time period covered by the budget. If you don't specify a start date, AWS defaults to the start of your chosen time period. The start date must come before the end date. Format: `2017-01-01_12:00`. */ readonly timePeriodStart: pulumi.Output; /** * Length of time until a budget resets the actual and forecasted spend. Valid values: `MONTHLY`, `QUARTERLY`, `ANNUALLY`, and `DAILY`. * * The following arguments are optional: */ readonly timeUnit: pulumi.Output; /** * Create a Budget resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: BudgetArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Budget resources. */ export interface BudgetState { /** * ID of the target account for budget. Uses the current user's account ID by default if omitted. */ accountId?: pulumi.Input; /** * ARN of the budget. */ arn?: pulumi.Input; /** * Object containing AutoAdjustData which determines the budget amount for an auto-adjusting budget. */ autoAdjustData?: pulumi.Input; /** * ARN of the billing view. */ billingViewArn?: pulumi.Input; /** * Whether this budget tracks monetary cost or usage. */ budgetType?: pulumi.Input; /** * List of CostFilter name/values pair to apply to budget. Conflicts with `filterExpression`. */ costFilters?: pulumi.Input[] | undefined>; /** * Object containing CostTypes that defines the types of cost included in a budget, such as tax and subscriptions. */ costTypes?: pulumi.Input; /** * Object containing Filter Expression to apply to budget. Conflicts with `costFilter` and requires `metrics`. */ filterExpression?: pulumi.Input; /** * Amount of cost or usage being measured for a budget. */ limitAmount?: pulumi.Input; /** * Unit of measurement used for the budget forecast, actual spend, or budget threshold, such as dollars or GB. See [Spend](http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/data-type-spend.html) documentation. */ limitUnit?: pulumi.Input; /** * List containing definition for how the budget data is aggregated. Valid values are `UnblendedCost`, `BlendedCost`, `AmortizedCost`, `NetUnblendedCost`, `NetAmortizedCost`, `UsageQuantity`, `NormalizedUsageAmount`, and `Hours`. Conflicts with `costTypes` and requires `filterExpression`. */ metrics?: pulumi.Input; /** * Name of a budget. Unique within accounts. */ name?: pulumi.Input; /** * Prefix of the name of a budget. Unique within accounts. */ namePrefix?: pulumi.Input; /** * Object containing Budget Notifications. Can be used multiple times to define more than one budget notification. */ notifications?: pulumi.Input[] | undefined>; /** * Object containing Planned Budget Limits. Can be used multiple times to plan more than one budget limit. See [PlannedBudgetLimits](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_Budget.html#awscostmanagement-Type-budgets_Budget-PlannedBudgetLimits) documentation. */ plannedLimits?: pulumi.Input[] | undefined>; /** * Map of tags assigned to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. */ tagsAll?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * End of the time period covered by the budget. There are no restrictions on the end date. Format: `2017-01-01_12:00`. */ timePeriodEnd?: pulumi.Input; /** * Start of the time period covered by the budget. If you don't specify a start date, AWS defaults to the start of your chosen time period. The start date must come before the end date. Format: `2017-01-01_12:00`. */ timePeriodStart?: pulumi.Input; /** * Length of time until a budget resets the actual and forecasted spend. Valid values: `MONTHLY`, `QUARTERLY`, `ANNUALLY`, and `DAILY`. * * The following arguments are optional: */ timeUnit?: pulumi.Input; } /** * The set of arguments for constructing a Budget resource. */ export interface BudgetArgs { /** * ID of the target account for budget. Uses the current user's account ID by default if omitted. */ accountId?: pulumi.Input; /** * Object containing AutoAdjustData which determines the budget amount for an auto-adjusting budget. */ autoAdjustData?: pulumi.Input; /** * ARN of the billing view. */ billingViewArn?: pulumi.Input; /** * Whether this budget tracks monetary cost or usage. */ budgetType: pulumi.Input; /** * List of CostFilter name/values pair to apply to budget. Conflicts with `filterExpression`. */ costFilters?: pulumi.Input[] | undefined>; /** * Object containing CostTypes that defines the types of cost included in a budget, such as tax and subscriptions. */ costTypes?: pulumi.Input; /** * Object containing Filter Expression to apply to budget. Conflicts with `costFilter` and requires `metrics`. */ filterExpression?: pulumi.Input; /** * Amount of cost or usage being measured for a budget. */ limitAmount?: pulumi.Input; /** * Unit of measurement used for the budget forecast, actual spend, or budget threshold, such as dollars or GB. See [Spend](http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/data-type-spend.html) documentation. */ limitUnit?: pulumi.Input; /** * List containing definition for how the budget data is aggregated. Valid values are `UnblendedCost`, `BlendedCost`, `AmortizedCost`, `NetUnblendedCost`, `NetAmortizedCost`, `UsageQuantity`, `NormalizedUsageAmount`, and `Hours`. Conflicts with `costTypes` and requires `filterExpression`. */ metrics?: pulumi.Input; /** * Name of a budget. Unique within accounts. */ name?: pulumi.Input; /** * Prefix of the name of a budget. Unique within accounts. */ namePrefix?: pulumi.Input; /** * Object containing Budget Notifications. Can be used multiple times to define more than one budget notification. */ notifications?: pulumi.Input[] | undefined>; /** * Object containing Planned Budget Limits. Can be used multiple times to plan more than one budget limit. See [PlannedBudgetLimits](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_Budget.html#awscostmanagement-Type-budgets_Budget-PlannedBudgetLimits) documentation. */ plannedLimits?: pulumi.Input[] | undefined>; /** * Map of tags assigned to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input; } | undefined>; /** * End of the time period covered by the budget. There are no restrictions on the end date. Format: `2017-01-01_12:00`. */ timePeriodEnd?: pulumi.Input; /** * Start of the time period covered by the budget. If you don't specify a start date, AWS defaults to the start of your chosen time period. The start date must come before the end date. Format: `2017-01-01_12:00`. */ timePeriodStart?: pulumi.Input; /** * Length of time until a budget resets the actual and forecasted spend. Valid values: `MONTHLY`, `QUARTERLY`, `ANNUALLY`, and `DAILY`. * * The following arguments are optional: */ timeUnit: pulumi.Input; } //# sourceMappingURL=budget.d.ts.map