1. Packages
  2. MongoDB Atlas
  3. API Docs
  4. ClusterOutageSimulation
MongoDB Atlas v3.14.3 published on Monday, Apr 1, 2024 by Pulumi

mongodbatlas.ClusterOutageSimulation

Explore with Pulumi AI

mongodbatlas logo
MongoDB Atlas v3.14.3 published on Monday, Apr 1, 2024 by Pulumi

    mongodbatlas.ClusterOutageSimulation provides a Cluster Outage Simulation resource. For more details see https://www.mongodb.com/docs/atlas/tutorial/test-resilience/simulate-regional-outage/

    Test Outage on Minority of Electable Nodes - Select fewer than half of your electable nodes.

    Test Outage on Majority of Electable Nodes - Select at least one more than half of your electable nodes and keep at least one electable node remaining.

    IMPORTANT: Test Outage on Majority of Electable Nodes will leave the Atlas cluster without a majority quorum. There will be no primary so write operations will not succeed, and reads will succeed only when configured with a suitable readPreference. To recover the majority quorum, you will have the option to manually reconfigure your cluster by adding new nodes to existing regions or adding new regions at the risk of losing recent writes, or end the simulation.

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

    IMPORTANT: This resource cannot be updated. IMPORTANT: An existing Cluster Outage Simulation cannot be imported as this resource does not support import operation.

    Example Usage

    S

    import * as pulumi from "@pulumi/pulumi";
    import * as mongodbatlas from "@pulumi/mongodbatlas";
    
    const outageSimulation = new mongodbatlas.ClusterOutageSimulation("outageSimulation", {
        clusterName: "Cluster0",
        outageFilters: [
            {
                cloudProvider: "AWS",
                regionName: "US_EAST_1",
            },
            {
                cloudProvider: "AWS",
                regionName: "US_EAST_2",
            },
        ],
        projectId: "64707f06c519c20c3a2b1b03",
    });
    
    import pulumi
    import pulumi_mongodbatlas as mongodbatlas
    
    outage_simulation = mongodbatlas.ClusterOutageSimulation("outageSimulation",
        cluster_name="Cluster0",
        outage_filters=[
            mongodbatlas.ClusterOutageSimulationOutageFilterArgs(
                cloud_provider="AWS",
                region_name="US_EAST_1",
            ),
            mongodbatlas.ClusterOutageSimulationOutageFilterArgs(
                cloud_provider="AWS",
                region_name="US_EAST_2",
            ),
        ],
        project_id="64707f06c519c20c3a2b1b03")
    
    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.NewClusterOutageSimulation(ctx, "outageSimulation", &mongodbatlas.ClusterOutageSimulationArgs{
    			ClusterName: pulumi.String("Cluster0"),
    			OutageFilters: mongodbatlas.ClusterOutageSimulationOutageFilterArray{
    				&mongodbatlas.ClusterOutageSimulationOutageFilterArgs{
    					CloudProvider: pulumi.String("AWS"),
    					RegionName:    pulumi.String("US_EAST_1"),
    				},
    				&mongodbatlas.ClusterOutageSimulationOutageFilterArgs{
    					CloudProvider: pulumi.String("AWS"),
    					RegionName:    pulumi.String("US_EAST_2"),
    				},
    			},
    			ProjectId: pulumi.String("64707f06c519c20c3a2b1b03"),
    		})
    		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 outageSimulation = new Mongodbatlas.ClusterOutageSimulation("outageSimulation", new()
        {
            ClusterName = "Cluster0",
            OutageFilters = new[]
            {
                new Mongodbatlas.Inputs.ClusterOutageSimulationOutageFilterArgs
                {
                    CloudProvider = "AWS",
                    RegionName = "US_EAST_1",
                },
                new Mongodbatlas.Inputs.ClusterOutageSimulationOutageFilterArgs
                {
                    CloudProvider = "AWS",
                    RegionName = "US_EAST_2",
                },
            },
            ProjectId = "64707f06c519c20c3a2b1b03",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.mongodbatlas.ClusterOutageSimulation;
    import com.pulumi.mongodbatlas.ClusterOutageSimulationArgs;
    import com.pulumi.mongodbatlas.inputs.ClusterOutageSimulationOutageFilterArgs;
    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 outageSimulation = new ClusterOutageSimulation("outageSimulation", ClusterOutageSimulationArgs.builder()        
                .clusterName("Cluster0")
                .outageFilters(            
                    ClusterOutageSimulationOutageFilterArgs.builder()
                        .cloudProvider("AWS")
                        .regionName("US_EAST_1")
                        .build(),
                    ClusterOutageSimulationOutageFilterArgs.builder()
                        .cloudProvider("AWS")
                        .regionName("US_EAST_2")
                        .build())
                .projectId("64707f06c519c20c3a2b1b03")
                .build());
    
        }
    }
    
    resources:
      outageSimulation:
        type: mongodbatlas:ClusterOutageSimulation
        properties:
          clusterName: Cluster0
          outageFilters:
            - cloudProvider: AWS
              regionName: US_EAST_1
            - cloudProvider: AWS
              regionName: US_EAST_2
          projectId: 64707f06c519c20c3a2b1b03
    

    Create ClusterOutageSimulation Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ClusterOutageSimulation(name: string, args: ClusterOutageSimulationArgs, opts?: CustomResourceOptions);
    @overload
    def ClusterOutageSimulation(resource_name: str,
                                args: ClusterOutageSimulationArgs,
                                opts: Optional[ResourceOptions] = None)
    
    @overload
    def ClusterOutageSimulation(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                cluster_name: Optional[str] = None,
                                outage_filters: Optional[Sequence[ClusterOutageSimulationOutageFilterArgs]] = None,
                                project_id: Optional[str] = None)
    func NewClusterOutageSimulation(ctx *Context, name string, args ClusterOutageSimulationArgs, opts ...ResourceOption) (*ClusterOutageSimulation, error)
    public ClusterOutageSimulation(string name, ClusterOutageSimulationArgs args, CustomResourceOptions? opts = null)
    public ClusterOutageSimulation(String name, ClusterOutageSimulationArgs args)
    public ClusterOutageSimulation(String name, ClusterOutageSimulationArgs args, CustomResourceOptions options)
    
    type: mongodbatlas:ClusterOutageSimulation
    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 ClusterOutageSimulationArgs
    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 ClusterOutageSimulationArgs
    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 ClusterOutageSimulationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ClusterOutageSimulationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ClusterOutageSimulationArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var clusterOutageSimulationResource = new Mongodbatlas.ClusterOutageSimulation("clusterOutageSimulationResource", new()
    {
        ClusterName = "string",
        OutageFilters = new[]
        {
            new Mongodbatlas.Inputs.ClusterOutageSimulationOutageFilterArgs
            {
                CloudProvider = "string",
                RegionName = "string",
                Type = "string",
            },
        },
        ProjectId = "string",
    });
    
    example, err := mongodbatlas.NewClusterOutageSimulation(ctx, "clusterOutageSimulationResource", &mongodbatlas.ClusterOutageSimulationArgs{
    	ClusterName: pulumi.String("string"),
    	OutageFilters: mongodbatlas.ClusterOutageSimulationOutageFilterArray{
    		&mongodbatlas.ClusterOutageSimulationOutageFilterArgs{
    			CloudProvider: pulumi.String("string"),
    			RegionName:    pulumi.String("string"),
    			Type:          pulumi.String("string"),
    		},
    	},
    	ProjectId: pulumi.String("string"),
    })
    
    var clusterOutageSimulationResource = new ClusterOutageSimulation("clusterOutageSimulationResource", ClusterOutageSimulationArgs.builder()        
        .clusterName("string")
        .outageFilters(ClusterOutageSimulationOutageFilterArgs.builder()
            .cloudProvider("string")
            .regionName("string")
            .type("string")
            .build())
        .projectId("string")
        .build());
    
    cluster_outage_simulation_resource = mongodbatlas.ClusterOutageSimulation("clusterOutageSimulationResource",
        cluster_name="string",
        outage_filters=[mongodbatlas.ClusterOutageSimulationOutageFilterArgs(
            cloud_provider="string",
            region_name="string",
            type="string",
        )],
        project_id="string")
    
    const clusterOutageSimulationResource = new mongodbatlas.ClusterOutageSimulation("clusterOutageSimulationResource", {
        clusterName: "string",
        outageFilters: [{
            cloudProvider: "string",
            regionName: "string",
            type: "string",
        }],
        projectId: "string",
    });
    
    type: mongodbatlas:ClusterOutageSimulation
    properties:
        clusterName: string
        outageFilters:
            - cloudProvider: string
              regionName: string
              type: string
        projectId: string
    

    ClusterOutageSimulation 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 ClusterOutageSimulation resource accepts the following input properties:

    ClusterName string
    Name of the Atlas Cluster that is/will undergoing outage simulation.
    OutageFilters List<ClusterOutageSimulationOutageFilter>
    List of settings that specify the type of cluster outage simulation.
    ProjectId string
    The unique ID for the project that contains the cluster that is/will undergoing outage simulation.
    ClusterName string
    Name of the Atlas Cluster that is/will undergoing outage simulation.
    OutageFilters []ClusterOutageSimulationOutageFilterArgs
    List of settings that specify the type of cluster outage simulation.
    ProjectId string
    The unique ID for the project that contains the cluster that is/will undergoing outage simulation.
    clusterName String
    Name of the Atlas Cluster that is/will undergoing outage simulation.
    outageFilters List<ClusterOutageSimulationOutageFilter>
    List of settings that specify the type of cluster outage simulation.
    projectId String
    The unique ID for the project that contains the cluster that is/will undergoing outage simulation.
    clusterName string
    Name of the Atlas Cluster that is/will undergoing outage simulation.
    outageFilters ClusterOutageSimulationOutageFilter[]
    List of settings that specify the type of cluster outage simulation.
    projectId string
    The unique ID for the project that contains the cluster that is/will undergoing outage simulation.
    cluster_name str
    Name of the Atlas Cluster that is/will undergoing outage simulation.
    outage_filters Sequence[ClusterOutageSimulationOutageFilterArgs]
    List of settings that specify the type of cluster outage simulation.
    project_id str
    The unique ID for the project that contains the cluster that is/will undergoing outage simulation.
    clusterName String
    Name of the Atlas Cluster that is/will undergoing outage simulation.
    outageFilters List<Property Map>
    List of settings that specify the type of cluster outage simulation.
    projectId String
    The unique ID for the project that contains the cluster that is/will undergoing outage simulation.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    SimulationId string
    Unique 24-hexadecimal character string that identifies the outage simulation.
    StartRequestDate string
    Date and time when MongoDB Cloud started the regional outage simulation.
    State string
    Current phase of the outage simulation:
    Id string
    The provider-assigned unique ID for this managed resource.
    SimulationId string
    Unique 24-hexadecimal character string that identifies the outage simulation.
    StartRequestDate string
    Date and time when MongoDB Cloud started the regional outage simulation.
    State string
    Current phase of the outage simulation:
    id String
    The provider-assigned unique ID for this managed resource.
    simulationId String
    Unique 24-hexadecimal character string that identifies the outage simulation.
    startRequestDate String
    Date and time when MongoDB Cloud started the regional outage simulation.
    state String
    Current phase of the outage simulation:
    id string
    The provider-assigned unique ID for this managed resource.
    simulationId string
    Unique 24-hexadecimal character string that identifies the outage simulation.
    startRequestDate string
    Date and time when MongoDB Cloud started the regional outage simulation.
    state string
    Current phase of the outage simulation:
    id str
    The provider-assigned unique ID for this managed resource.
    simulation_id str
    Unique 24-hexadecimal character string that identifies the outage simulation.
    start_request_date str
    Date and time when MongoDB Cloud started the regional outage simulation.
    state str
    Current phase of the outage simulation:
    id String
    The provider-assigned unique ID for this managed resource.
    simulationId String
    Unique 24-hexadecimal character string that identifies the outage simulation.
    startRequestDate String
    Date and time when MongoDB Cloud started the regional outage simulation.
    state String
    Current phase of the outage simulation:

    Look up Existing ClusterOutageSimulation Resource

    Get an existing ClusterOutageSimulation 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?: ClusterOutageSimulationState, opts?: CustomResourceOptions): ClusterOutageSimulation
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cluster_name: Optional[str] = None,
            outage_filters: Optional[Sequence[ClusterOutageSimulationOutageFilterArgs]] = None,
            project_id: Optional[str] = None,
            simulation_id: Optional[str] = None,
            start_request_date: Optional[str] = None,
            state: Optional[str] = None) -> ClusterOutageSimulation
    func GetClusterOutageSimulation(ctx *Context, name string, id IDInput, state *ClusterOutageSimulationState, opts ...ResourceOption) (*ClusterOutageSimulation, error)
    public static ClusterOutageSimulation Get(string name, Input<string> id, ClusterOutageSimulationState? state, CustomResourceOptions? opts = null)
    public static ClusterOutageSimulation get(String name, Output<String> id, ClusterOutageSimulationState 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:
    ClusterName string
    Name of the Atlas Cluster that is/will undergoing outage simulation.
    OutageFilters List<ClusterOutageSimulationOutageFilter>
    List of settings that specify the type of cluster outage simulation.
    ProjectId string
    The unique ID for the project that contains the cluster that is/will undergoing outage simulation.
    SimulationId string
    Unique 24-hexadecimal character string that identifies the outage simulation.
    StartRequestDate string
    Date and time when MongoDB Cloud started the regional outage simulation.
    State string
    Current phase of the outage simulation:
    ClusterName string
    Name of the Atlas Cluster that is/will undergoing outage simulation.
    OutageFilters []ClusterOutageSimulationOutageFilterArgs
    List of settings that specify the type of cluster outage simulation.
    ProjectId string
    The unique ID for the project that contains the cluster that is/will undergoing outage simulation.
    SimulationId string
    Unique 24-hexadecimal character string that identifies the outage simulation.
    StartRequestDate string
    Date and time when MongoDB Cloud started the regional outage simulation.
    State string
    Current phase of the outage simulation:
    clusterName String
    Name of the Atlas Cluster that is/will undergoing outage simulation.
    outageFilters List<ClusterOutageSimulationOutageFilter>
    List of settings that specify the type of cluster outage simulation.
    projectId String
    The unique ID for the project that contains the cluster that is/will undergoing outage simulation.
    simulationId String
    Unique 24-hexadecimal character string that identifies the outage simulation.
    startRequestDate String
    Date and time when MongoDB Cloud started the regional outage simulation.
    state String
    Current phase of the outage simulation:
    clusterName string
    Name of the Atlas Cluster that is/will undergoing outage simulation.
    outageFilters ClusterOutageSimulationOutageFilter[]
    List of settings that specify the type of cluster outage simulation.
    projectId string
    The unique ID for the project that contains the cluster that is/will undergoing outage simulation.
    simulationId string
    Unique 24-hexadecimal character string that identifies the outage simulation.
    startRequestDate string
    Date and time when MongoDB Cloud started the regional outage simulation.
    state string
    Current phase of the outage simulation:
    cluster_name str
    Name of the Atlas Cluster that is/will undergoing outage simulation.
    outage_filters Sequence[ClusterOutageSimulationOutageFilterArgs]
    List of settings that specify the type of cluster outage simulation.
    project_id str
    The unique ID for the project that contains the cluster that is/will undergoing outage simulation.
    simulation_id str
    Unique 24-hexadecimal character string that identifies the outage simulation.
    start_request_date str
    Date and time when MongoDB Cloud started the regional outage simulation.
    state str
    Current phase of the outage simulation:
    clusterName String
    Name of the Atlas Cluster that is/will undergoing outage simulation.
    outageFilters List<Property Map>
    List of settings that specify the type of cluster outage simulation.
    projectId String
    The unique ID for the project that contains the cluster that is/will undergoing outage simulation.
    simulationId String
    Unique 24-hexadecimal character string that identifies the outage simulation.
    startRequestDate String
    Date and time when MongoDB Cloud started the regional outage simulation.
    state String
    Current phase of the outage simulation:

    Supporting Types

    ClusterOutageSimulationOutageFilter, ClusterOutageSimulationOutageFilterArgs

    CloudProvider string
    The cloud provider of the region that undergoes the outage simulation. Following values are supported:
    RegionName string
    The Atlas name of the region to undergo an outage simulation.
    Type string
    The type of cluster outage simulation. Following values are supported:
    CloudProvider string
    The cloud provider of the region that undergoes the outage simulation. Following values are supported:
    RegionName string
    The Atlas name of the region to undergo an outage simulation.
    Type string
    The type of cluster outage simulation. Following values are supported:
    cloudProvider String
    The cloud provider of the region that undergoes the outage simulation. Following values are supported:
    regionName String
    The Atlas name of the region to undergo an outage simulation.
    type String
    The type of cluster outage simulation. Following values are supported:
    cloudProvider string
    The cloud provider of the region that undergoes the outage simulation. Following values are supported:
    regionName string
    The Atlas name of the region to undergo an outage simulation.
    type string
    The type of cluster outage simulation. Following values are supported:
    cloud_provider str
    The cloud provider of the region that undergoes the outage simulation. Following values are supported:
    region_name str
    The Atlas name of the region to undergo an outage simulation.
    type str
    The type of cluster outage simulation. Following values are supported:
    cloudProvider String
    The cloud provider of the region that undergoes the outage simulation. Following values are supported:
    regionName String
    The Atlas name of the region to undergo an outage simulation.
    type String
    The type of cluster outage simulation. Following values are supported:

    Import

    The mongodbatlas_cluster_outage_simulation resource does not support import operation.

    See MongoDB Atlas API Documentation for more information.

    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.
    mongodbatlas logo
    MongoDB Atlas v3.14.3 published on Monday, Apr 1, 2024 by Pulumi