
com.pulumi.azurenative.costmanagement.ScheduledActionByScope Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-native Show documentation
Show all versions of azure-native Show documentation
A native Pulumi package for creating and managing Azure resources.
// *** 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.azurenative.costmanagement;
import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.costmanagement.ScheduledActionByScopeArgs;
import com.pulumi.azurenative.costmanagement.outputs.FileDestinationResponse;
import com.pulumi.azurenative.costmanagement.outputs.NotificationPropertiesResponse;
import com.pulumi.azurenative.costmanagement.outputs.SchedulePropertiesResponse;
import com.pulumi.azurenative.costmanagement.outputs.SystemDataResponse;
import com.pulumi.core.Alias;
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.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Scheduled action definition.
* Azure REST API version: 2023-03-01. Prior API version in Azure Native 1.x: 2022-04-01-preview.
*
* Other available API versions: 2023-04-01-preview, 2023-07-01-preview, 2023-08-01, 2023-09-01, 2023-11-01, 2024-08-01.
*
* ## Example Usage
* ### CreateOrUpdateInsightAlertScheduledActionByScope
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.costmanagement.ScheduledActionByScope;
* import com.pulumi.azurenative.costmanagement.ScheduledActionByScopeArgs;
* import com.pulumi.azurenative.costmanagement.inputs.NotificationPropertiesArgs;
* import com.pulumi.azurenative.costmanagement.inputs.SchedulePropertiesArgs;
* 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 scheduledActionByScope = new ScheduledActionByScope("scheduledActionByScope", ScheduledActionByScopeArgs.builder()
* .displayName("Daily anomaly by resource")
* .kind("InsightAlert")
* .name("dailyAnomalyByResource")
* .notification(NotificationPropertiesArgs.builder()
* .subject("Cost anomaly detected in the resource")
* .to(
* "user}{@literal @}{@code gmail.com",
* "team}{@literal @}{@code gmail.com")
* .build())
* .schedule(SchedulePropertiesArgs.builder()
* .endDate("2021-06-19T22:21:51.1287144Z")
* .frequency("Daily")
* .startDate("2020-06-19T22:21:51.1287144Z")
* .build())
* .scope("subscriptions/00000000-0000-0000-0000-000000000000")
* .status("Enabled")
* .viewId("/providers/Microsoft.CostManagement/views/swaggerExample")
* .build());
*
* }}{@code
* }}{@code
*
* }
*
* ### CreateOrUpdateScheduledActionByScope
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.costmanagement.ScheduledActionByScope;
* import com.pulumi.azurenative.costmanagement.ScheduledActionByScopeArgs;
* import com.pulumi.azurenative.costmanagement.inputs.FileDestinationArgs;
* import com.pulumi.azurenative.costmanagement.inputs.NotificationPropertiesArgs;
* import com.pulumi.azurenative.costmanagement.inputs.SchedulePropertiesArgs;
* 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 scheduledActionByScope = new ScheduledActionByScope("scheduledActionByScope", ScheduledActionByScopeArgs.builder()
* .displayName("Monthly Cost By Resource")
* .fileDestination(FileDestinationArgs.builder()
* .fileFormats("Csv")
* .build())
* .kind("Email")
* .name("monthlyCostByResource")
* .notification(NotificationPropertiesArgs.builder()
* .subject("Cost by resource this month")
* .to(
* "user}{@literal @}{@code gmail.com",
* "team}{@literal @}{@code gmail.com")
* .build())
* .schedule(SchedulePropertiesArgs.builder()
* .daysOfWeek("Monday")
* .endDate("2021-06-19T22:21:51.1287144Z")
* .frequency("Monthly")
* .hourOfDay(10)
* .startDate("2020-06-19T22:21:51.1287144Z")
* .weeksOfMonth(
* "First",
* "Third")
* .build())
* .scope("subscriptions/00000000-0000-0000-0000-000000000000")
* .status("Enabled")
* .viewId("/providers/Microsoft.CostManagement/views/swaggerExample")
* .build());
*
* }}{@code
* }}{@code
*
* }
*
*
* ## Import
*
* An existing resource can be imported using its type token, name, and identifier, e.g.
*
* ```sh
* $ pulumi import azure-native:costmanagement:ScheduledActionByScope monthlyCostByResource /{scope}/providers/Microsoft.CostManagement/scheduledActions/{name}
* ```
*
*/
@ResourceType(type="azure-native:costmanagement:ScheduledActionByScope")
public class ScheduledActionByScope extends com.pulumi.resources.CustomResource {
/**
* Scheduled action name.
*
*/
@Export(name="displayName", refs={String.class}, tree="[0]")
private Output displayName;
/**
* @return Scheduled action name.
*
*/
public Output displayName() {
return this.displayName;
}
/**
* Resource Etag. For update calls, eTag is optional and can be specified to achieve optimistic concurrency. Fetch the resource's eTag by doing a 'GET' call first and then including the latest eTag as part of the request body or 'If-Match' header while performing the update. For create calls, eTag is not required.
*
*/
@Export(name="eTag", refs={String.class}, tree="[0]")
private Output eTag;
/**
* @return Resource Etag. For update calls, eTag is optional and can be specified to achieve optimistic concurrency. Fetch the resource's eTag by doing a 'GET' call first and then including the latest eTag as part of the request body or 'If-Match' header while performing the update. For create calls, eTag is not required.
*
*/
public Output eTag() {
return this.eTag;
}
/**
* Destination format of the view data. This is optional.
*
*/
@Export(name="fileDestination", refs={FileDestinationResponse.class}, tree="[0]")
private Output* @Nullable */ FileDestinationResponse> fileDestination;
/**
* @return Destination format of the view data. This is optional.
*
*/
public Output> fileDestination() {
return Codegen.optional(this.fileDestination);
}
/**
* Kind of the scheduled action.
*
*/
@Export(name="kind", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> kind;
/**
* @return Kind of the scheduled action.
*
*/
public Output> kind() {
return Codegen.optional(this.kind);
}
/**
* The name of the resource
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return The name of the resource
*
*/
public Output name() {
return this.name;
}
/**
* Notification properties based on scheduled action kind.
*
*/
@Export(name="notification", refs={NotificationPropertiesResponse.class}, tree="[0]")
private Output notification;
/**
* @return Notification properties based on scheduled action kind.
*
*/
public Output notification() {
return this.notification;
}
/**
* Email address of the point of contact that should get the unsubscribe requests and notification emails.
*
*/
@Export(name="notificationEmail", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> notificationEmail;
/**
* @return Email address of the point of contact that should get the unsubscribe requests and notification emails.
*
*/
public Output> notificationEmail() {
return Codegen.optional(this.notificationEmail);
}
/**
* Schedule of the scheduled action.
*
*/
@Export(name="schedule", refs={SchedulePropertiesResponse.class}, tree="[0]")
private Output schedule;
/**
* @return Schedule of the scheduled action.
*
*/
public Output schedule() {
return this.schedule;
}
/**
* For private scheduled action(Create or Update), scope will be empty.<br /> For shared scheduled action(Create or Update By Scope), Cost Management scope can be 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for ExternalBillingAccount scope, and '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for ExternalSubscription scope.
*
*/
@Export(name="scope", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> scope;
/**
* @return For private scheduled action(Create or Update), scope will be empty.<br /> For shared scheduled action(Create or Update By Scope), Cost Management scope can be 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for ExternalBillingAccount scope, and '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for ExternalSubscription scope.
*
*/
public Output> scope() {
return Codegen.optional(this.scope);
}
/**
* Status of the scheduled action.
*
*/
@Export(name="status", refs={String.class}, tree="[0]")
private Output status;
/**
* @return Status of the scheduled action.
*
*/
public Output status() {
return this.status;
}
/**
* Kind of the scheduled action.
*
*/
@Export(name="systemData", refs={SystemDataResponse.class}, tree="[0]")
private Output systemData;
/**
* @return Kind of the scheduled action.
*
*/
public Output systemData() {
return this.systemData;
}
/**
* The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
*
*/
@Export(name="type", refs={String.class}, tree="[0]")
private Output type;
/**
* @return The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
*
*/
public Output type() {
return this.type;
}
/**
* Cost analysis viewId used for scheduled action. For example, '/providers/Microsoft.CostManagement/views/swaggerExample'
*
*/
@Export(name="viewId", refs={String.class}, tree="[0]")
private Output viewId;
/**
* @return Cost analysis viewId used for scheduled action. For example, '/providers/Microsoft.CostManagement/views/swaggerExample'
*
*/
public Output viewId() {
return this.viewId;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public ScheduledActionByScope(java.lang.String name) {
this(name, ScheduledActionByScopeArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public ScheduledActionByScope(java.lang.String name, ScheduledActionByScopeArgs 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 ScheduledActionByScope(java.lang.String name, ScheduledActionByScopeArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:costmanagement:ScheduledActionByScope", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private ScheduledActionByScope(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:costmanagement:ScheduledActionByScope", name, null, makeResourceOptions(options, id), false);
}
private static ScheduledActionByScopeArgs makeArgs(ScheduledActionByScopeArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? ScheduledActionByScopeArgs.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())
.aliases(List.of(
Output.of(Alias.builder().type("azure-native:costmanagement/v20220401preview:ScheduledActionByScope").build()),
Output.of(Alias.builder().type("azure-native:costmanagement/v20220601preview:ScheduledActionByScope").build()),
Output.of(Alias.builder().type("azure-native:costmanagement/v20221001:ScheduledActionByScope").build()),
Output.of(Alias.builder().type("azure-native:costmanagement/v20230301:ScheduledActionByScope").build()),
Output.of(Alias.builder().type("azure-native:costmanagement/v20230401preview:ScheduledActionByScope").build()),
Output.of(Alias.builder().type("azure-native:costmanagement/v20230701preview:ScheduledActionByScope").build()),
Output.of(Alias.builder().type("azure-native:costmanagement/v20230801:ScheduledActionByScope").build()),
Output.of(Alias.builder().type("azure-native:costmanagement/v20230901:ScheduledActionByScope").build()),
Output.of(Alias.builder().type("azure-native:costmanagement/v20231101:ScheduledActionByScope").build()),
Output.of(Alias.builder().type("azure-native:costmanagement/v20240801:ScheduledActionByScope").build())
))
.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 options Optional settings to control the behavior of the CustomResource.
*/
public static ScheduledActionByScope get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new ScheduledActionByScope(name, id, options);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy