Want to learn about running containers in Lambda? Join our free hands-on workshop. Register Now

MaintenanceWindow

mongodbatlas.MaintenanceWindow provides a resource to schedule a maintenance window for your MongoDB Atlas Project and/or set to defer a scheduled maintenance up to two times.

NOTE: Groups and projects are synonymous terms. You may find groupId in the official documentation.

Maintenance Window Considerations:

  • Urgent Maintenance Activities Cannot Wait: Urgent maintenance activities such as security patches cannot wait for your chosen window. Atlas will start those maintenance activities when needed.

Once maintenance is scheduled for your cluster, you cannot change your maintenance window until the current maintenance efforts have completed. - Maintenance Requires Replica Set Elections: Atlas performs maintenance the same way as the manual maintenance procedure. This requires at least one replica set election during the maintenance window per replica set. - Maintenance Starts As Close to the Hour As Possible: Maintenance always begins as close to the scheduled hour as possible, but in-progress cluster updates or expected system issues could delay the start time.

Example Usage

using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

class MyStack : Stack
{
    public MyStack()
    {
        var test = new Mongodbatlas.MaintenanceWindow("test", new Mongodbatlas.MaintenanceWindowArgs
        {
            DayOfWeek = 3,
            HourOfDay = 4,
            ProjectId = "<your-project-id>",
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-mongodbatlas/sdk/go/mongodbatlas"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := mongodbatlas.NewMaintenanceWindow(ctx, "test", &mongodbatlas.MaintenanceWindowArgs{
            DayOfWeek: pulumi.Int(3),
            HourOfDay: pulumi.Int(4),
            ProjectId: pulumi.String("<your-project-id>"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_mongodbatlas as mongodbatlas

test = mongodbatlas.MaintenanceWindow("test",
    day_of_week=3,
    hour_of_day=4,
    project_id="<your-project-id>")
import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";

const test = new mongodbatlas.MaintenanceWindow("test", {
    dayOfWeek: 3,
    hourOfDay: 4,
    projectId: "<your-project-id>",
});

Create a MaintenanceWindow Resource

def MaintenanceWindow(resource_name: str, opts: Optional[ResourceOptions] = None, day_of_week: Optional[int] = None, defer: Optional[bool] = None, hour_of_day: Optional[int] = None, number_of_deferrals: Optional[int] = None, project_id: Optional[str] = None)
name string
The unique name of the resource.
args MaintenanceWindowArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args MaintenanceWindowArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args MaintenanceWindowArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

MaintenanceWindow Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The MaintenanceWindow resource accepts the following input properties:

ProjectId string

The unique identifier of the project for the Maintenance Window.

DayOfWeek int

Day of the week when you would like the maintenance window to start as a 1-based integer: S=1, M=2, T=3, W=4, T=5, F=6, S=7.

Defer bool

Defer maintenance for the given project for one week.

HourOfDay int

Hour of the day when you would like the maintenance window to start. This parameter uses the 24-hour clock, where midnight is 0, noon is 12 (Time zone is UTC).

NumberOfDeferrals int

Number of times the current maintenance event for this project has been deferred, you can set a maximum of 2 deferrals.

ProjectId string

The unique identifier of the project for the Maintenance Window.

DayOfWeek int

Day of the week when you would like the maintenance window to start as a 1-based integer: S=1, M=2, T=3, W=4, T=5, F=6, S=7.

Defer bool

Defer maintenance for the given project for one week.

HourOfDay int

Hour of the day when you would like the maintenance window to start. This parameter uses the 24-hour clock, where midnight is 0, noon is 12 (Time zone is UTC).

NumberOfDeferrals int

Number of times the current maintenance event for this project has been deferred, you can set a maximum of 2 deferrals.

projectId string

The unique identifier of the project for the Maintenance Window.

dayOfWeek number

Day of the week when you would like the maintenance window to start as a 1-based integer: S=1, M=2, T=3, W=4, T=5, F=6, S=7.

defer boolean

Defer maintenance for the given project for one week.

hourOfDay number

Hour of the day when you would like the maintenance window to start. This parameter uses the 24-hour clock, where midnight is 0, noon is 12 (Time zone is UTC).

numberOfDeferrals number

Number of times the current maintenance event for this project has been deferred, you can set a maximum of 2 deferrals.

project_id str

The unique identifier of the project for the Maintenance Window.

day_of_week int

Day of the week when you would like the maintenance window to start as a 1-based integer: S=1, M=2, T=3, W=4, T=5, F=6, S=7.

defer bool

Defer maintenance for the given project for one week.

hour_of_day int

Hour of the day when you would like the maintenance window to start. This parameter uses the 24-hour clock, where midnight is 0, noon is 12 (Time zone is UTC).

number_of_deferrals int

Number of times the current maintenance event for this project has been deferred, you can set a maximum of 2 deferrals.

Outputs

All input properties are implicitly available as output properties. Additionally, the MaintenanceWindow resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
StartAsap bool

Flag indicating whether project maintenance has been directed to start immediately. If you request that maintenance begin immediately, this field returns true from the time the request was made until the time the maintenance event completes.

Id string
The provider-assigned unique ID for this managed resource.
StartAsap bool

Flag indicating whether project maintenance has been directed to start immediately. If you request that maintenance begin immediately, this field returns true from the time the request was made until the time the maintenance event completes.

id string
The provider-assigned unique ID for this managed resource.
startAsap boolean

Flag indicating whether project maintenance has been directed to start immediately. If you request that maintenance begin immediately, this field returns true from the time the request was made until the time the maintenance event completes.

id str
The provider-assigned unique ID for this managed resource.
start_asap bool

Flag indicating whether project maintenance has been directed to start immediately. If you request that maintenance begin immediately, this field returns true from the time the request was made until the time the maintenance event completes.

Look up an Existing MaintenanceWindow Resource

Get an existing MaintenanceWindow resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: MaintenanceWindowState, opts?: CustomResourceOptions): MaintenanceWindow
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, day_of_week: Optional[int] = None, defer: Optional[bool] = None, hour_of_day: Optional[int] = None, number_of_deferrals: Optional[int] = None, project_id: Optional[str] = None, start_asap: Optional[bool] = None) -> MaintenanceWindow
func GetMaintenanceWindow(ctx *Context, name string, id IDInput, state *MaintenanceWindowState, opts ...ResourceOption) (*MaintenanceWindow, error)
public static MaintenanceWindow Get(string name, Input<string> id, MaintenanceWindowState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

DayOfWeek int

Day of the week when you would like the maintenance window to start as a 1-based integer: S=1, M=2, T=3, W=4, T=5, F=6, S=7.

Defer bool

Defer maintenance for the given project for one week.

HourOfDay int

Hour of the day when you would like the maintenance window to start. This parameter uses the 24-hour clock, where midnight is 0, noon is 12 (Time zone is UTC).

NumberOfDeferrals int

Number of times the current maintenance event for this project has been deferred, you can set a maximum of 2 deferrals.

ProjectId string

The unique identifier of the project for the Maintenance Window.

StartAsap bool

Flag indicating whether project maintenance has been directed to start immediately. If you request that maintenance begin immediately, this field returns true from the time the request was made until the time the maintenance event completes.

DayOfWeek int

Day of the week when you would like the maintenance window to start as a 1-based integer: S=1, M=2, T=3, W=4, T=5, F=6, S=7.

Defer bool

Defer maintenance for the given project for one week.

HourOfDay int

Hour of the day when you would like the maintenance window to start. This parameter uses the 24-hour clock, where midnight is 0, noon is 12 (Time zone is UTC).

NumberOfDeferrals int

Number of times the current maintenance event for this project has been deferred, you can set a maximum of 2 deferrals.

ProjectId string

The unique identifier of the project for the Maintenance Window.

StartAsap bool

Flag indicating whether project maintenance has been directed to start immediately. If you request that maintenance begin immediately, this field returns true from the time the request was made until the time the maintenance event completes.

dayOfWeek number

Day of the week when you would like the maintenance window to start as a 1-based integer: S=1, M=2, T=3, W=4, T=5, F=6, S=7.

defer boolean

Defer maintenance for the given project for one week.

hourOfDay number

Hour of the day when you would like the maintenance window to start. This parameter uses the 24-hour clock, where midnight is 0, noon is 12 (Time zone is UTC).

numberOfDeferrals number

Number of times the current maintenance event for this project has been deferred, you can set a maximum of 2 deferrals.

projectId string

The unique identifier of the project for the Maintenance Window.

startAsap boolean

Flag indicating whether project maintenance has been directed to start immediately. If you request that maintenance begin immediately, this field returns true from the time the request was made until the time the maintenance event completes.

day_of_week int

Day of the week when you would like the maintenance window to start as a 1-based integer: S=1, M=2, T=3, W=4, T=5, F=6, S=7.

defer bool

Defer maintenance for the given project for one week.

hour_of_day int

Hour of the day when you would like the maintenance window to start. This parameter uses the 24-hour clock, where midnight is 0, noon is 12 (Time zone is UTC).

number_of_deferrals int

Number of times the current maintenance event for this project has been deferred, you can set a maximum of 2 deferrals.

project_id str

The unique identifier of the project for the Maintenance Window.

start_asap bool

Flag indicating whether project maintenance has been directed to start immediately. If you request that maintenance begin immediately, this field returns true from the time the request was made until the time the maintenance event completes.

Package Details

Repository
https://github.com/pulumi/pulumi-mongodbatlas
License
Apache-2.0
Notes
This Pulumi package is based on the mongodbatlas Terraform Provider.