mongodbatlas logo
MongoDB Atlas v3.7.2, Mar 31 23

mongodbatlas.MaintenanceWindow

Explore with Pulumi AI

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 System.Collections.Generic;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

return await Deployment.RunAsync(() => 
{
    var test = new Mongodbatlas.MaintenanceWindow("test", new()
    {
        DayOfWeek = 3,
        HourOfDay = 4,
        ProjectId = "<your-project-id>",
    });

});
package main

import (
	"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas"
	"github.com/pulumi/pulumi/sdk/v3/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
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mongodbatlas.MaintenanceWindow;
import com.pulumi.mongodbatlas.MaintenanceWindowArgs;
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 test = new MaintenanceWindow("test", MaintenanceWindowArgs.builder()        
            .dayOfWeek(3)
            .hourOfDay(4)
            .projectId("<your-project-id>")
            .build());

    }
}
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>",
});
resources:
  test:
    type: mongodbatlas:MaintenanceWindow
    properties:
      dayOfWeek: 3
      hourOfDay: 4
      projectId: <your-project-id>
using System.Collections.Generic;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

return await Deployment.RunAsync(() => 
{
    var test = new Mongodbatlas.MaintenanceWindow("test", new()
    {
        Defer = true,
        ProjectId = "<your-project-id>",
    });

});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := mongodbatlas.NewMaintenanceWindow(ctx, "test", &mongodbatlas.MaintenanceWindowArgs{
			Defer:     pulumi.Bool(true),
			ProjectId: pulumi.String("<your-project-id>"),
		})
		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.mongodbatlas.MaintenanceWindow;
import com.pulumi.mongodbatlas.MaintenanceWindowArgs;
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 test = new MaintenanceWindow("test", MaintenanceWindowArgs.builder()        
            .defer(true)
            .projectId("<your-project-id>")
            .build());

    }
}
import pulumi
import pulumi_mongodbatlas as mongodbatlas

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

const test = new mongodbatlas.MaintenanceWindow("test", {
    defer: true,
    projectId: "<your-project-id>",
});
resources:
  test:
    type: mongodbatlas:MaintenanceWindow
    properties:
      defer: true
      projectId: <your-project-id>

Create MaintenanceWindow Resource

new MaintenanceWindow(name: string, args: MaintenanceWindowArgs, opts?: CustomResourceOptions);
@overload
def MaintenanceWindow(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      auto_defer: Optional[bool] = None,
                      auto_defer_once_enabled: Optional[bool] = 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)
@overload
def MaintenanceWindow(resource_name: str,
                      args: MaintenanceWindowArgs,
                      opts: Optional[ResourceOptions] = None)
func NewMaintenanceWindow(ctx *Context, name string, args MaintenanceWindowArgs, opts ...ResourceOption) (*MaintenanceWindow, error)
public MaintenanceWindow(string name, MaintenanceWindowArgs args, CustomResourceOptions? opts = null)
public MaintenanceWindow(String name, MaintenanceWindowArgs args)
public MaintenanceWindow(String name, MaintenanceWindowArgs args, CustomResourceOptions options)
type: mongodbatlas:MaintenanceWindow
properties: # The arguments to resource properties.
options: # 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.
resource_name str
The unique name of the resource.
args MaintenanceWindowArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control 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.
name String
The unique name of the resource.
args MaintenanceWindowArgs
The arguments to resource properties.
options 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 Architecture and Concepts docs.

Inputs

The MaintenanceWindow resource accepts the following input properties:

ProjectId string

The unique identifier of the project for the Maintenance Window.

AutoDefer bool

Defer any scheduled maintenance for the given project for one week.

AutoDeferOnceEnabled bool

Flag that indicates whether you want to defer all maintenance windows one week they would be triggered.

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 the next scheduled 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.

AutoDefer bool

Defer any scheduled maintenance for the given project for one week.

AutoDeferOnceEnabled bool

Flag that indicates whether you want to defer all maintenance windows one week they would be triggered.

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 the next scheduled 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.

autoDefer Boolean

Defer any scheduled maintenance for the given project for one week.

autoDeferOnceEnabled Boolean

Flag that indicates whether you want to defer all maintenance windows one week they would be triggered.

dayOfWeek Integer

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 the next scheduled maintenance for the given project for one week.

hourOfDay Integer

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 Integer

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.

autoDefer boolean

Defer any scheduled maintenance for the given project for one week.

autoDeferOnceEnabled boolean

Flag that indicates whether you want to defer all maintenance windows one week they would be triggered.

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 the next scheduled 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.

auto_defer bool

Defer any scheduled maintenance for the given project for one week.

auto_defer_once_enabled bool

Flag that indicates whether you want to defer all maintenance windows one week they would be triggered.

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 the next scheduled 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.

projectId String

The unique identifier of the project for the Maintenance Window.

autoDefer Boolean

Defer any scheduled maintenance for the given project for one week.

autoDeferOnceEnabled Boolean

Flag that indicates whether you want to defer all maintenance windows one week they would be triggered.

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 the next scheduled 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.

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 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.

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.

Look up 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,
        auto_defer: Optional[bool] = None,
        auto_defer_once_enabled: Optional[bool] = 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)
public static MaintenanceWindow get(String name, Output<String> id, MaintenanceWindowState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
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.
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:
AutoDefer bool

Defer any scheduled maintenance for the given project for one week.

AutoDeferOnceEnabled bool

Flag that indicates whether you want to defer all maintenance windows one week they would be triggered.

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 the next scheduled 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.

AutoDefer bool

Defer any scheduled maintenance for the given project for one week.

AutoDeferOnceEnabled bool

Flag that indicates whether you want to defer all maintenance windows one week they would be triggered.

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 the next scheduled 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.

autoDefer Boolean

Defer any scheduled maintenance for the given project for one week.

autoDeferOnceEnabled Boolean

Flag that indicates whether you want to defer all maintenance windows one week they would be triggered.

dayOfWeek Integer

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 the next scheduled maintenance for the given project for one week.

hourOfDay Integer

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 Integer

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.

autoDefer boolean

Defer any scheduled maintenance for the given project for one week.

autoDeferOnceEnabled boolean

Flag that indicates whether you want to defer all maintenance windows one week they would be triggered.

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 the next scheduled 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.

auto_defer bool

Defer any scheduled maintenance for the given project for one week.

auto_defer_once_enabled bool

Flag that indicates whether you want to defer all maintenance windows one week they would be triggered.

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 the next scheduled 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.

autoDefer Boolean

Defer any scheduled maintenance for the given project for one week.

autoDeferOnceEnabled Boolean

Flag that indicates whether you want to defer all maintenance windows one week they would be triggered.

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 the next scheduled 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.

Import

Maintenance Window entries can be imported using project project_id, in the format PROJECTID, e.g.

 $ pulumi import mongodbatlas:index/maintenanceWindow:MaintenanceWindow test 5d0f1f73cf09a29120e173cf

For more information seeMongoDB Atlas API Reference.

Package Details

Repository
MongoDB Atlas pulumi/pulumi-mongodbatlas
License
Apache-2.0
Notes

This Pulumi package is based on the mongodbatlas Terraform Provider.