com.pulumi.azure.consumption.BudgetManagementGroup Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure Show documentation
Show all versions of azure Show documentation
A Pulumi package for creating and managing Microsoft Azure cloud resources, based on the Terraform azurerm provider. We recommend using the [Azure Native provider](https://github.com/pulumi/pulumi-azure-native) to provision Azure infrastructure. Azure Native provides complete coverage of Azure resources and same-day access to new resources and resource updates.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.azure.consumption;
import com.pulumi.azure.Utilities;
import com.pulumi.azure.consumption.BudgetManagementGroupArgs;
import com.pulumi.azure.consumption.inputs.BudgetManagementGroupState;
import com.pulumi.azure.consumption.outputs.BudgetManagementGroupFilter;
import com.pulumi.azure.consumption.outputs.BudgetManagementGroupNotification;
import com.pulumi.azure.consumption.outputs.BudgetManagementGroupTimePeriod;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Double;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Manages a Consumption Budget for a Management Group.
*
* ## Example Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.management.Group;
* import com.pulumi.azure.management.GroupArgs;
* import com.pulumi.azure.core.ResourceGroup;
* import com.pulumi.azure.core.ResourceGroupArgs;
* import com.pulumi.azure.consumption.BudgetManagementGroup;
* import com.pulumi.azure.consumption.BudgetManagementGroupArgs;
* import com.pulumi.azure.consumption.inputs.BudgetManagementGroupTimePeriodArgs;
* import com.pulumi.azure.consumption.inputs.BudgetManagementGroupFilterArgs;
* import com.pulumi.azure.consumption.inputs.BudgetManagementGroupNotificationArgs;
* 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 }{{@code
* public static void main(String[] args) }{{@code
* Pulumi.run(App::stack);
* }}{@code
*
* public static void stack(Context ctx) }{{@code
* var example = new Group("example", GroupArgs.builder()
* .displayName("example")
* .build());
*
* var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
* .name("example")
* .location("eastus")
* .build());
*
* var exampleBudgetManagementGroup = new BudgetManagementGroup("exampleBudgetManagementGroup", BudgetManagementGroupArgs.builder()
* .name("example")
* .managementGroupId(example.id())
* .amount(1000)
* .timeGrain("Monthly")
* .timePeriod(BudgetManagementGroupTimePeriodArgs.builder()
* .startDate("2022-06-01T00:00:00Z")
* .endDate("2022-07-01T00:00:00Z")
* .build())
* .filter(BudgetManagementGroupFilterArgs.builder()
* .dimensions(BudgetManagementGroupFilterDimensionArgs.builder()
* .name("ResourceGroupName")
* .values(exampleResourceGroup.name())
* .build())
* .tags(BudgetManagementGroupFilterTagArgs.builder()
* .name("foo")
* .values(
* "bar",
* "baz")
* .build())
* .build())
* .notifications(
* BudgetManagementGroupNotificationArgs.builder()
* .enabled(true)
* .threshold(90)
* .operator("EqualTo")
* .contactEmails(
* "foo}{@literal @}{@code example.com",
* "bar}{@literal @}{@code example.com")
* .build(),
* BudgetManagementGroupNotificationArgs.builder()
* .enabled(false)
* .threshold(100)
* .operator("GreaterThan")
* .thresholdType("Forecasted")
* .contactEmails(
* "foo}{@literal @}{@code example.com",
* "bar}{@literal @}{@code example.com")
* .build())
* .build());
*
* }}{@code
* }}{@code
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Management Group Consumption Budgets can be imported using the `resource id`, e.g.
*
* ```sh
* $ pulumi import azure:consumption/budgetManagementGroup:BudgetManagementGroup example /providers/Microsoft.Management/managementGroups/00000000-0000-0000-0000-000000000000/providers/Microsoft.Consumption/budgets/budget1
* ```
*
*/
@ResourceType(type="azure:consumption/budgetManagementGroup:BudgetManagementGroup")
public class BudgetManagementGroup extends com.pulumi.resources.CustomResource {
/**
* The total amount of cost to track with the budget.
*
*/
@Export(name="amount", refs={Double.class}, tree="[0]")
private Output amount;
/**
* @return The total amount of cost to track with the budget.
*
*/
public Output amount() {
return this.amount;
}
/**
* (Optional) The ETag of the Management Group Consumption Budget.
*
*/
@Export(name="etag", refs={String.class}, tree="[0]")
private Output etag;
/**
* @return (Optional) The ETag of the Management Group Consumption Budget.
*
*/
public Output etag() {
return this.etag;
}
/**
* A `filter` block as defined below.
*
*/
@Export(name="filter", refs={BudgetManagementGroupFilter.class}, tree="[0]")
private Output* @Nullable */ BudgetManagementGroupFilter> filter;
/**
* @return A `filter` block as defined below.
*
*/
public Output> filter() {
return Codegen.optional(this.filter);
}
/**
* The ID of the Management Group. Changing this forces a new resource to be created.
*
*/
@Export(name="managementGroupId", refs={String.class}, tree="[0]")
private Output managementGroupId;
/**
* @return The ID of the Management Group. Changing this forces a new resource to be created.
*
*/
public Output managementGroupId() {
return this.managementGroupId;
}
/**
* The name which should be used for this Management Group Consumption Budget. Changing this forces a new resource to be created.
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return The name which should be used for this Management Group Consumption Budget. Changing this forces a new resource to be created.
*
*/
public Output name() {
return this.name;
}
/**
* One or more `notification` blocks as defined below.
*
*/
@Export(name="notifications", refs={List.class,BudgetManagementGroupNotification.class}, tree="[0,1]")
private Output> notifications;
/**
* @return One or more `notification` blocks as defined below.
*
*/
public Output> notifications() {
return this.notifications;
}
/**
* The time covered by a budget. Tracking of the amount will be reset based on the time grain. Must be one of `BillingAnnual`, `BillingMonth`, `BillingQuarter`, `Annually`, `Monthly` and `Quarterly`. Defaults to `Monthly`. Changing this forces a new resource to be created.
*
*/
@Export(name="timeGrain", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> timeGrain;
/**
* @return The time covered by a budget. Tracking of the amount will be reset based on the time grain. Must be one of `BillingAnnual`, `BillingMonth`, `BillingQuarter`, `Annually`, `Monthly` and `Quarterly`. Defaults to `Monthly`. Changing this forces a new resource to be created.
*
*/
public Output> timeGrain() {
return Codegen.optional(this.timeGrain);
}
/**
* A `time_period` block as defined below.
*
*/
@Export(name="timePeriod", refs={BudgetManagementGroupTimePeriod.class}, tree="[0]")
private Output timePeriod;
/**
* @return A `time_period` block as defined below.
*
*/
public Output timePeriod() {
return this.timePeriod;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public BudgetManagementGroup(java.lang.String name) {
this(name, BudgetManagementGroupArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public BudgetManagementGroup(java.lang.String name, BudgetManagementGroupArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public BudgetManagementGroup(java.lang.String name, BudgetManagementGroupArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:consumption/budgetManagementGroup:BudgetManagementGroup", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private BudgetManagementGroup(java.lang.String name, Output id, @Nullable BudgetManagementGroupState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:consumption/budgetManagementGroup:BudgetManagementGroup", name, state, makeResourceOptions(options, id), false);
}
private static BudgetManagementGroupArgs makeArgs(BudgetManagementGroupArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? BudgetManagementGroupArgs.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host 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
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static BudgetManagementGroup get(java.lang.String name, Output id, @Nullable BudgetManagementGroupState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new BudgetManagementGroup(name, id, state, options);
}
}