1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. MongodbInstanceSrvConnection
Viewing docs for tencentcloud 1.82.79
published on Friday, Mar 27, 2026 by tencentcloudstack
tencentcloud logo
Viewing docs for tencentcloud 1.82.79
published on Friday, Mar 27, 2026 by tencentcloudstack

    Provides a resource to manage MongoDB instance SRV connection URL configuration.

    Example Usage

    Enable SRV connection with default domain

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.MongodbInstanceSrvConnection("example", {instanceId: "cmgo-p8vnipr5"});
    export const domain = example.domain;
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.MongodbInstanceSrvConnection("example", instance_id="cmgo-p8vnipr5")
    pulumi.export("domain", example.domain)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := tencentcloud.NewMongodbInstanceSrvConnection(ctx, "example", &tencentcloud.MongodbInstanceSrvConnectionArgs{
    			InstanceId: pulumi.String("cmgo-p8vnipr5"),
    		})
    		if err != nil {
    			return err
    		}
    		ctx.Export("domain", example.Domain)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Tencentcloud.MongodbInstanceSrvConnection("example", new()
        {
            InstanceId = "cmgo-p8vnipr5",
        });
    
        return new Dictionary<string, object?>
        {
            ["domain"] = example.Domain,
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.MongodbInstanceSrvConnection;
    import com.pulumi.tencentcloud.MongodbInstanceSrvConnectionArgs;
    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 example = new MongodbInstanceSrvConnection("example", MongodbInstanceSrvConnectionArgs.builder()
                .instanceId("cmgo-p8vnipr5")
                .build());
    
            ctx.export("domain", example.domain());
        }
    }
    
    resources:
      example:
        type: tencentcloud:MongodbInstanceSrvConnection
        properties:
          instanceId: cmgo-p8vnipr5
    outputs:
      domain: ${example.domain}
    

    Enable SRV connection with custom domain

    import * as pulumi from "@pulumi/pulumi";
    import * as tencentcloud from "@pulumi/tencentcloud";
    
    const example = new tencentcloud.MongodbInstanceSrvConnection("example", {
        instanceId: "cmgo-p8vnipr5",
        domain: "example.mongodb.com",
    });
    
    import pulumi
    import pulumi_tencentcloud as tencentcloud
    
    example = tencentcloud.MongodbInstanceSrvConnection("example",
        instance_id="cmgo-p8vnipr5",
        domain="example.mongodb.com")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := tencentcloud.NewMongodbInstanceSrvConnection(ctx, "example", &tencentcloud.MongodbInstanceSrvConnectionArgs{
    			InstanceId: pulumi.String("cmgo-p8vnipr5"),
    			Domain:     pulumi.String("example.mongodb.com"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Tencentcloud = Pulumi.Tencentcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Tencentcloud.MongodbInstanceSrvConnection("example", new()
        {
            InstanceId = "cmgo-p8vnipr5",
            Domain = "example.mongodb.com",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.tencentcloud.MongodbInstanceSrvConnection;
    import com.pulumi.tencentcloud.MongodbInstanceSrvConnectionArgs;
    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 example = new MongodbInstanceSrvConnection("example", MongodbInstanceSrvConnectionArgs.builder()
                .instanceId("cmgo-p8vnipr5")
                .domain("example.mongodb.com")
                .build());
    
        }
    }
    
    resources:
      example:
        type: tencentcloud:MongodbInstanceSrvConnection
        properties:
          instanceId: cmgo-p8vnipr5
          domain: example.mongodb.com
    

    Create MongodbInstanceSrvConnection Resource

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

    Constructor syntax

    new MongodbInstanceSrvConnection(name: string, args: MongodbInstanceSrvConnectionArgs, opts?: CustomResourceOptions);
    @overload
    def MongodbInstanceSrvConnection(resource_name: str,
                                     args: MongodbInstanceSrvConnectionArgs,
                                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def MongodbInstanceSrvConnection(resource_name: str,
                                     opts: Optional[ResourceOptions] = None,
                                     instance_id: Optional[str] = None,
                                     domain: Optional[str] = None,
                                     mongodb_instance_srv_connection_id: Optional[str] = None)
    func NewMongodbInstanceSrvConnection(ctx *Context, name string, args MongodbInstanceSrvConnectionArgs, opts ...ResourceOption) (*MongodbInstanceSrvConnection, error)
    public MongodbInstanceSrvConnection(string name, MongodbInstanceSrvConnectionArgs args, CustomResourceOptions? opts = null)
    public MongodbInstanceSrvConnection(String name, MongodbInstanceSrvConnectionArgs args)
    public MongodbInstanceSrvConnection(String name, MongodbInstanceSrvConnectionArgs args, CustomResourceOptions options)
    
    type: tencentcloud:MongodbInstanceSrvConnection
    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 MongodbInstanceSrvConnectionArgs
    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 MongodbInstanceSrvConnectionArgs
    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 MongodbInstanceSrvConnectionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args MongodbInstanceSrvConnectionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args MongodbInstanceSrvConnectionArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    InstanceId string
    MongoDB instance ID, for example: cmgo-p8vnipr5.
    Domain string
    Custom domain for SRV connection. If not specified during creation, the system will use a default domain. After creation, this field will be populated with the actual domain. To set or modify a custom domain, use this field.
    MongodbInstanceSrvConnectionId string
    ID of the resource.
    InstanceId string
    MongoDB instance ID, for example: cmgo-p8vnipr5.
    Domain string
    Custom domain for SRV connection. If not specified during creation, the system will use a default domain. After creation, this field will be populated with the actual domain. To set or modify a custom domain, use this field.
    MongodbInstanceSrvConnectionId string
    ID of the resource.
    instanceId String
    MongoDB instance ID, for example: cmgo-p8vnipr5.
    domain String
    Custom domain for SRV connection. If not specified during creation, the system will use a default domain. After creation, this field will be populated with the actual domain. To set or modify a custom domain, use this field.
    mongodbInstanceSrvConnectionId String
    ID of the resource.
    instanceId string
    MongoDB instance ID, for example: cmgo-p8vnipr5.
    domain string
    Custom domain for SRV connection. If not specified during creation, the system will use a default domain. After creation, this field will be populated with the actual domain. To set or modify a custom domain, use this field.
    mongodbInstanceSrvConnectionId string
    ID of the resource.
    instance_id str
    MongoDB instance ID, for example: cmgo-p8vnipr5.
    domain str
    Custom domain for SRV connection. If not specified during creation, the system will use a default domain. After creation, this field will be populated with the actual domain. To set or modify a custom domain, use this field.
    mongodb_instance_srv_connection_id str
    ID of the resource.
    instanceId String
    MongoDB instance ID, for example: cmgo-p8vnipr5.
    domain String
    Custom domain for SRV connection. If not specified during creation, the system will use a default domain. After creation, this field will be populated with the actual domain. To set or modify a custom domain, use this field.
    mongodbInstanceSrvConnectionId String
    ID of the resource.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing MongodbInstanceSrvConnection Resource

    Get an existing MongodbInstanceSrvConnection 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?: MongodbInstanceSrvConnectionState, opts?: CustomResourceOptions): MongodbInstanceSrvConnection
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            domain: Optional[str] = None,
            instance_id: Optional[str] = None,
            mongodb_instance_srv_connection_id: Optional[str] = None) -> MongodbInstanceSrvConnection
    func GetMongodbInstanceSrvConnection(ctx *Context, name string, id IDInput, state *MongodbInstanceSrvConnectionState, opts ...ResourceOption) (*MongodbInstanceSrvConnection, error)
    public static MongodbInstanceSrvConnection Get(string name, Input<string> id, MongodbInstanceSrvConnectionState? state, CustomResourceOptions? opts = null)
    public static MongodbInstanceSrvConnection get(String name, Output<String> id, MongodbInstanceSrvConnectionState state, CustomResourceOptions options)
    resources:  _:    type: tencentcloud:MongodbInstanceSrvConnection    get:      id: ${id}
    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:
    Domain string
    Custom domain for SRV connection. If not specified during creation, the system will use a default domain. After creation, this field will be populated with the actual domain. To set or modify a custom domain, use this field.
    InstanceId string
    MongoDB instance ID, for example: cmgo-p8vnipr5.
    MongodbInstanceSrvConnectionId string
    ID of the resource.
    Domain string
    Custom domain for SRV connection. If not specified during creation, the system will use a default domain. After creation, this field will be populated with the actual domain. To set or modify a custom domain, use this field.
    InstanceId string
    MongoDB instance ID, for example: cmgo-p8vnipr5.
    MongodbInstanceSrvConnectionId string
    ID of the resource.
    domain String
    Custom domain for SRV connection. If not specified during creation, the system will use a default domain. After creation, this field will be populated with the actual domain. To set or modify a custom domain, use this field.
    instanceId String
    MongoDB instance ID, for example: cmgo-p8vnipr5.
    mongodbInstanceSrvConnectionId String
    ID of the resource.
    domain string
    Custom domain for SRV connection. If not specified during creation, the system will use a default domain. After creation, this field will be populated with the actual domain. To set or modify a custom domain, use this field.
    instanceId string
    MongoDB instance ID, for example: cmgo-p8vnipr5.
    mongodbInstanceSrvConnectionId string
    ID of the resource.
    domain str
    Custom domain for SRV connection. If not specified during creation, the system will use a default domain. After creation, this field will be populated with the actual domain. To set or modify a custom domain, use this field.
    instance_id str
    MongoDB instance ID, for example: cmgo-p8vnipr5.
    mongodb_instance_srv_connection_id str
    ID of the resource.
    domain String
    Custom domain for SRV connection. If not specified during creation, the system will use a default domain. After creation, this field will be populated with the actual domain. To set or modify a custom domain, use this field.
    instanceId String
    MongoDB instance ID, for example: cmgo-p8vnipr5.
    mongodbInstanceSrvConnectionId String
    ID of the resource.

    Import

    MongoDB instance SRV connection can be imported using the instance id, e.g.

    $ pulumi import tencentcloud:index/mongodbInstanceSrvConnection:MongodbInstanceSrvConnection example cmgo-p8vnipr5
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    tencentcloud tencentcloudstack/terraform-provider-tencentcloud
    License
    Notes
    This Pulumi package is based on the tencentcloud Terraform Provider.
    tencentcloud logo
    Viewing docs for tencentcloud 1.82.79
    published on Friday, Mar 27, 2026 by tencentcloudstack
      Try Pulumi Cloud free. Your team will thank you.