import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Use this resource to create, update, and delete [Monitor Downtimes](https://docs.newrelic.com/docs/synthetics/synthetic-monitoring/using-monitors/monitor-downtimes-disable-monitoring-during-scheduled-maintenance-times/) in New Relic. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const foo = new newrelic.MonitorDowntime("foo", { * name: "Sample Monitor Downtime", * monitorGuids: [ * "", * "", * ], * mode: "WEEKLY", * startTime: "2023-11-30T10:30:00", * endTime: "2023-12-10T02:45:30", * timeZone: "Asia/Kolkata", * endRepeat: { * onDate: "2023-12-20", * }, * maintenanceDays: [ * "FRIDAY", * "SATURDAY", * ], * }); * ``` * Monitor Downtimes are of four types; **one-time**, **daily**, **weekly** and **monthly**. For more details on each type and the right arguments that go with them, check out the argument reference and examples sections below. * * ## Examples * * ### One-Time Monitor Downtime * * The below example illustrates creating a **one-time** monitor downtime. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const sampleOneTimeNewrelicMonitorDowntime = new newrelic.MonitorDowntime("sample_one_time_newrelic_monitor_downtime", { * name: "Sample One Time Monitor Downtime", * monitorGuids: [ * "", * "", * ], * mode: "ONE_TIME", * startTime: "2023-12-04T10:15:00", * endTime: "2024-01-04T16:24:30", * timeZone: "America/Los_Angeles", * }); * ``` * * ### Daily Monitor Downtime * * The below example illustrates creating a **daily** monitor downtime. * * Note that `endRepeat` has been specified in the configuration; however, this is optional, in accordance with the rules of `endRepeat` specified in the argument reference section above. This example uses the `onDate` nested argument of `endRepeat`, however, the other nested argument, `onRepeat` may also be used _instead_, as you may see in some of the other examples below; though both `onDate` and `onRepeat` cannot be specified together, as they are mutually exclusive. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const sampleDailyNewrelicMonitorDowntime = new newrelic.MonitorDowntime("sample_daily_newrelic_monitor_downtime", { * name: "Sample Daily Monitor Downtime", * monitorGuids: [ * "", * "", * ], * mode: "DAILY", * startTime: "2023-12-04T18:15:00", * endTime: "2024-01-04T07:15:00", * endRepeat: { * onDate: "2023-12-25", * }, * timeZone: "Asia/Kolkata", * }); * ``` * * ### Weekly Monitor Downtime * * The below example illustrates creating a **weekly** monitor downtime. * * Note that `maintenanceDays` has been specified in the configuration as it is required with weekly monitor downtimes; and `endRepeat` has not been specified as it is optional, all in accordance with the rules of these arguments specified in the argument reference section above. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const sampleWeeklyNewrelicMonitorDowntime = new newrelic.MonitorDowntime("sample_weekly_newrelic_monitor_downtime", { * name: "Sample Weekly Monitor Downtime", * monitorGuids: [ * "", * "", * ], * mode: "WEEKLY", * startTime: "2023-12-04T14:15:00", * endTime: "2024-01-04T23:55:00", * timeZone: "US/Hawaii", * maintenanceDays: [ * "SATURDAY", * "SUNDAY", * ], * }); * ``` * * ### Monthly Monitor Downtime * * The below example illustrates creating a **monthly** monitor downtime. * * Note that `frequency` has been specified in the configuration as it is required with monthly monitor downtimes, and `endRepeat` has been specified too, though it is optional. `frequency` has been specified with `daysOfWeek` comprising both of its nested arguments, `ordinalDayOfMonth` and `weekDay`; all in accordance with the rules of these arguments specified in the argument reference section above. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const sampleMonthlyNewrelicMonitorDowntime = new newrelic.MonitorDowntime("sample_monthly_newrelic_monitor_downtime", { * name: "Sample Monthly Monitor Downtime", * monitorGuids: [ * "", * "", * ], * mode: "MONTHLY", * startTime: "2023-12-04T07:15:00", * endTime: "2024-01-04T19:15:00", * endRepeat: { * onRepeat: 6, * }, * timeZone: "Europe/Dublin", * frequency: { * daysOfWeek: { * ordinalDayOfMonth: "SECOND", * weekDay: "SATURDAY", * }, * }, * }); * ``` * However, the `frequency` block in monthly monitor downtimes may also be specified with its other nested argument, `daysOfMonth`, as shown in the example below - though both `daysOfMonth` and `daysOfWeek` cannot be specified together, as they are mutually exclusive. * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as newrelic from "@pulumi/newrelic"; * * const sampleMonthlyNewrelicMonitorDowntime = new newrelic.MonitorDowntime("sample_monthly_newrelic_monitor_downtime", { * name: "Sample Monthly Monitor Downtime", * monitorGuids: [ * "", * "", * ], * mode: "MONTHLY", * startTime: "2023-12-04T07:15:00", * endTime: "2024-01-04T19:15:00", * endRepeat: { * onRepeat: 6, * }, * timeZone: "Europe/Dublin", * frequency: { * daysOfMonths: [ * 3, * 6, * 14, * 23, * ], * }, * }); * ``` * * ## Import * * A monitor downtime can be imported into Terraform configuration using its `guid`, i.e. * * ```sh * $ pulumi import newrelic:index/monitorDowntime:MonitorDowntime monitor * ``` */ export declare class MonitorDowntime extends pulumi.CustomResource { /** * Get an existing MonitorDowntime 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 Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: MonitorDowntimeState, opts?: pulumi.CustomResourceOptions): MonitorDowntime; /** * Returns true if the given object is an instance of MonitorDowntime. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is MonitorDowntime; /** * The ID of the New Relic account in which the Monitor Downtime shall be created. Defaults to the `accountId` in the provider{} configuration if not specified. */ readonly accountId: pulumi.Output; /** * A specification of when the Monitor Downtime should end its repeat cycle, by number of occurrences or date. */ readonly endRepeat: pulumi.Output; /** * A datetime stamp signifying the end of the Monitor Downtime. */ readonly endTime: pulumi.Output; /** * Configuration options for which days of the month a monitor downtime will occur */ readonly frequency: pulumi.Output; /** * A list of maintenance days to be included with the created weekly Monitor Downtime. */ readonly maintenanceDays: pulumi.Output; /** * An identifier of the type of Monitor Downtime to be created. */ readonly mode: pulumi.Output; /** * A list of GUIDs of monitors, to which the created Monitor Downtime shall be applied. */ readonly monitorGuids: pulumi.Output; /** * A name to identify the Monitor Downtime to be created. */ readonly name: pulumi.Output; /** * A datetime stamp signifying the start of the Monitor Downtime. */ readonly startTime: pulumi.Output; /** * The timezone that applies to the Monitor Downtime schedule. */ readonly timeZone: pulumi.Output; /** * Create a MonitorDowntime resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: MonitorDowntimeArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering MonitorDowntime resources. */ export interface MonitorDowntimeState { /** * The ID of the New Relic account in which the Monitor Downtime shall be created. Defaults to the `accountId` in the provider{} configuration if not specified. */ accountId?: pulumi.Input; /** * A specification of when the Monitor Downtime should end its repeat cycle, by number of occurrences or date. */ endRepeat?: pulumi.Input; /** * A datetime stamp signifying the end of the Monitor Downtime. */ endTime?: pulumi.Input; /** * Configuration options for which days of the month a monitor downtime will occur */ frequency?: pulumi.Input; /** * A list of maintenance days to be included with the created weekly Monitor Downtime. */ maintenanceDays?: pulumi.Input[] | undefined>; /** * An identifier of the type of Monitor Downtime to be created. */ mode?: pulumi.Input; /** * A list of GUIDs of monitors, to which the created Monitor Downtime shall be applied. */ monitorGuids?: pulumi.Input[] | undefined>; /** * A name to identify the Monitor Downtime to be created. */ name?: pulumi.Input; /** * A datetime stamp signifying the start of the Monitor Downtime. */ startTime?: pulumi.Input; /** * The timezone that applies to the Monitor Downtime schedule. */ timeZone?: pulumi.Input; } /** * The set of arguments for constructing a MonitorDowntime resource. */ export interface MonitorDowntimeArgs { /** * The ID of the New Relic account in which the Monitor Downtime shall be created. Defaults to the `accountId` in the provider{} configuration if not specified. */ accountId?: pulumi.Input; /** * A specification of when the Monitor Downtime should end its repeat cycle, by number of occurrences or date. */ endRepeat?: pulumi.Input; /** * A datetime stamp signifying the end of the Monitor Downtime. */ endTime: pulumi.Input; /** * Configuration options for which days of the month a monitor downtime will occur */ frequency?: pulumi.Input; /** * A list of maintenance days to be included with the created weekly Monitor Downtime. */ maintenanceDays?: pulumi.Input[] | undefined>; /** * An identifier of the type of Monitor Downtime to be created. */ mode: pulumi.Input; /** * A list of GUIDs of monitors, to which the created Monitor Downtime shall be applied. */ monitorGuids?: pulumi.Input[] | undefined>; /** * A name to identify the Monitor Downtime to be created. */ name?: pulumi.Input; /** * A datetime stamp signifying the start of the Monitor Downtime. */ startTime: pulumi.Input; /** * The timezone that applies to the Monitor Downtime schedule. */ timeZone: pulumi.Input; } //# sourceMappingURL=monitorDowntime.d.ts.map