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

mongodbatlas.getServerlessInstance

Explore with Pulumi AI

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

    mongodbatlas.ServerlessInstance describe a single serverless instance. This represents a single serverless instance that have been created.

    NOTE: Serverless instances do not support some Atlas features at this time. For a full list of unsupported features, see Serverless Instance Limitations.

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

    Example Usage

    Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as mongodbatlas from "@pulumi/mongodbatlas";
    
    const testTwo = mongodbatlas.getServerlessInstance({
        name: "<SERVERLESS_INSTANCE_NAME>",
        projectId: "<PROJECT_ID >",
    });
    
    import pulumi
    import pulumi_mongodbatlas as mongodbatlas
    
    test_two = mongodbatlas.get_serverless_instance(name="<SERVERLESS_INSTANCE_NAME>",
        project_id="<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.LookupServerlessInstance(ctx, &mongodbatlas.LookupServerlessInstanceArgs{
    			Name:      "<SERVERLESS_INSTANCE_NAME>",
    			ProjectId: "<PROJECT_ID >",
    		}, nil)
    		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 testTwo = Mongodbatlas.GetServerlessInstance.Invoke(new()
        {
            Name = "<SERVERLESS_INSTANCE_NAME>",
            ProjectId = "<PROJECT_ID >",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.mongodbatlas.MongodbatlasFunctions;
    import com.pulumi.mongodbatlas.inputs.GetServerlessInstanceArgs;
    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) {
            final var testTwo = MongodbatlasFunctions.getServerlessInstance(GetServerlessInstanceArgs.builder()
                .name("<SERVERLESS_INSTANCE_NAME>")
                .projectId("<PROJECT_ID >")
                .build());
    
        }
    }
    
    variables:
      testTwo:
        fn::invoke:
          Function: mongodbatlas:getServerlessInstance
          Arguments:
            name: <SERVERLESS_INSTANCE_NAME>
            projectId: <PROJECT_ID >
    

    NOTE: mongodbatlas.ServerlessInstance and mongodbatlas.PrivatelinkEndpointServiceServerless resources have a circular dependency in some respects.
    That is, the serverless_instance must exist before the privatelink_endpoint_service can be created,
    and the privatelink_endpoint_service must exist before the serverless_instance gets its respective connection_strings_private_endpoint_srv values.

    Because of this, the serverless_instance data source has particular value as a source of the connection_strings_private_endpoint_srv.
    When using the data_source in-tandem with the afforementioned resources, we can create and retrieve the connection_strings_private_endpoint_srv in a single pulumi up.

    Follow this example to setup private connection to a serverless instance using aws vpc and get the connection strings in a single pulumi up

    Using getServerlessInstance

    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 getServerlessInstance(args: GetServerlessInstanceArgs, opts?: InvokeOptions): Promise<GetServerlessInstanceResult>
    function getServerlessInstanceOutput(args: GetServerlessInstanceOutputArgs, opts?: InvokeOptions): Output<GetServerlessInstanceResult>
    def get_serverless_instance(continuous_backup_enabled: Optional[bool] = None,
                                links: Optional[Sequence[GetServerlessInstanceLink]] = None,
                                name: Optional[str] = None,
                                project_id: Optional[str] = None,
                                state_name: Optional[str] = None,
                                opts: Optional[InvokeOptions] = None) -> GetServerlessInstanceResult
    def get_serverless_instance_output(continuous_backup_enabled: Optional[pulumi.Input[bool]] = None,
                                links: Optional[pulumi.Input[Sequence[pulumi.Input[GetServerlessInstanceLinkArgs]]]] = None,
                                name: Optional[pulumi.Input[str]] = None,
                                project_id: Optional[pulumi.Input[str]] = None,
                                state_name: Optional[pulumi.Input[str]] = None,
                                opts: Optional[InvokeOptions] = None) -> Output[GetServerlessInstanceResult]
    func LookupServerlessInstance(ctx *Context, args *LookupServerlessInstanceArgs, opts ...InvokeOption) (*LookupServerlessInstanceResult, error)
    func LookupServerlessInstanceOutput(ctx *Context, args *LookupServerlessInstanceOutputArgs, opts ...InvokeOption) LookupServerlessInstanceResultOutput

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

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

    The following arguments are supported:

    Name string
    Human-readable label that identifies your serverless instance.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies the project that contains your serverless instance.
    ContinuousBackupEnabled bool
    Flag that indicates whether the serverless instance uses Serverless Continuous Backup.
    Links List<GetServerlessInstanceLink>
    StateName string
    Stage of deployment of this serverless instance when the resource made its request.
    Name string
    Human-readable label that identifies your serverless instance.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies the project that contains your serverless instance.
    ContinuousBackupEnabled bool
    Flag that indicates whether the serverless instance uses Serverless Continuous Backup.
    Links []GetServerlessInstanceLink
    StateName string
    Stage of deployment of this serverless instance when the resource made its request.
    name String
    Human-readable label that identifies your serverless instance.
    projectId String
    Unique 24-hexadecimal digit string that identifies the project that contains your serverless instance.
    continuousBackupEnabled Boolean
    Flag that indicates whether the serverless instance uses Serverless Continuous Backup.
    links List<GetServerlessInstanceLink>
    stateName String
    Stage of deployment of this serverless instance when the resource made its request.
    name string
    Human-readable label that identifies your serverless instance.
    projectId string
    Unique 24-hexadecimal digit string that identifies the project that contains your serverless instance.
    continuousBackupEnabled boolean
    Flag that indicates whether the serverless instance uses Serverless Continuous Backup.
    links GetServerlessInstanceLink[]
    stateName string
    Stage of deployment of this serverless instance when the resource made its request.
    name str
    Human-readable label that identifies your serverless instance.
    project_id str
    Unique 24-hexadecimal digit string that identifies the project that contains your serverless instance.
    continuous_backup_enabled bool
    Flag that indicates whether the serverless instance uses Serverless Continuous Backup.
    links Sequence[GetServerlessInstanceLink]
    state_name str
    Stage of deployment of this serverless instance when the resource made its request.
    name String
    Human-readable label that identifies your serverless instance.
    projectId String
    Unique 24-hexadecimal digit string that identifies the project that contains your serverless instance.
    continuousBackupEnabled Boolean
    Flag that indicates whether the serverless instance uses Serverless Continuous Backup.
    links List<Property Map>
    stateName String
    Stage of deployment of this serverless instance when the resource made its request.

    getServerlessInstance Result

    The following output properties are available:

    ConnectionStringsPrivateEndpointSrvs List<string>
    List of Serverless Private Endpoint Connections
    ConnectionStringsStandardSrv string
    Public mongodb+srv:// connection string that you can use to connect to this serverless instance.
    ContinuousBackupEnabled bool
    Flag that indicates whether the serverless instance uses Serverless Continuous Backup.
    CreateDate string
    Id string
    Unique 24-hexadecimal digit string that identifies the serverless instance.
    Links List<GetServerlessInstanceLink>
    MongoDbVersion string
    Version of MongoDB that the serverless instance runs, in <major version>.<minor version> format.
    Name string
    ProjectId string
    ProviderSettingsBackingProviderName string
    Cloud service provider on which MongoDB Cloud provisioned the serverless instance.
    ProviderSettingsProviderName string
    Cloud service provider that applies to the provisioned the serverless instance.
    ProviderSettingsRegionName string
    Human-readable label that identifies the physical location of your MongoDB serverless instance. The region you choose can affect network latency for clients accessing your databases.
    StateName string
    Stage of deployment of this serverless instance when the resource made its request.
    Tags List<GetServerlessInstanceTag>
    Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See below.
    TerminationProtectionEnabled bool
    Flag that indicates whether termination protection is enabled on the cluster. If set to true, MongoDB Cloud won't delete the cluster. If set to false, MongoDB Cloud will delete the cluster.
    ConnectionStringsPrivateEndpointSrvs []string
    List of Serverless Private Endpoint Connections
    ConnectionStringsStandardSrv string
    Public mongodb+srv:// connection string that you can use to connect to this serverless instance.
    ContinuousBackupEnabled bool
    Flag that indicates whether the serverless instance uses Serverless Continuous Backup.
    CreateDate string
    Id string
    Unique 24-hexadecimal digit string that identifies the serverless instance.
    Links []GetServerlessInstanceLink
    MongoDbVersion string
    Version of MongoDB that the serverless instance runs, in <major version>.<minor version> format.
    Name string
    ProjectId string
    ProviderSettingsBackingProviderName string
    Cloud service provider on which MongoDB Cloud provisioned the serverless instance.
    ProviderSettingsProviderName string
    Cloud service provider that applies to the provisioned the serverless instance.
    ProviderSettingsRegionName string
    Human-readable label that identifies the physical location of your MongoDB serverless instance. The region you choose can affect network latency for clients accessing your databases.
    StateName string
    Stage of deployment of this serverless instance when the resource made its request.
    Tags []GetServerlessInstanceTag
    Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See below.
    TerminationProtectionEnabled bool
    Flag that indicates whether termination protection is enabled on the cluster. If set to true, MongoDB Cloud won't delete the cluster. If set to false, MongoDB Cloud will delete the cluster.
    connectionStringsPrivateEndpointSrvs List<String>
    List of Serverless Private Endpoint Connections
    connectionStringsStandardSrv String
    Public mongodb+srv:// connection string that you can use to connect to this serverless instance.
    continuousBackupEnabled Boolean
    Flag that indicates whether the serverless instance uses Serverless Continuous Backup.
    createDate String
    id String
    Unique 24-hexadecimal digit string that identifies the serverless instance.
    links List<GetServerlessInstanceLink>
    mongoDbVersion String
    Version of MongoDB that the serverless instance runs, in <major version>.<minor version> format.
    name String
    projectId String
    providerSettingsBackingProviderName String
    Cloud service provider on which MongoDB Cloud provisioned the serverless instance.
    providerSettingsProviderName String
    Cloud service provider that applies to the provisioned the serverless instance.
    providerSettingsRegionName String
    Human-readable label that identifies the physical location of your MongoDB serverless instance. The region you choose can affect network latency for clients accessing your databases.
    stateName String
    Stage of deployment of this serverless instance when the resource made its request.
    tags List<GetServerlessInstanceTag>
    Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See below.
    terminationProtectionEnabled Boolean
    Flag that indicates whether termination protection is enabled on the cluster. If set to true, MongoDB Cloud won't delete the cluster. If set to false, MongoDB Cloud will delete the cluster.
    connectionStringsPrivateEndpointSrvs string[]
    List of Serverless Private Endpoint Connections
    connectionStringsStandardSrv string
    Public mongodb+srv:// connection string that you can use to connect to this serverless instance.
    continuousBackupEnabled boolean
    Flag that indicates whether the serverless instance uses Serverless Continuous Backup.
    createDate string
    id string
    Unique 24-hexadecimal digit string that identifies the serverless instance.
    links GetServerlessInstanceLink[]
    mongoDbVersion string
    Version of MongoDB that the serverless instance runs, in <major version>.<minor version> format.
    name string
    projectId string
    providerSettingsBackingProviderName string
    Cloud service provider on which MongoDB Cloud provisioned the serverless instance.
    providerSettingsProviderName string
    Cloud service provider that applies to the provisioned the serverless instance.
    providerSettingsRegionName string
    Human-readable label that identifies the physical location of your MongoDB serverless instance. The region you choose can affect network latency for clients accessing your databases.
    stateName string
    Stage of deployment of this serverless instance when the resource made its request.
    tags GetServerlessInstanceTag[]
    Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See below.
    terminationProtectionEnabled boolean
    Flag that indicates whether termination protection is enabled on the cluster. If set to true, MongoDB Cloud won't delete the cluster. If set to false, MongoDB Cloud will delete the cluster.
    connection_strings_private_endpoint_srvs Sequence[str]
    List of Serverless Private Endpoint Connections
    connection_strings_standard_srv str
    Public mongodb+srv:// connection string that you can use to connect to this serverless instance.
    continuous_backup_enabled bool
    Flag that indicates whether the serverless instance uses Serverless Continuous Backup.
    create_date str
    id str
    Unique 24-hexadecimal digit string that identifies the serverless instance.
    links Sequence[GetServerlessInstanceLink]
    mongo_db_version str
    Version of MongoDB that the serverless instance runs, in <major version>.<minor version> format.
    name str
    project_id str
    provider_settings_backing_provider_name str
    Cloud service provider on which MongoDB Cloud provisioned the serverless instance.
    provider_settings_provider_name str
    Cloud service provider that applies to the provisioned the serverless instance.
    provider_settings_region_name str
    Human-readable label that identifies the physical location of your MongoDB serverless instance. The region you choose can affect network latency for clients accessing your databases.
    state_name str
    Stage of deployment of this serverless instance when the resource made its request.
    tags Sequence[GetServerlessInstanceTag]
    Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See below.
    termination_protection_enabled bool
    Flag that indicates whether termination protection is enabled on the cluster. If set to true, MongoDB Cloud won't delete the cluster. If set to false, MongoDB Cloud will delete the cluster.
    connectionStringsPrivateEndpointSrvs List<String>
    List of Serverless Private Endpoint Connections
    connectionStringsStandardSrv String
    Public mongodb+srv:// connection string that you can use to connect to this serverless instance.
    continuousBackupEnabled Boolean
    Flag that indicates whether the serverless instance uses Serverless Continuous Backup.
    createDate String
    id String
    Unique 24-hexadecimal digit string that identifies the serverless instance.
    links List<Property Map>
    mongoDbVersion String
    Version of MongoDB that the serverless instance runs, in <major version>.<minor version> format.
    name String
    projectId String
    providerSettingsBackingProviderName String
    Cloud service provider on which MongoDB Cloud provisioned the serverless instance.
    providerSettingsProviderName String
    Cloud service provider that applies to the provisioned the serverless instance.
    providerSettingsRegionName String
    Human-readable label that identifies the physical location of your MongoDB serverless instance. The region you choose can affect network latency for clients accessing your databases.
    stateName String
    Stage of deployment of this serverless instance when the resource made its request.
    tags List<Property Map>
    Set that contains key-value pairs between 1 to 255 characters in length for tagging and categorizing the cluster. See below.
    terminationProtectionEnabled Boolean
    Flag that indicates whether termination protection is enabled on the cluster. If set to true, MongoDB Cloud won't delete the cluster. If set to false, MongoDB Cloud will delete the cluster.

    Supporting Types

    Href string
    Rel string
    Href string
    Rel string
    href String
    rel String
    href string
    rel string
    href str
    rel str
    href String
    rel String

    GetServerlessInstanceTag

    Key string
    Constant that defines the set of the tag.
    Value string
    Variable that belongs to the set of the tag.
    Key string
    Constant that defines the set of the tag.
    Value string
    Variable that belongs to the set of the tag.
    key String
    Constant that defines the set of the tag.
    value String
    Variable that belongs to the set of the tag.
    key string
    Constant that defines the set of the tag.
    value string
    Variable that belongs to the set of the tag.
    key str
    Constant that defines the set of the tag.
    value str
    Variable that belongs to the set of the tag.
    key String
    Constant that defines the set of the tag.
    value String
    Variable that belongs to the set of the tag.

    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