1. Packages
  2. Ionoscloud
  3. API Docs
  4. dbaas
  5. getMongoTemplate
IonosCloud v0.2.3 published on Tuesday, May 13, 2025 by ionos-cloud

ionoscloud.dbaas.getMongoTemplate

Explore with Pulumi AI

ionoscloud logo
IonosCloud v0.2.3 published on Tuesday, May 13, 2025 by ionos-cloud

    The DbaaS Mongo Template data source can be used to search for and return an existing DbaaS MongoDB Template. If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned. When this happens, please refine your search string so that it is specific enough to return only one result.

    Example Usage

    By ID

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const example = ionoscloud.dbaas.getMongoTemplate({
        id: "template_id",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.dbaas.get_mongo_template(id="template_id")
    
    package main
    
    import (
    	"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud/dbaas"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := dbaas.GetMongoTemplate(ctx, &dbaas.GetMongoTemplateArgs{
    			Id: pulumi.StringRef("template_id"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ionoscloud = Pulumi.Ionoscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ionoscloud.Dbaas.GetMongoTemplate.Invoke(new()
        {
            Id = "template_id",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.dbaas.DbaasFunctions;
    import com.pulumi.ionoscloud.dbaas.inputs.GetMongoTemplateArgs;
    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 example = DbaasFunctions.getMongoTemplate(GetMongoTemplateArgs.builder()
                .id("template_id")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:dbaas:getMongoTemplate
          arguments:
            id: template_id
    

    By name

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const example = ionoscloud.dbaas.getMongoTemplate({
        name: "name",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.dbaas.get_mongo_template(name="name")
    
    package main
    
    import (
    	"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud/dbaas"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := dbaas.GetMongoTemplate(ctx, &dbaas.GetMongoTemplateArgs{
    			Name: pulumi.StringRef("name"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ionoscloud = Pulumi.Ionoscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ionoscloud.Dbaas.GetMongoTemplate.Invoke(new()
        {
            Name = "name",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.dbaas.DbaasFunctions;
    import com.pulumi.ionoscloud.dbaas.inputs.GetMongoTemplateArgs;
    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 example = DbaasFunctions.getMongoTemplate(GetMongoTemplateArgs.builder()
                .name("name")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:dbaas:getMongoTemplate
          arguments:
            name: name
    

    By name, using partial_match

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const example = ionoscloud.dbaas.getMongoTemplate({
        name: "name",
        partialMatch: true,
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.dbaas.get_mongo_template(name="name",
        partial_match=True)
    
    package main
    
    import (
    	"github.com/ionos-cloud/pulumi-ionoscloud/sdk/go/ionoscloud/dbaas"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := dbaas.GetMongoTemplate(ctx, &dbaas.GetMongoTemplateArgs{
    			Name:         pulumi.StringRef("name"),
    			PartialMatch: pulumi.BoolRef(true),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ionoscloud = Pulumi.Ionoscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ionoscloud.Dbaas.GetMongoTemplate.Invoke(new()
        {
            Name = "name",
            PartialMatch = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.dbaas.DbaasFunctions;
    import com.pulumi.ionoscloud.dbaas.inputs.GetMongoTemplateArgs;
    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 example = DbaasFunctions.getMongoTemplate(GetMongoTemplateArgs.builder()
                .name("name")
                .partialMatch(true)
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:dbaas:getMongoTemplate
          arguments:
            name: name
            partialMatch: true
    
    • name - (Optional) The name of the template you want to search for.
    • id - (Optional) ID of the template you want to search for.
    • partial_match - (Optional) Whether partial matching is allowed or not when using name argument. Default value is false.

    Either name or id must be provided. If none or both are provided, the datasource will return an error.

    Using getMongoTemplate

    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 getMongoTemplate(args: GetMongoTemplateArgs, opts?: InvokeOptions): Promise<GetMongoTemplateResult>
    function getMongoTemplateOutput(args: GetMongoTemplateOutputArgs, opts?: InvokeOptions): Output<GetMongoTemplateResult>
    def get_mongo_template(id: Optional[str] = None,
                           name: Optional[str] = None,
                           partial_match: Optional[bool] = None,
                           opts: Optional[InvokeOptions] = None) -> GetMongoTemplateResult
    def get_mongo_template_output(id: Optional[pulumi.Input[str]] = None,
                           name: Optional[pulumi.Input[str]] = None,
                           partial_match: Optional[pulumi.Input[bool]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetMongoTemplateResult]
    func GetMongoTemplate(ctx *Context, args *GetMongoTemplateArgs, opts ...InvokeOption) (*GetMongoTemplateResult, error)
    func GetMongoTemplateOutput(ctx *Context, args *GetMongoTemplateOutputArgs, opts ...InvokeOption) GetMongoTemplateResultOutput

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

    public static class GetMongoTemplate 
    {
        public static Task<GetMongoTemplateResult> InvokeAsync(GetMongoTemplateArgs args, InvokeOptions? opts = null)
        public static Output<GetMongoTemplateResult> Invoke(GetMongoTemplateInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetMongoTemplateResult> getMongoTemplate(GetMongoTemplateArgs args, InvokeOptions options)
    public static Output<GetMongoTemplateResult> getMongoTemplate(GetMongoTemplateArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ionoscloud:dbaas/getMongoTemplate:getMongoTemplate
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    The ID of the template.
    Name string
    The name of the template.
    PartialMatch bool
    Id string
    The ID of the template.
    Name string
    The name of the template.
    PartialMatch bool
    id String
    The ID of the template.
    name String
    The name of the template.
    partialMatch Boolean
    id string
    The ID of the template.
    name string
    The name of the template.
    partialMatch boolean
    id str
    The ID of the template.
    name str
    The name of the template.
    partial_match bool
    id String
    The ID of the template.
    name String
    The name of the template.
    partialMatch Boolean

    getMongoTemplate Result

    The following output properties are available:

    Cores int
    The number of CPU cores.
    Edition string
    The edition of the template (e.g. enterprise).
    Id string
    The ID of the template.
    Name string
    The name of the template.
    Ram int
    The amount of memory in GB.
    StorageSize int
    The amount of storage size in GB.
    PartialMatch bool
    Cores int
    The number of CPU cores.
    Edition string
    The edition of the template (e.g. enterprise).
    Id string
    The ID of the template.
    Name string
    The name of the template.
    Ram int
    The amount of memory in GB.
    StorageSize int
    The amount of storage size in GB.
    PartialMatch bool
    cores Integer
    The number of CPU cores.
    edition String
    The edition of the template (e.g. enterprise).
    id String
    The ID of the template.
    name String
    The name of the template.
    ram Integer
    The amount of memory in GB.
    storageSize Integer
    The amount of storage size in GB.
    partialMatch Boolean
    cores number
    The number of CPU cores.
    edition string
    The edition of the template (e.g. enterprise).
    id string
    The ID of the template.
    name string
    The name of the template.
    ram number
    The amount of memory in GB.
    storageSize number
    The amount of storage size in GB.
    partialMatch boolean
    cores int
    The number of CPU cores.
    edition str
    The edition of the template (e.g. enterprise).
    id str
    The ID of the template.
    name str
    The name of the template.
    ram int
    The amount of memory in GB.
    storage_size int
    The amount of storage size in GB.
    partial_match bool
    cores Number
    The number of CPU cores.
    edition String
    The edition of the template (e.g. enterprise).
    id String
    The ID of the template.
    name String
    The name of the template.
    ram Number
    The amount of memory in GB.
    storageSize Number
    The amount of storage size in GB.
    partialMatch Boolean

    Package Details

    Repository
    ionoscloud ionos-cloud/pulumi-ionoscloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ionoscloud Terraform Provider.
    ionoscloud logo
    IonosCloud v0.2.3 published on Tuesday, May 13, 2025 by ionos-cloud