1. Packages
  2. HashiCorp Consul
  3. API Docs
  4. getNetworkAreaMembers
Consul v3.11.3 published on Friday, May 24, 2024 by Pulumi

consul.getNetworkAreaMembers

Explore with Pulumi AI

consul logo
Consul v3.11.3 published on Friday, May 24, 2024 by Pulumi

    NOTE: This feature requires Consul Enterprise.

    The consul.getNetworkAreaMembers data source provides a list of the Consul servers present in a specific network area.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as consul from "@pulumi/consul";
    
    const dc2NetworkArea = new consul.NetworkArea("dc2", {
        peerDatacenter: "dc2",
        retryJoins: ["1.2.3.4"],
        useTls: true,
    });
    const dc2 = consul.getNetworkAreaMembersOutput({
        uuid: dc2NetworkArea.id,
    });
    export const members = dc2.apply(dc2 => dc2.members);
    
    import pulumi
    import pulumi_consul as consul
    
    dc2_network_area = consul.NetworkArea("dc2",
        peer_datacenter="dc2",
        retry_joins=["1.2.3.4"],
        use_tls=True)
    dc2 = consul.get_network_area_members_output(uuid=dc2_network_area.id)
    pulumi.export("members", dc2.members)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-consul/sdk/v3/go/consul"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		dc2NetworkArea, err := consul.NewNetworkArea(ctx, "dc2", &consul.NetworkAreaArgs{
    			PeerDatacenter: pulumi.String("dc2"),
    			RetryJoins: pulumi.StringArray{
    				pulumi.String("1.2.3.4"),
    			},
    			UseTls: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		dc2 := consul.GetNetworkAreaMembersOutput(ctx, consul.GetNetworkAreaMembersOutputArgs{
    			Uuid: dc2NetworkArea.ID(),
    		}, nil)
    		ctx.Export("members", dc2.ApplyT(func(dc2 consul.GetNetworkAreaMembersResult) ([]consul.GetNetworkAreaMembersMember, error) {
    			return dc2.Members, nil
    		}).([]consul.GetNetworkAreaMembersMemberOutput))
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Consul = Pulumi.Consul;
    
    return await Deployment.RunAsync(() => 
    {
        var dc2NetworkArea = new Consul.NetworkArea("dc2", new()
        {
            PeerDatacenter = "dc2",
            RetryJoins = new[]
            {
                "1.2.3.4",
            },
            UseTls = true,
        });
    
        var dc2 = Consul.GetNetworkAreaMembers.Invoke(new()
        {
            Uuid = dc2NetworkArea.Id,
        });
    
        return new Dictionary<string, object?>
        {
            ["members"] = dc2.Apply(getNetworkAreaMembersResult => getNetworkAreaMembersResult.Members),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.consul.NetworkArea;
    import com.pulumi.consul.NetworkAreaArgs;
    import com.pulumi.consul.ConsulFunctions;
    import com.pulumi.consul.inputs.GetNetworkAreaMembersArgs;
    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 dc2NetworkArea = new NetworkArea("dc2NetworkArea", NetworkAreaArgs.builder()
                .peerDatacenter("dc2")
                .retryJoins("1.2.3.4")
                .useTls(true)
                .build());
    
            final var dc2 = ConsulFunctions.getNetworkAreaMembers(GetNetworkAreaMembersArgs.builder()
                .uuid(dc2NetworkArea.id())
                .build());
    
            ctx.export("members", dc2.applyValue(getNetworkAreaMembersResult -> getNetworkAreaMembersResult).applyValue(dc2 -> dc2.applyValue(getNetworkAreaMembersResult -> getNetworkAreaMembersResult.members())));
        }
    }
    
    resources:
      dc2NetworkArea:
        type: consul:NetworkArea
        name: dc2
        properties:
          peerDatacenter: dc2
          retryJoins:
            - 1.2.3.4
          useTls: true
    variables:
      dc2:
        fn::invoke:
          Function: consul:getNetworkAreaMembers
          Arguments:
            uuid: ${dc2NetworkArea.id}
    outputs:
      members: ${dc2.members}
    

    Using getNetworkAreaMembers

    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 getNetworkAreaMembers(args: GetNetworkAreaMembersArgs, opts?: InvokeOptions): Promise<GetNetworkAreaMembersResult>
    function getNetworkAreaMembersOutput(args: GetNetworkAreaMembersOutputArgs, opts?: InvokeOptions): Output<GetNetworkAreaMembersResult>
    def get_network_area_members(datacenter: Optional[str] = None,
                                 token: Optional[str] = None,
                                 uuid: Optional[str] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetNetworkAreaMembersResult
    def get_network_area_members_output(datacenter: Optional[pulumi.Input[str]] = None,
                                 token: Optional[pulumi.Input[str]] = None,
                                 uuid: Optional[pulumi.Input[str]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetNetworkAreaMembersResult]
    func GetNetworkAreaMembers(ctx *Context, args *GetNetworkAreaMembersArgs, opts ...InvokeOption) (*GetNetworkAreaMembersResult, error)
    func GetNetworkAreaMembersOutput(ctx *Context, args *GetNetworkAreaMembersOutputArgs, opts ...InvokeOption) GetNetworkAreaMembersResultOutput

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

    public static class GetNetworkAreaMembers 
    {
        public static Task<GetNetworkAreaMembersResult> InvokeAsync(GetNetworkAreaMembersArgs args, InvokeOptions? opts = null)
        public static Output<GetNetworkAreaMembersResult> Invoke(GetNetworkAreaMembersInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetNetworkAreaMembersResult> getNetworkAreaMembers(GetNetworkAreaMembersArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: consul:index/getNetworkAreaMembers:getNetworkAreaMembers
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Uuid string
    The UUID of the area to list.
    Datacenter string
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    Token string
    The ACL token to use. This overrides the token that the agent provides by default.

    Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

    Uuid string
    The UUID of the area to list.
    Datacenter string
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    Token string
    The ACL token to use. This overrides the token that the agent provides by default.

    Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

    uuid String
    The UUID of the area to list.
    datacenter String
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    token String
    The ACL token to use. This overrides the token that the agent provides by default.

    Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

    uuid string
    The UUID of the area to list.
    datacenter string
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    token string
    The ACL token to use. This overrides the token that the agent provides by default.

    Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

    uuid str
    The UUID of the area to list.
    datacenter str
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    token str
    The ACL token to use. This overrides the token that the agent provides by default.

    Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

    uuid String
    The UUID of the area to list.
    datacenter String
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    token String
    The ACL token to use. This overrides the token that the agent provides by default.

    Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

    getNetworkAreaMembers Result

    The following output properties are available:

    Datacenter string
    The node's Consul datacenter.
    Id string
    The provider-assigned unique ID for this managed resource.
    Members List<GetNetworkAreaMembersMember>
    The list of Consul servers in this network area
    Uuid string
    The UUID of the Network Area being queried.
    Token string

    Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

    Datacenter string
    The node's Consul datacenter.
    Id string
    The provider-assigned unique ID for this managed resource.
    Members []GetNetworkAreaMembersMember
    The list of Consul servers in this network area
    Uuid string
    The UUID of the Network Area being queried.
    Token string

    Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

    datacenter String
    The node's Consul datacenter.
    id String
    The provider-assigned unique ID for this managed resource.
    members List<GetNetworkAreaMembersMember>
    The list of Consul servers in this network area
    uuid String
    The UUID of the Network Area being queried.
    token String

    Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

    datacenter string
    The node's Consul datacenter.
    id string
    The provider-assigned unique ID for this managed resource.
    members GetNetworkAreaMembersMember[]
    The list of Consul servers in this network area
    uuid string
    The UUID of the Network Area being queried.
    token string

    Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

    datacenter str
    The node's Consul datacenter.
    id str
    The provider-assigned unique ID for this managed resource.
    members Sequence[GetNetworkAreaMembersMember]
    The list of Consul servers in this network area
    uuid str
    The UUID of the Network Area being queried.
    token str

    Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

    datacenter String
    The node's Consul datacenter.
    id String
    The provider-assigned unique ID for this managed resource.
    members List<Property Map>
    The list of Consul servers in this network area
    uuid String
    The UUID of the Network Area being queried.
    token String

    Deprecated: The token argument has been deprecated and will be removed in a future release. Please use the token argument in the provider configuration

    Supporting Types

    GetNetworkAreaMembersMember

    Address string
    The IP address of the server.
    Build string
    The Consul version running on the node.
    Datacenter string
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    Id string
    The node ID of the server.
    Name string
    The node name of the server, with its datacenter appended.
    Port int
    The server RPC port the node.
    Protocol int
    The protocol version being spoken by the node.
    Role string
    Role is always "server" since only Consul servers can participate in network areas.
    Rtt int
    An estimated network round trip time from the server answering the query to the given server, in nanoseconds. This is computed using network coordinates.
    Status string
    The current health status of the node, as determined by the network area distributed failure detector. This will be "alive", "leaving", or "failed". A "failed" status means that other servers are not able to probe this server over its server RPC interface.
    Address string
    The IP address of the server.
    Build string
    The Consul version running on the node.
    Datacenter string
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    Id string
    The node ID of the server.
    Name string
    The node name of the server, with its datacenter appended.
    Port int
    The server RPC port the node.
    Protocol int
    The protocol version being spoken by the node.
    Role string
    Role is always "server" since only Consul servers can participate in network areas.
    Rtt int
    An estimated network round trip time from the server answering the query to the given server, in nanoseconds. This is computed using network coordinates.
    Status string
    The current health status of the node, as determined by the network area distributed failure detector. This will be "alive", "leaving", or "failed". A "failed" status means that other servers are not able to probe this server over its server RPC interface.
    address String
    The IP address of the server.
    build String
    The Consul version running on the node.
    datacenter String
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    id String
    The node ID of the server.
    name String
    The node name of the server, with its datacenter appended.
    port Integer
    The server RPC port the node.
    protocol Integer
    The protocol version being spoken by the node.
    role String
    Role is always "server" since only Consul servers can participate in network areas.
    rtt Integer
    An estimated network round trip time from the server answering the query to the given server, in nanoseconds. This is computed using network coordinates.
    status String
    The current health status of the node, as determined by the network area distributed failure detector. This will be "alive", "leaving", or "failed". A "failed" status means that other servers are not able to probe this server over its server RPC interface.
    address string
    The IP address of the server.
    build string
    The Consul version running on the node.
    datacenter string
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    id string
    The node ID of the server.
    name string
    The node name of the server, with its datacenter appended.
    port number
    The server RPC port the node.
    protocol number
    The protocol version being spoken by the node.
    role string
    Role is always "server" since only Consul servers can participate in network areas.
    rtt number
    An estimated network round trip time from the server answering the query to the given server, in nanoseconds. This is computed using network coordinates.
    status string
    The current health status of the node, as determined by the network area distributed failure detector. This will be "alive", "leaving", or "failed". A "failed" status means that other servers are not able to probe this server over its server RPC interface.
    address str
    The IP address of the server.
    build str
    The Consul version running on the node.
    datacenter str
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    id str
    The node ID of the server.
    name str
    The node name of the server, with its datacenter appended.
    port int
    The server RPC port the node.
    protocol int
    The protocol version being spoken by the node.
    role str
    Role is always "server" since only Consul servers can participate in network areas.
    rtt int
    An estimated network round trip time from the server answering the query to the given server, in nanoseconds. This is computed using network coordinates.
    status str
    The current health status of the node, as determined by the network area distributed failure detector. This will be "alive", "leaving", or "failed". A "failed" status means that other servers are not able to probe this server over its server RPC interface.
    address String
    The IP address of the server.
    build String
    The Consul version running on the node.
    datacenter String
    The datacenter to use. This overrides the agent's default datacenter and the datacenter in the provider setup.
    id String
    The node ID of the server.
    name String
    The node name of the server, with its datacenter appended.
    port Number
    The server RPC port the node.
    protocol Number
    The protocol version being spoken by the node.
    role String
    Role is always "server" since only Consul servers can participate in network areas.
    rtt Number
    An estimated network round trip time from the server answering the query to the given server, in nanoseconds. This is computed using network coordinates.
    status String
    The current health status of the node, as determined by the network area distributed failure detector. This will be "alive", "leaving", or "failed". A "failed" status means that other servers are not able to probe this server over its server RPC interface.

    Package Details

    Repository
    HashiCorp Consul pulumi/pulumi-consul
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the consul Terraform Provider.
    consul logo
    Consul v3.11.3 published on Friday, May 24, 2024 by Pulumi