Scheduled Action By Scope Args
Scheduled action definition. API Version: 2022-04-01-preview.
Example Usage
CreateOrUpdateScheduledActionByScope
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var scheduledActionByScope = new AzureNative.CostManagement.ScheduledActionByScope("scheduledActionByScope", new()
{
DisplayName = "Monthly Cost By Resource",
FileDestination = new AzureNative.CostManagement.Inputs.FileDestinationArgs
{
FileFormats = new[]
{
"Csv",
},
},
Kind = "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[]
{
"Monday",
},
EndDate = "2021-06-19T22:21:51.1287144Z",
Frequency = "Monthly",
HourOfDay = 10,
StartDate = "2020-06-19T22:21:51.1287144Z",
WeeksOfMonth = new[]
{
"First",
"Third",
},
},
Scope = "subscriptions/00000000-0000-0000-0000-000000000000",
Status = "Enabled",
ViewId = "/providers/Microsoft.CostManagement/views/swaggerExample",
});
});
package main
import (
costmanagement "github.com/pulumi/pulumi-azure-native-sdk/costmanagement"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := costmanagement.NewScheduledActionByScope(ctx, "scheduledActionByScope", &costmanagement.ScheduledActionByScopeArgs{
DisplayName: pulumi.String("Monthly Cost By Resource"),
FileDestination: &costmanagement.FileDestinationArgs{
FileFormats: pulumi.StringArray{
pulumi.String("Csv"),
},
},
Kind: pulumi.String("Email"),
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("Monday"),
},
EndDate: pulumi.String("2021-06-19T22:21:51.1287144Z"),
Frequency: pulumi.String("Monthly"),
HourOfDay: pulumi.Int(10),
StartDate: pulumi.String("2020-06-19T22:21:51.1287144Z"),
WeeksOfMonth: pulumi.StringArray{
pulumi.String("First"),
pulumi.String("Third"),
},
},
Scope: pulumi.String("subscriptions/00000000-0000-0000-0000-000000000000"),
Status: pulumi.String("Enabled"),
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.ScheduledActionByScope;
import com.pulumi.azurenative.costmanagement.ScheduledActionByScopeArgs;
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 scheduledActionByScope = new ScheduledActionByScope("scheduledActionByScope", ScheduledActionByScopeArgs.builder()
.displayName("Monthly Cost By Resource")
.fileDestination(Map.of("fileFormats", "Csv"))
.kind("Email")
.name("monthlyCostByResource")
.notification(Map.ofEntries(
Map.entry("subject", "Cost by resource this month"),
Map.entry("to",
"user@gmail.com",
"team@gmail.com")
))
.schedule(Map.ofEntries(
Map.entry("daysOfWeek", "Monday"),
Map.entry("endDate", "2021-06-19T22:21:51.1287144Z"),
Map.entry("frequency", "Monthly"),
Map.entry("hourOfDay", 10),
Map.entry("startDate", "2020-06-19T22:21:51.1287144Z"),
Map.entry("weeksOfMonth",
"First",
"Third")
))
.scope("subscriptions/00000000-0000-0000-0000-000000000000")
.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:ScheduledActionByScope monthlyCostByResource subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.CostManagement/scheduledActions/monthlyCostByResource
Constructors
Properties
Scheduled action name.
Destination format of the view data.
Kind of the scheduled action.
Notification properties based on scheduled action kind.
Schedule of the scheduled action.
Cost Management scope like '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.