1. Packages
  2. Mongodbatlas Provider
  3. API Docs
  4. getMaintenanceWindow
MongoDB Atlas v3.20.4 published on Wednesday, Oct 30, 2024 by Pulumi

mongodbatlas.getMaintenanceWindow

Explore with Pulumi AI

mongodbatlas logo
MongoDB Atlas v3.20.4 published on Wednesday, Oct 30, 2024 by Pulumi

    # Data Source: mongodbatlas.MaintenanceWindow

    mongodbatlas.MaintenanceWindow provides a Maintenance Window entry datasource. Gets information regarding the configured maintenance window for a MongoDB Atlas project.

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

    Examples Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as mongodbatlas from "@pulumi/mongodbatlas";
    
    const testMaintenanceWindow = new mongodbatlas.MaintenanceWindow("test", {
        projectId: "<your-project-id>",
        dayOfWeek: 3,
        hourOfDay: 4,
        autoDeferOnceEnabled: true,
    });
    const test = mongodbatlas.getMaintenanceWindowOutput({
        projectId: testMaintenanceWindow.id,
    });
    
    import pulumi
    import pulumi_mongodbatlas as mongodbatlas
    
    test_maintenance_window = mongodbatlas.MaintenanceWindow("test",
        project_id="<your-project-id>",
        day_of_week=3,
        hour_of_day=4,
        auto_defer_once_enabled=True)
    test = mongodbatlas.get_maintenance_window_output(project_id=test_maintenance_window.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 {
    		testMaintenanceWindow, err := mongodbatlas.NewMaintenanceWindow(ctx, "test", &mongodbatlas.MaintenanceWindowArgs{
    			ProjectId:            pulumi.String("<your-project-id>"),
    			DayOfWeek:            pulumi.Int(3),
    			HourOfDay:            pulumi.Int(4),
    			AutoDeferOnceEnabled: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_ = mongodbatlas.LookupMaintenanceWindowOutput(ctx, mongodbatlas.GetMaintenanceWindowOutputArgs{
    			ProjectId: testMaintenanceWindow.ID(),
    		}, nil)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Mongodbatlas = Pulumi.Mongodbatlas;
    
    return await Deployment.RunAsync(() => 
    {
        var testMaintenanceWindow = new Mongodbatlas.MaintenanceWindow("test", new()
        {
            ProjectId = "<your-project-id>",
            DayOfWeek = 3,
            HourOfDay = 4,
            AutoDeferOnceEnabled = true,
        });
    
        var test = Mongodbatlas.GetMaintenanceWindow.Invoke(new()
        {
            ProjectId = testMaintenanceWindow.Id,
        });
    
    });
    
    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 com.pulumi.mongodbatlas.MongodbatlasFunctions;
    import com.pulumi.mongodbatlas.inputs.GetMaintenanceWindowArgs;
    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 testMaintenanceWindow = new MaintenanceWindow("testMaintenanceWindow", MaintenanceWindowArgs.builder()
                .projectId("<your-project-id>")
                .dayOfWeek(3)
                .hourOfDay(4)
                .autoDeferOnceEnabled(true)
                .build());
    
            final var test = MongodbatlasFunctions.getMaintenanceWindow(GetMaintenanceWindowArgs.builder()
                .projectId(testMaintenanceWindow.id())
                .build());
    
        }
    }
    
    resources:
      testMaintenanceWindow:
        type: mongodbatlas:MaintenanceWindow
        name: test
        properties:
          projectId: <your-project-id>
          dayOfWeek: 3
          hourOfDay: 4
          autoDeferOnceEnabled: true
    variables:
      test:
        fn::invoke:
          Function: mongodbatlas:getMaintenanceWindow
          Arguments:
            projectId: ${testMaintenanceWindow.id}
    
    import * as pulumi from "@pulumi/pulumi";
    import * as mongodbatlas from "@pulumi/mongodbatlas";
    
    const testMaintenanceWindow = new mongodbatlas.MaintenanceWindow("test", {
        projectId: "<your-project-id>",
        startAsap: true,
    });
    const test = mongodbatlas.getMaintenanceWindowOutput({
        projectId: testMaintenanceWindow.id,
    });
    
    import pulumi
    import pulumi_mongodbatlas as mongodbatlas
    
    test_maintenance_window = mongodbatlas.MaintenanceWindow("test",
        project_id="<your-project-id>",
        start_asap=True)
    test = mongodbatlas.get_maintenance_window_output(project_id=test_maintenance_window.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 {
    		testMaintenanceWindow, err := mongodbatlas.NewMaintenanceWindow(ctx, "test", &mongodbatlas.MaintenanceWindowArgs{
    			ProjectId: pulumi.String("<your-project-id>"),
    			StartAsap: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_ = mongodbatlas.LookupMaintenanceWindowOutput(ctx, mongodbatlas.GetMaintenanceWindowOutputArgs{
    			ProjectId: testMaintenanceWindow.ID(),
    		}, nil)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Mongodbatlas = Pulumi.Mongodbatlas;
    
    return await Deployment.RunAsync(() => 
    {
        var testMaintenanceWindow = new Mongodbatlas.MaintenanceWindow("test", new()
        {
            ProjectId = "<your-project-id>",
            StartAsap = true,
        });
    
        var test = Mongodbatlas.GetMaintenanceWindow.Invoke(new()
        {
            ProjectId = testMaintenanceWindow.Id,
        });
    
    });
    
    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 com.pulumi.mongodbatlas.MongodbatlasFunctions;
    import com.pulumi.mongodbatlas.inputs.GetMaintenanceWindowArgs;
    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 testMaintenanceWindow = new MaintenanceWindow("testMaintenanceWindow", MaintenanceWindowArgs.builder()
                .projectId("<your-project-id>")
                .startAsap(true)
                .build());
    
            final var test = MongodbatlasFunctions.getMaintenanceWindow(GetMaintenanceWindowArgs.builder()
                .projectId(testMaintenanceWindow.id())
                .build());
    
        }
    }
    
    resources:
      testMaintenanceWindow:
        type: mongodbatlas:MaintenanceWindow
        name: test
        properties:
          projectId: <your-project-id>
          startAsap: true
    variables:
      test:
        fn::invoke:
          Function: mongodbatlas:getMaintenanceWindow
          Arguments:
            projectId: ${testMaintenanceWindow.id}
    

    Using getMaintenanceWindow

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getMaintenanceWindow(args: GetMaintenanceWindowArgs, opts?: InvokeOptions): Promise<GetMaintenanceWindowResult>
    function getMaintenanceWindowOutput(args: GetMaintenanceWindowOutputArgs, opts?: InvokeOptions): Output<GetMaintenanceWindowResult>
    def get_maintenance_window(project_id: Optional[str] = None,
                               opts: Optional[InvokeOptions] = None) -> GetMaintenanceWindowResult
    def get_maintenance_window_output(project_id: Optional[pulumi.Input[str]] = None,
                               opts: Optional[InvokeOptions] = None) -> Output[GetMaintenanceWindowResult]
    func LookupMaintenanceWindow(ctx *Context, args *LookupMaintenanceWindowArgs, opts ...InvokeOption) (*LookupMaintenanceWindowResult, error)
    func LookupMaintenanceWindowOutput(ctx *Context, args *LookupMaintenanceWindowOutputArgs, opts ...InvokeOption) LookupMaintenanceWindowResultOutput

    > Note: This function is named LookupMaintenanceWindow in the Go SDK.

    public static class GetMaintenanceWindow 
    {
        public static Task<GetMaintenanceWindowResult> InvokeAsync(GetMaintenanceWindowArgs args, InvokeOptions? opts = null)
        public static Output<GetMaintenanceWindowResult> Invoke(GetMaintenanceWindowInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetMaintenanceWindowResult> getMaintenanceWindow(GetMaintenanceWindowArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: mongodbatlas:index/getMaintenanceWindow:getMaintenanceWindow
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ProjectId string
    The unique identifier of the project for the Maintenance Window.
    ProjectId string
    The unique identifier of the project for the Maintenance Window.
    projectId String
    The unique identifier of the project for the Maintenance Window.
    projectId string
    The unique identifier of the project for the Maintenance Window.
    project_id str
    The unique identifier of the project for the Maintenance Window.
    projectId String
    The unique identifier of the project for the Maintenance Window.

    getMaintenanceWindow Result

    The following output properties are available:

    AutoDeferOnceEnabled bool
    Flag that indicates whether you want to defer all maintenance windows one week they would be triggered. For more information see: MongoDB Atlas API Reference.
    DayOfWeek int
    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.
    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).
    Id string
    The provider-assigned unique ID for this managed resource.
    NumberOfDeferrals int
    Number of times the current maintenance event for this project has been deferred, there can be a maximum of 2 deferrals.
    ProjectId string
    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.
    AutoDeferOnceEnabled bool
    Flag that indicates whether you want to defer all maintenance windows one week they would be triggered. For more information see: MongoDB Atlas API Reference.
    DayOfWeek int
    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.
    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).
    Id string
    The provider-assigned unique ID for this managed resource.
    NumberOfDeferrals int
    Number of times the current maintenance event for this project has been deferred, there can be a maximum of 2 deferrals.
    ProjectId string
    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.
    autoDeferOnceEnabled Boolean
    Flag that indicates whether you want to defer all maintenance windows one week they would be triggered. For more information see: MongoDB Atlas API Reference.
    dayOfWeek Integer
    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.
    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).
    id String
    The provider-assigned unique ID for this managed resource.
    numberOfDeferrals Integer
    Number of times the current maintenance event for this project has been deferred, there can be a maximum of 2 deferrals.
    projectId String
    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.
    autoDeferOnceEnabled boolean
    Flag that indicates whether you want to defer all maintenance windows one week they would be triggered. For more information see: MongoDB Atlas API Reference.
    dayOfWeek number
    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.
    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).
    id string
    The provider-assigned unique ID for this managed resource.
    numberOfDeferrals number
    Number of times the current maintenance event for this project has been deferred, there can be a maximum of 2 deferrals.
    projectId string
    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_once_enabled bool
    Flag that indicates whether you want to defer all maintenance windows one week they would be triggered. For more information see: MongoDB Atlas API Reference.
    day_of_week int
    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.
    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).
    id str
    The provider-assigned unique ID for this managed resource.
    number_of_deferrals int
    Number of times the current maintenance event for this project has been deferred, there can be a maximum of 2 deferrals.
    project_id str
    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.
    autoDeferOnceEnabled Boolean
    Flag that indicates whether you want to defer all maintenance windows one week they would be triggered. For more information see: MongoDB Atlas API Reference.
    dayOfWeek Number
    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.
    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).
    id String
    The provider-assigned unique ID for this managed resource.
    numberOfDeferrals Number
    Number of times the current maintenance event for this project has been deferred, there can be a maximum of 2 deferrals.
    projectId String
    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.

    Package Details

    Repository
    MongoDB Atlas pulumi/pulumi-mongodbatlas
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the mongodbatlas Terraform Provider.
    mongodbatlas logo
    MongoDB Atlas v3.20.4 published on Wednesday, Oct 30, 2024 by Pulumi