Volcengine v0.0.27 published on Tuesday, Dec 10, 2024 by Volcengine
volcengine.mongodb.Endpoints
Explore with Pulumi AI
Use this data source to query detailed information of mongodb endpoints
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as volcengine from "@pulumi/volcengine";
import * as volcengine from "@volcengine/pulumi";
const fooZones = volcengine.ecs.Zones({});
const fooVpc = new volcengine.vpc.Vpc("fooVpc", {
    vpcName: "acc-test-vpc",
    cidrBlock: "172.16.0.0/16",
});
const fooSubnet = new volcengine.vpc.Subnet("fooSubnet", {
    subnetName: "acc-test-subnet",
    cidrBlock: "172.16.0.0/24",
    zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
    vpcId: fooVpc.id,
});
const fooInstance = new volcengine.mongodb.Instance("fooInstance", {
    dbEngineVersion: "MongoDB_4_0",
    instanceType: "ShardedCluster",
    superAccountPassword: "@acc-test-123",
    nodeSpec: "mongo.shard.1c2g",
    mongosNodeSpec: "mongo.mongos.1c2g",
    instanceName: "acc-test-mongo-shard",
    chargeType: "PostPaid",
    projectName: "default",
    mongosNodeNumber: 2,
    shardNumber: 2,
    storageSpaceGb: 20,
    subnetId: fooSubnet.id,
    zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
    tags: [{
        key: "k1",
        value: "v1",
    }],
});
const fooAddress: volcengine.eip.Address[] = [];
for (const range = {value: 0}; range.value < 2; range.value++) {
    fooAddress.push(new volcengine.eip.Address(`fooAddress-${range.value}`, {
        billingType: "PostPaidByBandwidth",
        bandwidth: 1,
        isp: "ChinaUnicom",
        description: "acc-test",
        projectName: "default",
    }));
}
const fooPublic = new volcengine.mongodb.Endpoint("fooPublic", {
    instanceId: fooInstance.id,
    networkType: "Public",
    objectId: fooInstance.mongosId,
    mongosNodeIds: [
        fooInstance.mongos.apply(mongos => mongos[0].mongosNodeId),
        fooInstance.mongos.apply(mongos => mongos[1].mongosNodeId),
    ],
    eipIds: fooAddress.map(__item => __item.id),
});
const fooPrivate = new volcengine.mongodb.Endpoint("fooPrivate", {
    instanceId: fooInstance.id,
    networkType: "Private",
    objectId: fooInstance.configServersId,
});
const fooEndpoints = volcengine.mongodb.EndpointsOutput({
    instanceId: fooInstance.id,
});
import pulumi
import pulumi_volcengine as volcengine
foo_zones = volcengine.ecs.zones()
foo_vpc = volcengine.vpc.Vpc("fooVpc",
    vpc_name="acc-test-vpc",
    cidr_block="172.16.0.0/16")
foo_subnet = volcengine.vpc.Subnet("fooSubnet",
    subnet_name="acc-test-subnet",
    cidr_block="172.16.0.0/24",
    zone_id=foo_zones.zones[0].id,
    vpc_id=foo_vpc.id)
foo_instance = volcengine.mongodb.Instance("fooInstance",
    db_engine_version="MongoDB_4_0",
    instance_type="ShardedCluster",
    super_account_password="@acc-test-123",
    node_spec="mongo.shard.1c2g",
    mongos_node_spec="mongo.mongos.1c2g",
    instance_name="acc-test-mongo-shard",
    charge_type="PostPaid",
    project_name="default",
    mongos_node_number=2,
    shard_number=2,
    storage_space_gb=20,
    subnet_id=foo_subnet.id,
    zone_id=foo_zones.zones[0].id,
    tags=[volcengine.mongodb.InstanceTagArgs(
        key="k1",
        value="v1",
    )])
