mongodbatlas.MaintenanceWindow
Explore with Pulumi AI
# Resource: mongodbatlas.MaintenanceWindow
mongodbatlas.MaintenanceWindow
provides a resource to schedule the maintenance window for your MongoDB Atlas Project and/or set to defer a scheduled maintenance up to two times. Please refer to Maintenance Windows documentation for more details.
NOTE: Only a single maintenance window resource can be defined per project.
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
import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";
const test = new mongodbatlas.MaintenanceWindow("test", {
projectId: "<your-project-id>",
dayOfWeek: 3,
hourOfDay: 4,
});
import pulumi
import pulumi_mongodbatlas as mongodbatlas
test = mongodbatlas.MaintenanceWindow("test",
project_id="<your-project-id>",
day_of_week=3,
hour_of_day=4)
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{
ProjectId: pulumi.String("<your-project-id>"),
DayOfWeek: pulumi.Int(3),
HourOfDay: pulumi.Int(4),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
return await Deployment.RunAsync(() =>
{
var test = new Mongodbatlas.MaintenanceWindow("test", new()
{
ProjectId = "<your-project-id>",
DayOfWeek = 3,
HourOfDay = 4,
});
});
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()
.projectId("<your-project-id>")
.dayOfWeek(3)
.hourOfDay(4)
.build());
}
}
resources:
test:
type: mongodbatlas:MaintenanceWindow
properties:
projectId: <your-project-id>
dayOfWeek: 3
hourOfDay: 4
import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";
const test = new mongodbatlas.MaintenanceWindow("test", {
projectId: "<your-project-id>",
defer: true,
});
import pulumi
import pulumi_mongodbatlas as mongodbatlas
test = mongodbatlas.MaintenanceWindow("test",
project_id="<your-project-id>",
defer=True)
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{
ProjectId: pulumi.String("<your-project-id>"),
Defer: pulumi.Bool(true),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
return await Deployment.RunAsync(() =>
{
var test = new Mongodbatlas.MaintenanceWindow("test", new()
{
ProjectId = "<your-project-id>",
Defer = true,
});
});
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()
.projectId("<your-project-id>")
.defer(true)
.build());
}
}
resources:
test:
type: mongodbatlas:MaintenanceWindow
properties:
projectId: <your-project-id>
defer: true
Create MaintenanceWindow Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new MaintenanceWindow(name: string, args: MaintenanceWindowArgs, opts?: CustomResourceOptions);
@overload
def MaintenanceWindow(resource_name: str,
args: MaintenanceWindowArgs,
opts: Optional[ResourceOptions] = None)
@overload
def MaintenanceWindow(resource_name: str,
opts: Optional[ResourceOptions] = None,
day_of_week: Optional[int] = None,
project_id: Optional[str] = None,
auto_defer: Optional[bool] = None,
auto_defer_once_enabled: Optional[bool] = None,
defer: Optional[bool] = None,
hour_of_day: Optional[int] = None,
start_asap: Optional[bool] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var maintenanceWindowResource = new Mongodbatlas.MaintenanceWindow("maintenanceWindowResource", new()
{
DayOfWeek = 0,
ProjectId = "string",
AutoDefer = false,
AutoDeferOnceEnabled = false,
Defer = false,
HourOfDay = 0,
StartAsap = false,
});
example, err := mongodbatlas.NewMaintenanceWindow(ctx, "maintenanceWindowResource", &mongodbatlas.MaintenanceWindowArgs{
DayOfWeek: pulumi.Int(0),
ProjectId: pulumi.String("string"),
AutoDefer: pulumi.Bool(false),
AutoDeferOnceEnabled: pulumi.Bool(false),
Defer: pulumi.Bool(false),
HourOfDay: pulumi.Int(0),
StartAsap: pulumi.Bool(false),
})
var maintenanceWindowResource = new MaintenanceWindow("maintenanceWindowResource", MaintenanceWindowArgs.builder()
.dayOfWeek(0)
.projectId("string")
.autoDefer(false)
.autoDeferOnceEnabled(false)
.defer(false)
.hourOfDay(0)
.startAsap(false)
.build());
maintenance_window_resource = mongodbatlas.MaintenanceWindow("maintenanceWindowResource",
day_of_week=0,
project_id="string",
auto_defer=False,
auto_defer_once_enabled=False,
defer=False,
hour_of_day=0,
start_asap=False)
const maintenanceWindowResource = new mongodbatlas.MaintenanceWindow("maintenanceWindowResource", {
dayOfWeek: 0,
projectId: "string",
autoDefer: false,
autoDeferOnceEnabled: false,
defer: false,
hourOfDay: 0,
startAsap: false,
});
type: mongodbatlas:MaintenanceWindow
properties:
autoDefer: false
autoDeferOnceEnabled: false
dayOfWeek: 0
defer: false
hourOfDay: 0
projectId: string
startAsap: false
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The MaintenanceWindow resource accepts the following input properties:
- Day
Of intWeek - Day of the week when you would like the maintenance window to start as a 1-based integer: Su=1, M=2, T=3, W=4, T=5, F=6, Sa=7.
- Project
Id string - 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 boolOnce Enabled - Defer bool
- Defer the next scheduled maintenance for the given project for one week.
- Hour
Of intDay - 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).
- 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.
- Day
Of intWeek - Day of the week when you would like the maintenance window to start as a 1-based integer: Su=1, M=2, T=3, W=4, T=5, F=6, Sa=7.
- Project
Id string - 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 boolOnce Enabled - Defer bool
- Defer the next scheduled maintenance for the given project for one week.
- Hour
Of intDay - 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).
- 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.
- day
Of IntegerWeek - Day of the week when you would like the maintenance window to start as a 1-based integer: Su=1, M=2, T=3, W=4, T=5, F=6, Sa=7.
- project
Id String - The unique identifier of the project for the Maintenance Window.
- auto
Defer Boolean - Defer any scheduled maintenance for the given project for one week.
- auto
Defer BooleanOnce Enabled - defer Boolean
- Defer the next scheduled maintenance for the given project for one week.
- hour
Of IntegerDay - 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).
- start
Asap 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 numberWeek - Day of the week when you would like the maintenance window to start as a 1-based integer: Su=1, M=2, T=3, W=4, T=5, F=6, Sa=7.
- project
Id string - The unique identifier of the project for the Maintenance Window.
- auto
Defer boolean - Defer any scheduled maintenance for the given project for one week.
- auto
Defer booleanOnce Enabled - defer boolean
- Defer the next scheduled maintenance for the given project for one week.
- hour
Of numberDay - 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).
- start
Asap 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_ intweek - Day of the week when you would like the maintenance window to start as a 1-based integer: Su=1, M=2, T=3, W=4, T=5, F=6, Sa=7.
- 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_ boolonce_ enabled - defer bool
- Defer the next scheduled maintenance for the given project for one week.
- hour_
of_ intday - 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).
- 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.
- day
Of NumberWeek - Day of the week when you would like the maintenance window to start as a 1-based integer: Su=1, M=2, T=3, W=4, T=5, F=6, Sa=7.
- project
Id String - The unique identifier of the project for the Maintenance Window.
- auto
Defer Boolean - Defer any scheduled maintenance for the given project for one week.
- auto
Defer BooleanOnce Enabled - defer Boolean
- Defer the next scheduled maintenance for the given project for one week.
- hour
Of NumberDay - 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).
- start
Asap 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.
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.
- Number
Of intDeferrals - Number of times the current maintenance event for this project has been deferred, there can be a maximum of 2 deferrals.
- Id string
- The provider-assigned unique ID for this managed resource.
- Number
Of intDeferrals - Number of times the current maintenance event for this project has been deferred, there can be a maximum of 2 deferrals.
- id String
- The provider-assigned unique ID for this managed resource.
- number
Of IntegerDeferrals - Number of times the current maintenance event for this project has been deferred, there can be a maximum of 2 deferrals.
- id string
- The provider-assigned unique ID for this managed resource.
- number
Of numberDeferrals - Number of times the current maintenance event for this project has been deferred, there can be a maximum of 2 deferrals.
- id str
- The provider-assigned unique ID for this managed resource.
- number_
of_ intdeferrals - Number of times the current maintenance event for this project has been deferred, there can be a maximum of 2 deferrals.
- id String
- The provider-assigned unique ID for this managed resource.
- number
Of NumberDeferrals - Number of times the current maintenance event for this project has been deferred, there can be a maximum of 2 deferrals.
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.
- Auto
Defer bool - Defer any scheduled maintenance for the given project for one week.
- Auto
Defer boolOnce Enabled - Day
Of intWeek - Day of the week when you would like the maintenance window to start as a 1-based integer: Su=1, M=2, T=3, W=4, T=5, F=6, Sa=7.
- Defer bool
- Defer the next scheduled maintenance for the given project for one week.
- Hour
Of intDay - 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 intDeferrals - Number of times the current maintenance event for this project has been deferred, there can be a maximum of 2 deferrals.
- Project
Id string - 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.
- Auto
Defer bool - Defer any scheduled maintenance for the given project for one week.
- Auto
Defer boolOnce Enabled - Day
Of intWeek - Day of the week when you would like the maintenance window to start as a 1-based integer: Su=1, M=2, T=3, W=4, T=5, F=6, Sa=7.
- Defer bool
- Defer the next scheduled maintenance for the given project for one week.
- Hour
Of intDay - 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 intDeferrals - Number of times the current maintenance event for this project has been deferred, there can be a maximum of 2 deferrals.
- Project
Id string - 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.
- auto
Defer Boolean - Defer any scheduled maintenance for the given project for one week.
- auto
Defer BooleanOnce Enabled - day
Of IntegerWeek - Day of the week when you would like the maintenance window to start as a 1-based integer: Su=1, M=2, T=3, W=4, T=5, F=6, Sa=7.
- defer Boolean
- Defer the next scheduled maintenance for the given project for one week.
- hour
Of IntegerDay - 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 IntegerDeferrals - Number of times the current maintenance event for this project has been deferred, there can be a maximum of 2 deferrals.
- project
Id String - The unique identifier of the project for the Maintenance Window.
- start
Asap 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 boolean - Defer any scheduled maintenance for the given project for one week.
- auto
Defer booleanOnce Enabled - day
Of numberWeek - Day of the week when you would like the maintenance window to start as a 1-based integer: Su=1, M=2, T=3, W=4, T=5, F=6, Sa=7.
- defer boolean
- Defer the next scheduled maintenance for the given project for one week.
- hour
Of numberDay - 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 numberDeferrals - Number of times the current maintenance event for this project has been deferred, there can be a maximum of 2 deferrals.
- project
Id string - The unique identifier of the project for the Maintenance Window.
- start
Asap 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_ boolonce_ enabled - day_
of_ intweek - Day of the week when you would like the maintenance window to start as a 1-based integer: Su=1, M=2, T=3, W=4, T=5, F=6, Sa=7.
- defer bool
- Defer the next scheduled maintenance for the given project for one week.
- hour_
of_ intday - 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_ intdeferrals - Number of times the current maintenance event for this project has been deferred, there can be 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.
- auto
Defer Boolean - Defer any scheduled maintenance for the given project for one week.
- auto
Defer BooleanOnce Enabled - day
Of NumberWeek - Day of the week when you would like the maintenance window to start as a 1-based integer: Su=1, M=2, T=3, W=4, T=5, F=6, Sa=7.
- defer Boolean
- Defer the next scheduled maintenance for the given project for one week.
- hour
Of NumberDay - 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 NumberDeferrals - Number of times the current maintenance event for this project has been deferred, there can be a maximum of 2 deferrals.
- project
Id String - The unique identifier of the project for the Maintenance Window.
- start
Asap 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 see: MongoDB Atlas API Reference.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- MongoDB Atlas pulumi/pulumi-mongodbatlas
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
mongodbatlas
Terraform Provider.