Scheduled Action Args
Scheduled action definition. Uses Azure REST API version 2024-08-01. In version 2.x of the Azure Native provider, it used API version 2023-03-01. Other available API versions: 2022-04-01-preview, 2022-06-01-preview, 2022-10-01, 2023-03-01, 2023-04-01-preview, 2023-07-01-preview, 2023-08-01, 2023-09-01, 2023-11-01, 2024-10-01-preview, 2025-03-01. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native costmanagement [ApiVersion]
. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.
Example Usage
CreateOrUpdatePrivateScheduledAction
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var scheduledAction = new AzureNative.CostManagement.ScheduledAction("scheduledAction", new()
{
DisplayName = "Monthly Cost By Resource",
Kind = AzureNative.CostManagement.ScheduledActionKind.Email,
Name = "monthlyCostByResource",
Notification = new AzureNative.CostManagement.Inputs.NotificationPropertiesArgs
{
Subject = "Cost by resource this month",
To = new[]
{
"user@gmail.com",
"team@gmail.com",
},
},
Schedule = new AzureNative.CostManagement.Inputs.SchedulePropertiesArgs
{
DaysOfWeek = new[]
{
AzureNative.CostManagement.DaysOfWeek.Monday,
},
EndDate = "2021-06-19T22:21:51.1287144Z",
Frequency = AzureNative.CostManagement.ScheduleFrequency.Monthly,
HourOfDay = 10,
StartDate = "2020-06-19T22:21:51.1287144Z",
WeeksOfMonth = new[]
{
AzureNative.CostManagement.WeeksOfMonth.First,
AzureNative.CostManagement.WeeksOfMonth.Third,
},
},
Status = AzureNative.CostManagement.ScheduledActionStatus.Enabled,
ViewId = "/providers/Microsoft.CostManagement/views/swaggerExample",
});
});
package main
import (
costmanagement "github.com/pulumi/pulumi-azure-native-sdk/costmanagement/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := costmanagement.NewScheduledAction(ctx, "scheduledAction", &costmanagement.ScheduledActionArgs{
DisplayName: pulumi.String("Monthly Cost By Resource"),
Kind: pulumi.String(costmanagement.ScheduledActionKindEmail),
Name: pulumi.String("monthlyCostByResource"),
Notification: &costmanagement.NotificationPropertiesArgs{
Subject: pulumi.String("Cost by resource this month"),
To: pulumi.StringArray{
pulumi.String("user@gmail.com"),
pulumi.String("team@gmail.com"),
},
},
Schedule: &costmanagement.SchedulePropertiesArgs{
DaysOfWeek: pulumi.StringArray{
pulumi.String(costmanagement.DaysOfWeekMonday),
},
EndDate: pulumi.String("2021-06-19T22:21:51.1287144Z"),
Frequency: pulumi.String(costmanagement.ScheduleFrequencyMonthly),
HourOfDay: pulumi.Int(10),
StartDate: pulumi.String("2020-06-19T22:21:51.1287144Z"),
WeeksOfMonth: pulumi.StringArray{
pulumi.String(costmanagement.WeeksOfMonthFirst),
pulumi.String(costmanagement.WeeksOfMonthThird),
},
},
Status: pulumi.String(costmanagement.ScheduledActionStatusEnabled),
ViewId: pulumi.String("/providers/Microsoft.CostManagement/views/swaggerExample"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.costmanagement.ScheduledAction;
import com.pulumi.azurenative.costmanagement.ScheduledActionArgs;
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 {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var scheduledAction = new ScheduledAction("scheduledAction", ScheduledActionArgs.builder()
.displayName("Monthly Cost By Resource")
.kind("Email")
.name("monthlyCostByResource")
.notification(NotificationPropertiesArgs.builder()
.subject("Cost by resource this month")
.to(
"user@gmail.com",
"team@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())
.status("Enabled")
.viewId("/providers/Microsoft.CostManagement/views/swaggerExample")
.build());
}
}
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:costmanagement:ScheduledAction monthlyCostByResource /providers/Microsoft.CostManagement/scheduledActions/{name}
Constructors
Properties
Scheduled action name.
Destination format of the view data. This is optional.
Kind of the scheduled action.
Notification properties based on scheduled action kind.
Email address of the point of contact that should get the unsubscribe requests and notification emails.
Schedule of the scheduled action.
For private scheduled action(Create or Update), scope will be empty.
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.
Status of the scheduled action.