foo_address = []
for range in [{"value": i} for i in range(0, 2)]:
    foo_address.append(volcengine.eip.Address(f"fooAddress-{range['value']}",
        billing_type="PostPaidByBandwidth",
        bandwidth=1,
        isp="ChinaUnicom",
        description="acc-test",
        project_name="default"))
foo_public = volcengine.mongodb.Endpoint("fooPublic",
    instance_id=foo_instance.id,
    network_type="Public",
    object_id=foo_instance.mongos_id,
    mongos_node_ids=[
        foo_instance.mongos[0].mongos_node_id,
        foo_instance.mongos[1].mongos_node_id,
    ],
    eip_ids=[__item.id for __item in foo_address])
foo_private = volcengine.mongodb.Endpoint("fooPrivate",
    instance_id=foo_instance.id,
    network_type="Private",
    object_id=foo_instance.config_servers_id)
foo_endpoints = volcengine.mongodb.endpoints_output(instance_id=foo_instance.id)
package main
import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/ecs"
	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/eip"
	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/mongodb"
	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/vpc"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		fooZones, err := ecs.Zones(ctx, nil, nil)
		if err != nil {
			return err
		}
		fooVpc, err := vpc.NewVpc(ctx, "fooVpc", &vpc.VpcArgs{
			VpcName:   pulumi.String("acc-test-vpc"),
			CidrBlock: pulumi.String("172.16.0.0/16"),
		})
		if err != nil {
			return err
		}
		fooSubnet, err := vpc.NewSubnet(ctx, "fooSubnet", &vpc.SubnetArgs{
			SubnetName: pulumi.String("acc-test-subnet"),
			CidrBlock:  pulumi.String("172.16.0.0/24"),
			ZoneId:     pulumi.String(fooZones.Zones[0].Id),
			VpcId:      fooVpc.ID(),
		})
		if err != nil {
			return err
		}
		fooInstance, err := mongodb.NewInstance(ctx, "fooInstance", &mongodb.InstanceArgs{
			DbEngineVersion:      pulumi.String("MongoDB_4_0"),
			InstanceType:         pulumi.String("ShardedCluster"),
			SuperAccountPassword: pulumi.String("@acc-test-123"),
			NodeSpec:             pulumi.String("mongo.shard.1c2g"),
			MongosNodeSpec:       pulumi.String("mongo.mongos.1c2g"),
			InstanceName:         pulumi.String("acc-test-mongo-shard"),
			ChargeType:           pulumi.String("PostPaid"),
			ProjectName:          pulumi.String("default"),
			MongosNodeNumber:     pulumi.Int(2),
			ShardNumber:          pulumi.Int(2),
			StorageSpaceGb:       pulumi.Int(20),
			SubnetId:             fooSubnet.ID(),
			ZoneId:               pulumi.String(fooZones.Zones[0].Id),
			Tags: mongodb.InstanceTagArray{
				&mongodb.InstanceTagArgs{
					Key:   pulumi.String("k1"),
					Value: pulumi.String("v1"),
				},
			},
		})
		if err != nil {
			return err
		}
		var fooAddress []*eip.Address
		for index := 0; index < 2; index++ {
			key0 := index
			_ := index
			__res, err := eip.NewAddress(ctx, fmt.Sprintf("fooAddress-%v", key0), &eip.AddressArgs{
				BillingType: pulumi.String("PostPaidByBandwidth"),
				Bandwidth:   pulumi.Int(1),
				Isp:         pulumi.String("ChinaUnicom"),
				Description: pulumi.String("acc-test"),
				ProjectName: pulumi.String("default"),
			})
			if err != nil {
				return err
			}
			fooAddress = append(fooAddress, __res)
		}
		var splat0 pulumi.StringArray
		for _, val0 := range fooAddress {
			splat0 = append(splat0, val0.ID())
		}
		_, err = mongodb.NewEndpoint(ctx, "fooPublic", &mongodb.EndpointArgs{
			InstanceId:  fooInstance.ID(),
			NetworkType: pulumi.String("Public"),
			ObjectId:    fooInstance.MongosId,
			MongosNodeIds: pulumi.StringArray{
				fooInstance.Mongos.ApplyT(func(mongos []mongodb.InstanceMongo) (*string, error) {
					return &mongos[0].MongosNodeId, nil
				}).(pulumi.StringPtrOutput),
				fooInstance.Mongos.ApplyT(func(mongos []mongodb.InstanceMongo) (*string, error) {
					return &mongos[1].MongosNodeId, nil
				}).(pulumi.StringPtrOutput),
			},
			EipIds: splat0,
		})
		if err != nil {
			return err
		}
		_, err = mongodb.NewEndpoint(ctx, "fooPrivate", &mongodb.EndpointArgs{
			InstanceId:  fooInstance.ID(),
			NetworkType: pulumi.String("Private"),
			ObjectId:    fooInstance.ConfigServersId,
		})
		if err != nil {
			return err
		}
		_ = mongodb.EndpointsOutput(ctx, mongodb.EndpointsOutputArgs{
			InstanceId: fooInstance.ID(),
		}, nil)
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;
return await Deployment.RunAsync(() => 
{
    var fooZones = Volcengine.Ecs.Zones.Invoke();
    var fooVpc = new Volcengine.Vpc.Vpc("fooVpc", new()
    {
        VpcName = "acc-test-vpc",
        CidrBlock = "172.16.0.0/16",
    });
    var fooSubnet = new Volcengine.Vpc.Subnet("fooSubnet", new()
    {
        SubnetName = "acc-test-subnet",
        CidrBlock = "172.16.0.0/24",
        ZoneId = fooZones.Apply(zonesResult => zonesResult.Zones[0]?.Id),
        VpcId = fooVpc.Id,
    });
    var fooInstance = new Volcengine.Mongodb.Instance("fooInstance", new()
    {
        DbEngineVersion = "MongoDB_4_0",
        InstanceType = "ShardedCluster",
        SuperAccountPassword = "@acc-test-123",
        NodeSpec = "mongo.shard.1c2g",
        MongosNodeSpec = "mongo.mongos.1c2g",
        InstanceName = "acc-test-mongo-shard",
        ChargeType = "PostPaid",
        ProjectName = "default",
        MongosNodeNumber = 2,
        ShardNumber = 2,
        StorageSpaceGb = 20,
        SubnetId = fooSubnet.Id,
        ZoneId = fooZones.Apply(zonesResult => zonesResult.Zones[0]?.Id),
        Tags = new[]
        {
            new Volcengine.Mongodb.Inputs.InstanceTagArgs
            {
                Key = "k1",
                Value = "v1",
            },
        },
    });
    var fooAddress = new List<Volcengine.Eip.Address>();
    for (var rangeIndex = 0; rangeIndex < 2; rangeIndex++)
    {
        var range = new { Value = rangeIndex };
        fooAddress.Add(new Volcengine.Eip.Address($"fooAddress-{range.Value}", new()
        {
            BillingType = "PostPaidByBandwidth",
            Bandwidth = 1,
            Isp = "ChinaUnicom",
            Description = "acc-test",
            ProjectName = "default",
        }));
    }
    var fooPublic = new Volcengine.Mongodb.Endpoint("fooPublic", new()
    {
        InstanceId = fooInstance.Id,
        NetworkType = "Public",
        ObjectId = fooInstance.MongosId,
        MongosNodeIds = new[]
        {
            fooInstance.Mongos.Apply(mongos => mongos[0].MongosNodeId),
            fooInstance.Mongos.Apply(mongos => mongos[1].MongosNodeId),
        },
        EipIds = fooAddress.Select(__item => __item.Id).ToList(),
    });
    var fooPrivate = new Volcengine.Mongodb.Endpoint("fooPrivate", new()
    {
        InstanceId = fooInstance.Id,
        NetworkType = "Private",
        ObjectId = fooInstance.ConfigServersId,
    });
    var fooEndpoints = Volcengine.Mongodb.Endpoints.Invoke(new()
    {
        InstanceId = fooInstance.Id,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.ecs.EcsFunctions;
import com.pulumi.volcengine.ecs.inputs.ZonesArgs;
import com.pulumi.volcengine.vpc.Vpc;
import com.pulumi.volcengine.vpc.VpcArgs;
import com.pulumi.volcengine.vpc.Subnet;
import com.pulumi.volcengine.vpc.SubnetArgs;
import com.pulumi.volcengine.mongodb.Instance;
import com.pulumi.volcengine.mongodb.InstanceArgs;
import com.pulumi.volcengine.mongodb.inputs.InstanceTagArgs;
import com.pulumi.volcengine.eip.Address;
import com.pulumi.volcengine.eip.AddressArgs;
import com.pulumi.volcengine.mongodb.Endpoint;
import com.pulumi.volcengine.mongodb.EndpointArgs;
import com.pulumi.volcengine.mongodb.MongodbFunctions;
import com.pulumi.volcengine.mongodb.inputs.EndpointsArgs;
import com.pulumi.codegen.internal.KeyedValue;
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 fooZones = EcsFunctions.Zones();
        var fooVpc = new Vpc("fooVpc", VpcArgs.builder()        
            .vpcName("acc-test-vpc")
            .cidrBlock("172.16.0.0/16")
            .build());
        var fooSubnet = new Subnet("fooSubnet", SubnetArgs.builder()        
            .subnetName("acc-test-subnet")
            .cidrBlock("172.16.0.0/24")
            .zoneId(fooZones.applyValue(zonesResult -> zonesResult.zones()[0].id()))
            .vpcId(fooVpc.id())
            .build());
        var fooInstance = new Instance("fooInstance", InstanceArgs.builder()        
            .dbEngineVersion("MongoDB_4_0")
            .instanceType("ShardedCluster")
            .superAccountPassword("@acc-test-123")
            .nodeSpec("mongo.shard.1c2g")
            .mongosNodeSpec("mongo.mongos.1c2g")
            .instanceName("acc-test-mongo-shard")
            .chargeType("PostPaid")
            .projectName("default")
            .mongosNodeNumber(2)
            .shardNumber(2)
            .storageSpaceGb(20)
            .subnetId(fooSubnet.id())
            .zoneId(fooZones.applyValue(zonesResult -> zonesResult.zones()[0].id()))
            .tags(InstanceTagArgs.builder()
                .key("k1")
                .value("v1")
                .build())
            .build());
        for (var i = 0; i < 2; i++) {
            new Address("fooAddress-" + i, AddressArgs.builder()            
                .billingType("PostPaidByBandwidth")
                .bandwidth(1)
                .isp("ChinaUnicom")
                .description("acc-test")
                .projectName("default")
                .build());
        
}
        var fooPublic = new Endpoint("fooPublic", EndpointArgs.builder()        
            .instanceId(fooInstance.id())
            .networkType("Public")
            .objectId(fooInstance.mongosId())
            .mongosNodeIds(            
                fooInstance.mongos().applyValue(mongos -> mongos[0].mongosNodeId()),
                fooInstance.mongos().applyValue(mongos -> mongos[1].mongosNodeId()))
            .eipIds(fooAddress.stream().map(element -> element.id()).collect(toList()))
            .build());
        var fooPrivate = new Endpoint("fooPrivate", EndpointArgs.builder()        
            .instanceId(fooInstance.id())
            .networkType("Private")
            .objectId(fooInstance.configServersId())
            .build());
        final var fooEndpoints = MongodbFunctions.Endpoints(EndpointsArgs.builder()
            .instanceId(fooInstance.id())
            .build());
    }
}
Coming soon!
Using Endpoints
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 endpoints(args: EndpointsArgs, opts?: InvokeOptions): Promise<EndpointsResult>
function endpointsOutput(args: EndpointsOutputArgs, opts?: InvokeOptions): Output<EndpointsResult>def endpoints(instance_id: Optional[str] = None,
              output_file: Optional[str] = None,
              opts: Optional[InvokeOptions] = None) -> EndpointsResult
def endpoints_output(instance_id: Optional[pulumi.Input[str]] = None,
              output_file: Optional[pulumi.Input[str]] = None,
              opts: Optional[InvokeOptions] = None) -> Output[EndpointsResult]func Endpoints(ctx *Context, args *EndpointsArgs, opts ...InvokeOption) (*EndpointsResult, error)
func EndpointsOutput(ctx *Context, args *EndpointsOutputArgs, opts ...InvokeOption) EndpointsResultOutputpublic static class Endpoints 
{
    public static Task<EndpointsResult> InvokeAsync(EndpointsArgs args, InvokeOptions? opts = null)
    public static Output<EndpointsResult> Invoke(EndpointsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<EndpointsResult> endpoints(EndpointsArgs args, InvokeOptions options)
public static Output<EndpointsResult> endpoints(EndpointsArgs args, InvokeOptions options)
fn::invoke:
  function: volcengine:mongodb:Endpoints
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Instance
Id string - The instance ID to query.
 - Output
File string - File name where to save data source results.
 
- Instance
Id string - The instance ID to query.
 - Output
File string - File name where to save data source results.
 
- instance
Id String - The instance ID to query.
 - output
File String - File name where to save data source results.
 
- instance
Id string - The instance ID to query.
 - output
File string - File name where to save data source results.
 
- instance_
id str - The instance ID to query.
 - output_
file str - File name where to save data source results.
 
- instance
Id String - The instance ID to query.
 - output
File String - File name where to save data source results.
 
Endpoints Result
The following output properties are available:
- Endpoints
List<Endpoints
Endpoint>  - The collection of mongodb endpoints query.
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - Total
Count int - The total count of mongodb endpoint query.
 - Instance
Id string - Output
File string 
- Endpoints
[]Endpoints
Endpoint  - The collection of mongodb endpoints query.
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - Total
Count int - The total count of mongodb endpoint query.
 - Instance
Id string - Output
File string 
- endpoints
List<Endpoints
Endpoint>  - The collection of mongodb endpoints query.
 - id String
 - The provider-assigned unique ID for this managed resource.
 - total
Count Integer - The total count of mongodb endpoint query.
 - instance
Id String - output
File String 
- endpoints
Endpoints
Endpoint[]  - The collection of mongodb endpoints query.
 - id string
 - The provider-assigned unique ID for this managed resource.
 - total
Count number - The total count of mongodb endpoint query.
 - instance
Id string - output
File string 
- endpoints
Sequence[Endpoints
Endpoint]  - The collection of mongodb endpoints query.
 - id str
 - The provider-assigned unique ID for this managed resource.
 - total_
count int - The total count of mongodb endpoint query.
 - instance_
id str - output_
file str 
- endpoints List<Property Map>
 - The collection of mongodb endpoints query.
 - id String
 - The provider-assigned unique ID for this managed resource.
 - total
Count Number - The total count of mongodb endpoint query.
 - instance
Id String - output
File String 
Supporting Types
EndpointsEndpoint 
- Db
Addresses List<EndpointsEndpoint Db Address>  - The list of mongodb addresses.
 - Endpoint
Id string - The ID of endpoint.
 - Endpoint
Str string - The endpoint information.
 - Endpoint
Type string - The node type corresponding to the endpoint.
 - Network
Type string - The network type of endpoint.
 - Object
Id string - The object ID corresponding to the endpoint.
 - Subnet
Id string - The subnet ID.
 - Vpc
Id string - The VPC ID.
 
- Db
Addresses []EndpointsEndpoint Db Address  - The list of mongodb addresses.
 - Endpoint
Id string - The ID of endpoint.
 - Endpoint
Str string - The endpoint information.
 - Endpoint
Type string - The node type corresponding to the endpoint.
 - Network
Type string - The network type of endpoint.
 - Object
Id string - The object ID corresponding to the endpoint.
 - Subnet
Id string - The subnet ID.
 - Vpc
Id string - The VPC ID.
 
- db
Addresses List<EndpointsEndpoint Db Address>  - The list of mongodb addresses.
 - endpoint
Id String - The ID of endpoint.
 - endpoint
Str String - The endpoint information.
 - endpoint
Type String - The node type corresponding to the endpoint.
 - network
Type String - The network type of endpoint.
 - object
Id String - The object ID corresponding to the endpoint.
 - subnet
Id String - The subnet ID.
 - vpc
Id String - The VPC ID.
 
- db
Addresses EndpointsEndpoint Db Address[]  - The list of mongodb addresses.
 - endpoint
Id string - The ID of endpoint.
 - endpoint
Str string - The endpoint information.
 - endpoint
Type string - The node type corresponding to the endpoint.
 - network
Type string - The network type of endpoint.
 - object
Id string - The object ID corresponding to the endpoint.
 - subnet
Id string - The subnet ID.
 - vpc
Id string - The VPC ID.
 
- db_
addresses Sequence[EndpointsEndpoint Db Address]  - The list of mongodb addresses.
 - endpoint_
id str - The ID of endpoint.
 - endpoint_
str str - The endpoint information.
 - endpoint_
type str - The node type corresponding to the endpoint.
 - network_
type str - The network type of endpoint.
 - object_
id str - The object ID corresponding to the endpoint.
 - subnet_
id str - The subnet ID.
 - vpc_
id str - The VPC ID.
 
- db
Addresses List<Property Map> - The list of mongodb addresses.
 - endpoint
Id String - The ID of endpoint.
 - endpoint
Str String - The endpoint information.
 - endpoint
Type String - The node type corresponding to the endpoint.
 - network
Type String - The network type of endpoint.
 - object
Id String - The object ID corresponding to the endpoint.
 - subnet
Id String - The subnet ID.
 - vpc
Id String - The VPC ID.
 
EndpointsEndpointDbAddress   
- Address
Domain string - The domain of mongodb connection.
 - Address
Ip string - The IP of mongodb connection.
 - Address
Port string - The port of mongodb connection.
 - Address
Type string - The connection type of mongodb.
 - Eip
Id string - The EIP ID bound to the instance's public network address.
 - Node
Id string - The node ID.
 
- Address
Domain string - The domain of mongodb connection.
 - Address
Ip string - The IP of mongodb connection.
 - Address
Port string - The port of mongodb connection.
 - Address
Type string - The connection type of mongodb.
 - Eip
Id string - The EIP ID bound to the instance's public network address.
 - Node
Id string - The node ID.
 
- address
Domain String - The domain of mongodb connection.
 - address
Ip String - The IP of mongodb connection.
 - address
Port String - The port of mongodb connection.
 - address
Type String - The connection type of mongodb.
 - eip
Id String - The EIP ID bound to the instance's public network address.
 - node
Id String - The node ID.
 
- address
Domain string - The domain of mongodb connection.
 - address
Ip string - The IP of mongodb connection.
 - address
Port string - The port of mongodb connection.
 - address
Type string - The connection type of mongodb.
 - eip
Id string - The EIP ID bound to the instance's public network address.
 - node
Id string - The node ID.
 
- address_
domain str - The domain of mongodb connection.
 - address_
ip str - The IP of mongodb connection.
 - address_
port str - The port of mongodb connection.
 - address_
type str - The connection type of mongodb.
 - eip_
id str - The EIP ID bound to the instance's public network address.
 - node_
id str - The node ID.
 
- address
Domain String - The domain of mongodb connection.
 - address
Ip String - The IP of mongodb connection.
 - address
Port String - The port of mongodb connection.
 - address
Type String - The connection type of mongodb.
 - eip
Id String - The EIP ID bound to the instance's public network address.
 - node
Id String - The node ID.
 
Package Details
- Repository
 - volcengine volcengine/pulumi-volcengine
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
volcengineTerraform Provider.