Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
// *** 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.costmanagement;
import com.pulumi.azure.Utilities;
import com.pulumi.azure.costmanagement.ScheduledActionArgs;
import com.pulumi.azure.costmanagement.inputs.ScheduledActionState;
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.Integer;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Manages an Azure Cost Management Scheduled Action.
*
* ## 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.costmanagement.ScheduledAction;
* import com.pulumi.azure.costmanagement.ScheduledActionArgs;
* 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 ScheduledAction("example", ScheduledActionArgs.builder()
* .name("examplescheduledaction")
* .displayName("Report Last 6 Months")
* .viewId("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/views/ms:CostByService")
* .emailAddressSender("platformteam}{@literal @}{@code test.com")
* .emailSubject("Cost Management Report")
* .emailAddresses("example}{@literal @}{@code example.com")
* .message("Hi all, take a look at last 6 months spending!")
* .frequency("Daily")
* .startDate("2023-01-02T00:00:00Z")
* .endDate("2023-02-02T00:00:00Z")
* .build());
*
* }}{@code
* }}{@code
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Azure Cost Management Scheduled Actions can be imported using the `resource id`, e.g.
*
* ```sh
* $ pulumi import azure:costmanagement/scheduledAction:ScheduledAction example /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/scheduledActions/scheduledaction1
* ```
*
*/
@ResourceType(type="azure:costmanagement/scheduledAction:ScheduledAction")
public class ScheduledAction extends com.pulumi.resources.CustomResource {
/**
* UTC day on which cost analysis data will be emailed. Must be between `1` and `31`. This property is applicable when `frequency` is `Monthly`.
*
*/
@Export(name="dayOfMonth", refs={Integer.class}, tree="[0]")
private Output* @Nullable */ Integer> dayOfMonth;
/**
* @return UTC day on which cost analysis data will be emailed. Must be between `1` and `31`. This property is applicable when `frequency` is `Monthly`.
*
*/
public Output> dayOfMonth() {
return Codegen.optional(this.dayOfMonth);
}
/**
* Specifies a list of day names on which cost analysis data will be emailed. This property is applicable when frequency is `Weekly` or `Monthly`. Possible values are `Friday`, `Monday`, `Saturday`, `Sunday`, `Thursday`, `Tuesday` and `Wednesday`.
*
*/
@Export(name="daysOfWeeks", refs={List.class,String.class}, tree="[0,1]")
private Output* @Nullable */ List> daysOfWeeks;
/**
* @return Specifies a list of day names on which cost analysis data will be emailed. This property is applicable when frequency is `Weekly` or `Monthly`. Possible values are `Friday`, `Monday`, `Saturday`, `Sunday`, `Thursday`, `Tuesday` and `Wednesday`.
*
*/
public Output>> daysOfWeeks() {
return Codegen.optional(this.daysOfWeeks);
}
/**
* User visible input name of the Cost Management Scheduled Action.
*
*/
@Export(name="displayName", refs={String.class}, tree="[0]")
private Output displayName;
/**
* @return User visible input name of the Cost Management Scheduled Action.
*
*/
public Output displayName() {
return this.displayName;
}
/**
* Email address of the point of contact that should get the unsubscribe requests of Scheduled Action notification emails.
*
*/
@Export(name="emailAddressSender", refs={String.class}, tree="[0]")
private Output emailAddressSender;
/**
* @return Email address of the point of contact that should get the unsubscribe requests of Scheduled Action notification emails.
*
*/
public Output emailAddressSender() {
return this.emailAddressSender;
}
/**
* Specifies a list of email addresses that will receive the Scheduled Action.
*
*/
@Export(name="emailAddresses", refs={List.class,String.class}, tree="[0,1]")
private Output> emailAddresses;
/**
* @return Specifies a list of email addresses that will receive the Scheduled Action.
*
*/
public Output> emailAddresses() {
return this.emailAddresses;
}
/**
* Subject of the email. Length is limited to 70 characters.
*
*/
@Export(name="emailSubject", refs={String.class}, tree="[0]")
private Output emailSubject;
/**
* @return Subject of the email. Length is limited to 70 characters.
*
*/
public Output emailSubject() {
return this.emailSubject;
}
/**
* The end date and time of the Scheduled Action (UTC).
*
*/
@Export(name="endDate", refs={String.class}, tree="[0]")
private Output endDate;
/**
* @return The end date and time of the Scheduled Action (UTC).
*
*/
public Output endDate() {
return this.endDate;
}
/**
* Frequency of the schedule. Possible values are `Daily`, `Monthly` and `Weekly`. Value `Monthly` requires either `weeks_of_month` and `days_of_week` or `day_of_month` to be specified. Value `Weekly` requires `days_of_week` to be specified.
*
*/
@Export(name="frequency", refs={String.class}, tree="[0]")
private Output frequency;
/**
* @return Frequency of the schedule. Possible values are `Daily`, `Monthly` and `Weekly`. Value `Monthly` requires either `weeks_of_month` and `days_of_week` or `day_of_month` to be specified. Value `Weekly` requires `days_of_week` to be specified.
*
*/
public Output frequency() {
return this.frequency;
}
/**
* UTC time at which cost analysis data will be emailed. Must be between `0` and `23`.
*
*/
@Export(name="hourOfDay", refs={Integer.class}, tree="[0]")
private Output* @Nullable */ Integer> hourOfDay;
/**
* @return UTC time at which cost analysis data will be emailed. Must be between `0` and `23`.
*
*/
public Output> hourOfDay() {
return Codegen.optional(this.hourOfDay);
}
/**
* Message to be added in the email. Length is limited to 250 characters.
*
*/
@Export(name="message", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> message;
/**
* @return Message to be added in the email. Length is limited to 250 characters.
*
*/
public Output> message() {
return Codegen.optional(this.message);
}
/**
* The name which should be used for this Azure Cost Management Scheduled Action. Changing this forces a new Azure Cost Management Scheduled Action to be created.
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return The name which should be used for this Azure Cost Management Scheduled Action. Changing this forces a new Azure Cost Management Scheduled Action to be created.
*
*/
public Output name() {
return this.name;
}
/**
* The start date and time of the Scheduled Action (UTC).
*
*/
@Export(name="startDate", refs={String.class}, tree="[0]")
private Output startDate;
/**
* @return The start date and time of the Scheduled Action (UTC).
*
*/
public Output startDate() {
return this.startDate;
}
/**
* The ID of the Cost Management View that is used by the Scheduled Action. Changing this forces a new resource to be created.
*
*/
@Export(name="viewId", refs={String.class}, tree="[0]")
private Output viewId;
/**
* @return The ID of the Cost Management View that is used by the Scheduled Action. Changing this forces a new resource to be created.
*
*/
public Output viewId() {
return this.viewId;
}
/**
* Specifies a list of weeks in which cost analysis data will be emailed. This property is applicable when `frequency` is `Monthly` and used in combination with `days_of_week`. Possible values are `First`, `Fourth`, `Last`, `Second` and `Third`.
*
*/
@Export(name="weeksOfMonths", refs={List.class,String.class}, tree="[0,1]")
private Output* @Nullable */ List> weeksOfMonths;
/**
* @return Specifies a list of weeks in which cost analysis data will be emailed. This property is applicable when `frequency` is `Monthly` and used in combination with `days_of_week`. Possible values are `First`, `Fourth`, `Last`, `Second` and `Third`.
*
*/
public Output>> weeksOfMonths() {
return Codegen.optional(this.weeksOfMonths);
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public ScheduledAction(java.lang.String name) {
this(name, ScheduledActionArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public ScheduledAction(java.lang.String name, ScheduledActionArgs 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 ScheduledAction(java.lang.String name, ScheduledActionArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:costmanagement/scheduledAction:ScheduledAction", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private ScheduledAction(java.lang.String name, Output id, @Nullable ScheduledActionState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:costmanagement/scheduledAction:ScheduledAction", name, state, makeResourceOptions(options, id), false);
}
private static ScheduledActionArgs makeArgs(ScheduledActionArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? ScheduledActionArgs.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 ScheduledAction get(java.lang.String name, Output id, @Nullable ScheduledActionState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new ScheduledAction(name, id, state, options);
}
}