1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. mongodb
  5. getShardingNetworkPublicAddresses
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

alicloud.mongodb.getShardingNetworkPublicAddresses

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

    This data source provides the Mongodb Sharding Network Public Addresses of the current Alibaba Cloud user.

    NOTE: Available in v1.149.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const example = alicloud.mongodb.getShardingNetworkPublicAddresses({
        dbInstanceId: "example_value",
        nodeId: "example_value",
        role: "Primary",
    });
    export const mongodbShardingNetworkPublicAddressDbInstanceId1 = example.then(example => example.addresses?.[0]?.dbInstanceId);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example = alicloud.mongodb.get_sharding_network_public_addresses(db_instance_id="example_value",
        node_id="example_value",
        role="Primary")
    pulumi.export("mongodbShardingNetworkPublicAddressDbInstanceId1", example.addresses[0].db_instance_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/mongodb"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := mongodb.GetShardingNetworkPublicAddresses(ctx, &mongodb.GetShardingNetworkPublicAddressesArgs{
    			DbInstanceId: "example_value",
    			NodeId:       pulumi.StringRef("example_value"),
    			Role:         pulumi.StringRef("Primary"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("mongodbShardingNetworkPublicAddressDbInstanceId1", example.Addresses[0].DbInstanceId)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = AliCloud.MongoDB.GetShardingNetworkPublicAddresses.Invoke(new()
        {
            DbInstanceId = "example_value",
            NodeId = "example_value",
            Role = "Primary",
        });
    
        return new Dictionary<string, object?>
        {
            ["mongodbShardingNetworkPublicAddressDbInstanceId1"] = example.Apply(getShardingNetworkPublicAddressesResult => getShardingNetworkPublicAddressesResult.Addresses[0]?.DbInstanceId),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.mongodb.MongodbFunctions;
    import com.pulumi.alicloud.mongodb.inputs.GetShardingNetworkPublicAddressesArgs;
    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 = MongodbFunctions.getShardingNetworkPublicAddresses(GetShardingNetworkPublicAddressesArgs.builder()
                .dbInstanceId("example_value")
                .nodeId("example_value")
                .role("Primary")
                .build());
    
            ctx.export("mongodbShardingNetworkPublicAddressDbInstanceId1", example.applyValue(getShardingNetworkPublicAddressesResult -> getShardingNetworkPublicAddressesResult.addresses()[0].dbInstanceId()));
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: alicloud:mongodb:getShardingNetworkPublicAddresses
          Arguments:
            dbInstanceId: example_value
            nodeId: example_value
            role: Primary
    outputs:
      mongodbShardingNetworkPublicAddressDbInstanceId1: ${example.addresses[0].dbInstanceId}
    

    Using getShardingNetworkPublicAddresses

    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 getShardingNetworkPublicAddresses(args: GetShardingNetworkPublicAddressesArgs, opts?: InvokeOptions): Promise<GetShardingNetworkPublicAddressesResult>
    function getShardingNetworkPublicAddressesOutput(args: GetShardingNetworkPublicAddressesOutputArgs, opts?: InvokeOptions): Output<GetShardingNetworkPublicAddressesResult>
    def get_sharding_network_public_addresses(db_instance_id: Optional[str] = None,
                                              node_id: Optional[str] = None,
                                              output_file: Optional[str] = None,
                                              role: Optional[str] = None,
                                              opts: Optional[InvokeOptions] = None) -> GetShardingNetworkPublicAddressesResult
    def get_sharding_network_public_addresses_output(db_instance_id: Optional[pulumi.Input[str]] = None,
                                              node_id: Optional[pulumi.Input[str]] = None,
                                              output_file: Optional[pulumi.Input[str]] = None,
                                              role: Optional[pulumi.Input[str]] = None,
                                              opts: Optional[InvokeOptions] = None) -> Output[GetShardingNetworkPublicAddressesResult]
    func GetShardingNetworkPublicAddresses(ctx *Context, args *GetShardingNetworkPublicAddressesArgs, opts ...InvokeOption) (*GetShardingNetworkPublicAddressesResult, error)
    func GetShardingNetworkPublicAddressesOutput(ctx *Context, args *GetShardingNetworkPublicAddressesOutputArgs, opts ...InvokeOption) GetShardingNetworkPublicAddressesResultOutput

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

    public static class GetShardingNetworkPublicAddresses 
    {
        public static Task<GetShardingNetworkPublicAddressesResult> InvokeAsync(GetShardingNetworkPublicAddressesArgs args, InvokeOptions? opts = null)
        public static Output<GetShardingNetworkPublicAddressesResult> Invoke(GetShardingNetworkPublicAddressesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetShardingNetworkPublicAddressesResult> getShardingNetworkPublicAddresses(GetShardingNetworkPublicAddressesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:mongodb/getShardingNetworkPublicAddresses:getShardingNetworkPublicAddresses
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DbInstanceId string
    The db instance id.
    NodeId string
    The ID of the mongos, shard, or Configserver node in the sharded cluster instance.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Role string
    The role of the node.
    DbInstanceId string
    The db instance id.
    NodeId string
    The ID of the mongos, shard, or Configserver node in the sharded cluster instance.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Role string
    The role of the node.
    dbInstanceId String
    The db instance id.
    nodeId String
    The ID of the mongos, shard, or Configserver node in the sharded cluster instance.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    role String
    The role of the node.
    dbInstanceId string
    The db instance id.
    nodeId string
    The ID of the mongos, shard, or Configserver node in the sharded cluster instance.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    role string
    The role of the node.
    db_instance_id str
    The db instance id.
    node_id str
    The ID of the mongos, shard, or Configserver node in the sharded cluster instance.
    output_file str
    File name where to save data source results (after running pulumi preview).
    role str
    The role of the node.
    dbInstanceId String
    The db instance id.
    nodeId String
    The ID of the mongos, shard, or Configserver node in the sharded cluster instance.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    role String
    The role of the node.

    getShardingNetworkPublicAddresses Result

    The following output properties are available:

    Addresses List<Pulumi.AliCloud.MongoDB.Outputs.GetShardingNetworkPublicAddressesAddress>
    DbInstanceId string
    Id string
    The provider-assigned unique ID for this managed resource.
    NodeId string
    OutputFile string
    Role string
    Addresses []GetShardingNetworkPublicAddressesAddress
    DbInstanceId string
    Id string
    The provider-assigned unique ID for this managed resource.
    NodeId string
    OutputFile string
    Role string
    addresses List<GetShardingNetworkPublicAddressesAddress>
    dbInstanceId String
    id String
    The provider-assigned unique ID for this managed resource.
    nodeId String
    outputFile String
    role String
    addresses GetShardingNetworkPublicAddressesAddress[]
    dbInstanceId string
    id string
    The provider-assigned unique ID for this managed resource.
    nodeId string
    outputFile string
    role string
    addresses Sequence[GetShardingNetworkPublicAddressesAddress]
    db_instance_id str
    id str
    The provider-assigned unique ID for this managed resource.
    node_id str
    output_file str
    role str
    addresses List<Property Map>
    dbInstanceId String
    id String
    The provider-assigned unique ID for this managed resource.
    nodeId String
    outputFile String
    role String

    Supporting Types

    GetShardingNetworkPublicAddressesAddress

    DbInstanceId string
    The db instance id.
    ExpiredTime string
    The remaining duration of the classic network address. Unit: seconds.
    IpAddress string
    The IP address of the instance.
    NetworkAddress string
    The endpoint of the instance.
    NetworkType string
    The network type.
    NodeId string
    The ID of the mongos, shard, or Configserver node in the sharded cluster instance.
    NodeType string
    The type of the node.
    Port string
    The port number.
    Role string
    The role of the node.
    VpcId string
    The ID of the VPC.
    VswitchId string
    The vSwitch ID of the VPC.
    DbInstanceId string
    The db instance id.
    ExpiredTime string
    The remaining duration of the classic network address. Unit: seconds.
    IpAddress string
    The IP address of the instance.
    NetworkAddress string
    The endpoint of the instance.
    NetworkType string
    The network type.
    NodeId string
    The ID of the mongos, shard, or Configserver node in the sharded cluster instance.
    NodeType string
    The type of the node.
    Port string
    The port number.
    Role string
    The role of the node.
    VpcId string
    The ID of the VPC.
    VswitchId string
    The vSwitch ID of the VPC.
    dbInstanceId String
    The db instance id.
    expiredTime String
    The remaining duration of the classic network address. Unit: seconds.
    ipAddress String
    The IP address of the instance.
    networkAddress String
    The endpoint of the instance.
    networkType String
    The network type.
    nodeId String
    The ID of the mongos, shard, or Configserver node in the sharded cluster instance.
    nodeType String
    The type of the node.
    port String
    The port number.
    role String
    The role of the node.
    vpcId String
    The ID of the VPC.
    vswitchId String
    The vSwitch ID of the VPC.
    dbInstanceId string
    The db instance id.
    expiredTime string
    The remaining duration of the classic network address. Unit: seconds.
    ipAddress string
    The IP address of the instance.
    networkAddress string
    The endpoint of the instance.
    networkType string
    The network type.
    nodeId string
    The ID of the mongos, shard, or Configserver node in the sharded cluster instance.
    nodeType string
    The type of the node.
    port string
    The port number.
    role string
    The role of the node.
    vpcId string
    The ID of the VPC.
    vswitchId string
    The vSwitch ID of the VPC.
    db_instance_id str
    The db instance id.
    expired_time str
    The remaining duration of the classic network address. Unit: seconds.
    ip_address str
    The IP address of the instance.
    network_address str
    The endpoint of the instance.
    network_type str
    The network type.
    node_id str
    The ID of the mongos, shard, or Configserver node in the sharded cluster instance.
    node_type str
    The type of the node.
    port str
    The port number.
    role str
    The role of the node.
    vpc_id str
    The ID of the VPC.
    vswitch_id str
    The vSwitch ID of the VPC.
    dbInstanceId String
    The db instance id.
    expiredTime String
    The remaining duration of the classic network address. Unit: seconds.
    ipAddress String
    The IP address of the instance.
    networkAddress String
    The endpoint of the instance.
    networkType String
    The network type.
    nodeId String
    The ID of the mongos, shard, or Configserver node in the sharded cluster instance.
    nodeType String
    The type of the node.
    port String
    The port number.
    role String
    The role of the node.
    vpcId String
    The ID of the VPC.
    vswitchId String
    The vSwitch ID of the VPC.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi