All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.consumption.BudgetResourceGroup Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 6.10.0-alpha.1731737215
Show newest version
// *** 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.BudgetResourceGroupArgs;
import com.pulumi.azure.consumption.inputs.BudgetResourceGroupState;
import com.pulumi.azure.consumption.outputs.BudgetResourceGroupFilter;
import com.pulumi.azure.consumption.outputs.BudgetResourceGroupNotification;
import com.pulumi.azure.consumption.outputs.BudgetResourceGroupTimePeriod;
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 Resource Group Consumption Budget.
 * 
 * ## 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.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.monitoring.ActionGroup;
 * import com.pulumi.azure.monitoring.ActionGroupArgs;
 * import com.pulumi.azure.consumption.BudgetResourceGroup;
 * import com.pulumi.azure.consumption.BudgetResourceGroupArgs;
 * import com.pulumi.azure.consumption.inputs.BudgetResourceGroupTimePeriodArgs;
 * import com.pulumi.azure.consumption.inputs.BudgetResourceGroupFilterArgs;
 * import com.pulumi.azure.consumption.inputs.BudgetResourceGroupNotificationArgs;
 * 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 ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example")
 *             .location("eastus")
 *             .build());
 * 
 *         var exampleActionGroup = new ActionGroup("exampleActionGroup", ActionGroupArgs.builder()
 *             .name("example")
 *             .resourceGroupName(example.name())
 *             .shortName("example")
 *             .build());
 * 
 *         var exampleBudgetResourceGroup = new BudgetResourceGroup("exampleBudgetResourceGroup", BudgetResourceGroupArgs.builder()
 *             .name("example")
 *             .resourceGroupId(example.id())
 *             .amount(1000)
 *             .timeGrain("Monthly")
 *             .timePeriod(BudgetResourceGroupTimePeriodArgs.builder()
 *                 .startDate("2022-06-01T00:00:00Z")
 *                 .endDate("2022-07-01T00:00:00Z")
 *                 .build())
 *             .filter(BudgetResourceGroupFilterArgs.builder()
 *                 .dimensions(BudgetResourceGroupFilterDimensionArgs.builder()
 *                     .name("ResourceId")
 *                     .values(exampleActionGroup.id())
 *                     .build())
 *                 .tags(BudgetResourceGroupFilterTagArgs.builder()
 *                     .name("foo")
 *                     .values(                    
 *                         "bar",
 *                         "baz")
 *                     .build())
 *                 .build())
 *             .notifications(            
 *                 BudgetResourceGroupNotificationArgs.builder()
 *                     .enabled(true)
 *                     .threshold(90)
 *                     .operator("EqualTo")
 *                     .thresholdType("Forecasted")
 *                     .contactEmails(                    
 *                         "foo}{@literal @}{@code example.com",
 *                         "bar}{@literal @}{@code example.com")
 *                     .contactGroups(exampleActionGroup.id())
 *                     .contactRoles("Owner")
 *                     .build(),
 *                 BudgetResourceGroupNotificationArgs.builder()
 *                     .enabled(false)
 *                     .threshold(100)
 *                     .operator("GreaterThan")
 *                     .contactEmails(                    
 *                         "foo}{@literal @}{@code example.com",
 *                         "bar}{@literal @}{@code example.com")
 *                     .build())
 *             .build());
 * 
 *     }}{@code
 * }}{@code
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Import * * Resource Group Consumption Budgets can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:consumption/budgetResourceGroup:BudgetResourceGroup example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.Consumption/budgets/resourceGroup1 * ``` * */ @ResourceType(type="azure:consumption/budgetResourceGroup:BudgetResourceGroup") public class BudgetResourceGroup 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 Resource Group Consumption Budget * */ @Export(name="etag", refs={String.class}, tree="[0]") private Output etag; /** * @return (Optional) The ETag of the Resource Group Consumption Budget * */ public Output etag() { return this.etag; } /** * A `filter` block as defined below. * */ @Export(name="filter", refs={BudgetResourceGroupFilter.class}, tree="[0]") private Output filter; /** * @return A `filter` block as defined below. * */ public Output> filter() { return Codegen.optional(this.filter); } /** * The name which should be used for this Resource Group Consumption Budget. Changing this forces a new Resource Group Consumption Budget to be created. * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return The name which should be used for this Resource Group Consumption Budget. Changing this forces a new Resource Group Consumption Budget to be created. * */ public Output name() { return this.name; } /** * One or more `notification` blocks as defined below. * */ @Export(name="notifications", refs={List.class,BudgetResourceGroupNotification.class}, tree="[0,1]") private Output> notifications; /** * @return One or more `notification` blocks as defined below. * */ public Output> notifications() { return this.notifications; } /** * The ID of the Resource Group to create the consumption budget for in the form of /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1. Changing this forces a new Resource Group Consumption Budget to be created. * */ @Export(name="resourceGroupId", refs={String.class}, tree="[0]") private Output resourceGroupId; /** * @return The ID of the Resource Group to create the consumption budget for in the form of /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1. Changing this forces a new Resource Group Consumption Budget to be created. * */ public Output resourceGroupId() { return this.resourceGroupId; } /** * 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 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={BudgetResourceGroupTimePeriod.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 BudgetResourceGroup(java.lang.String name) { this(name, BudgetResourceGroupArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public BudgetResourceGroup(java.lang.String name, BudgetResourceGroupArgs 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 BudgetResourceGroup(java.lang.String name, BudgetResourceGroupArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:consumption/budgetResourceGroup:BudgetResourceGroup", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private BudgetResourceGroup(java.lang.String name, Output id, @Nullable BudgetResourceGroupState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:consumption/budgetResourceGroup:BudgetResourceGroup", name, state, makeResourceOptions(options, id), false); } private static BudgetResourceGroupArgs makeArgs(BudgetResourceGroupArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? BudgetResourceGroupArgs.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 BudgetResourceGroup get(java.lang.String name, Output id, @Nullable BudgetResourceGroupState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new BudgetResourceGroup(name, id, state, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy