1. Registry
  2. Packages
  3. Hcloud Provider
  4. API Docs
  5. getNetworkMembers
Viewing docs for Hetzner Cloud v1.43.3
published on Tuesday, Oct 27, 2026 by Pulumi
hcloud logo
Viewing docs for Hetzner Cloud v1.43.3
published on Tuesday, Oct 27, 2026 by Pulumi

    Provides a list of Hetzner Cloud Network Members.

    See the Networks API documentation for more details.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as hcloud from "@pulumi/hcloud";
    import * as std from "@pulumi/std";
    
    const byType = hcloud.getNetworkMembers({
        networkId: example.id,
        withTypes: [
            "load_balancer",
            "server",
        ],
    });
    const byStatus = hcloud.getNetworkMembers({
        networkId: example.id,
        withStatuses: [
            "ok",
            "attaching",
            "detaching",
            "updating",
            "error",
        ],
    });
    const bySubnet = hcloud.getNetworkMembers({
        networkId: example.id,
        withSubnets: ["10.0.1.0/24"],
    });
    const all = hcloud.getNetworkMembers({
        networkId: example.id,
    });
    // A list of all IPs in the network
    const networkIps = Promise.all([all, std.concat({
        input: [
            [m.ip],
            m.aliasIps,
        ],
    })]).then(([all, invoke]) => std.flatten({
        input: .map(m => (invoke.result)),
    })).then(invoke => invoke.result);
    
    import pulumi
    import pulumi_hcloud as hcloud
    import pulumi_std as std
    
    by_type = hcloud.get_network_members(network_id=example["id"],
        with_types=[
            "load_balancer",
            "server",
        ])
    by_status = hcloud.get_network_members(network_id=example["id"],
        with_statuses=[
            "ok",
            "attaching",
            "detaching",
            "updating",
            "error",
        ])
    by_subnet = hcloud.get_network_members(network_id=example["id"],
        with_subnets=["10.0.1.0/24"])
    all = hcloud.get_network_members(network_id=example["id"])
    # A list of all IPs in the network
    network_ips = std.flatten(input=[std.concat(input=[
        [m.ip],
        m.alias_ips,
    ]).result for m in all.members]).result
    
    Example coming soon!
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using HCloud = Pulumi.HCloud;
    using Std = Pulumi.Std;
    
    return await Deployment.RunAsync(() => 
    {
        var byType = HCloud.GetNetworkMembers.Invoke(new()
        {
            NetworkId = example.Id,
            WithTypes = new[]
            {
                "load_balancer",
                "server",
            },
        });
    
        var byStatus = HCloud.GetNetworkMembers.Invoke(new()
        {
            NetworkId = example.Id,
            WithStatuses = new[]
            {
                "ok",
                "attaching",
                "detaching",
                "updating",
                "error",
            },
        });
    
        var bySubnet = HCloud.GetNetworkMembers.Invoke(new()
        {
            NetworkId = example.Id,
            WithSubnets = new[]
            {
                "10.0.1.0/24",
            },
        });
    
        var all = HCloud.GetNetworkMembers.Invoke(new()
        {
            NetworkId = example.Id,
        });
    
        // A list of all IPs in the network
        var networkIps = Output.Tuple(all, Std.Concat.Invoke(new()
        {
            Input = new[]
            {
                new[]
                {
                    m.Ip,
                },
                m.AliasIps,
            },
        })).Apply(values =>
        {
            var all = values.Item1;
            var invoke = values.Item2;
            return Std.Flatten.Invoke(new()
            {
                Input = .Select(m => 
                {
                    return invoke.Result;
                }).ToList(),
            });
        }).Apply(invoke => invoke.Result);
    
    });
    
    Example coming soon!
    
    Example coming soon!
    
    terraform {
      required_providers {
        hcloud = {
          source = "pulumi/hcloud"
        }
        std = {
          source = "pulumi/std"
        }
      }
    }
    
    data "hcloud_network_members" "byType" {
      network_id = example.id
      with_types = ["load_balancer", "server"]
    }
    data "hcloud_network_members" "byStatus" {
      network_id    = example.id
      with_statuses = ["ok", "attaching", "detaching", "updating", "error"]
    }
    data "hcloud_network_members" "bySubnet" {
      network_id   = example.id
      with_subnets = ["10.0.1.0/24"]
    }
    data "hcloud_network_members" "all" {
      network_id = example.id
    }
    data "std_concat" "invoke_4" {
      for_each = toset(data.hcloud_network_members.all.members)
      input    = [[each.value.ip], each.value.aliasIps]
    }
    
    // A list of all IPs in the network
    locals {
      networkIps = flatten([for m in data.hcloud_network_members.all.members : data.std_concat.invoke_4[m].result])
    }
    

    Using getNetworkMembers

    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 getNetworkMembers(args: GetNetworkMembersArgs, opts?: InvokeOptions): Promise<GetNetworkMembersResult>
    function getNetworkMembersOutput(args: GetNetworkMembersOutputArgs, opts?: InvokeOutputOptions): Output<GetNetworkMembersResult>
    def get_network_members(network_id: Optional[int] = None,
                            with_statuses: Optional[Sequence[str]] = None,
                            with_subnets: Optional[Sequence[str]] = None,
                            with_types: Optional[Sequence[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> GetNetworkMembersResult
    def get_network_members_output(network_id: pulumi.Input[Optional[int]] = None,
                            with_statuses: pulumi.Input[Optional[Sequence[pulumi.Input[str]]]] = None,
                            with_subnets: pulumi.Input[Optional[Sequence[pulumi.Input[str]]]] = None,
                            with_types: pulumi.Input[Optional[Sequence[pulumi.Input[str]]]] = None,
                            opts: Optional[InvokeOutputOptions] = None) -> Output[GetNetworkMembersResult]
    func GetNetworkMembers(ctx *Context, args *GetNetworkMembersArgs, opts ...InvokeOption) (*GetNetworkMembersResult, error)
    func GetNetworkMembersOutput(ctx *Context, args *GetNetworkMembersOutputArgs, opts ...InvokeOption) GetNetworkMembersResultOutput

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

    public static class GetNetworkMembers 
    {
        public static Task<GetNetworkMembersResult> InvokeAsync(GetNetworkMembersArgs args, InvokeOptions? opts = null)
        public static Output<GetNetworkMembersResult> Invoke(GetNetworkMembersInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetNetworkMembersResult> Invoke(GetNetworkMembersInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetNetworkMembersResult> getNetworkMembers(GetNetworkMembersArgs args, InvokeOptions options)
    public static Output<GetNetworkMembersResult> getNetworkMembers(GetNetworkMembersArgs args, InvokeOptions options)
    public static Output<GetNetworkMembersResult> getNetworkMembers(GetNetworkMembersArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: hcloud:index/getNetworkMembers:getNetworkMembers
      arguments:
        # arguments dictionary
    data "hcloud_get_network_members" "name" {
        # arguments
    }

    The following arguments are supported:

    NetworkId int
    ID the Network to list the members of.
    WithStatuses List<string>
    Filter members by status. May be used multiple times.
    WithSubnets List<string>
    Filter members by subnet. May be used multiple times.
    WithTypes List<string>
    Filter members by type. May be used multiple times.
    NetworkId int
    ID the Network to list the members of.
    WithStatuses []string
    Filter members by status. May be used multiple times.
    WithSubnets []string
    Filter members by subnet. May be used multiple times.
    WithTypes []string
    Filter members by type. May be used multiple times.
    network_id number
    ID the Network to list the members of.
    with_statuses list(string)
    Filter members by status. May be used multiple times.
    with_subnets list(string)
    Filter members by subnet. May be used multiple times.
    with_types list(string)
    Filter members by type. May be used multiple times.
    networkId Integer
    ID the Network to list the members of.
    withStatuses List<String>
    Filter members by status. May be used multiple times.
    withSubnets List<String>
    Filter members by subnet. May be used multiple times.
    withTypes List<String>
    Filter members by type. May be used multiple times.
    networkId number
    ID the Network to list the members of.
    withStatuses string[]
    Filter members by status. May be used multiple times.
    withSubnets string[]
    Filter members by subnet. May be used multiple times.
    withTypes string[]
    Filter members by type. May be used multiple times.
    network_id int
    ID the Network to list the members of.
    with_statuses Sequence[str]
    Filter members by status. May be used multiple times.
    with_subnets Sequence[str]
    Filter members by subnet. May be used multiple times.
    with_types Sequence[str]
    Filter members by type. May be used multiple times.
    networkId Number
    ID the Network to list the members of.
    withStatuses List<String>
    Filter members by status. May be used multiple times.
    withSubnets List<String>
    Filter members by subnet. May be used multiple times.
    withTypes List<String>
    Filter members by type. May be used multiple times.

    getNetworkMembers Result

    The following output properties are available:

    Members List<Pulumi.HCloud.Outputs.GetNetworkMembersMember>
    NetworkId int
    ID the Network to list the members of.
    WithStatuses List<string>
    Filter members by status. May be used multiple times.
    WithSubnets List<string>
    Filter members by subnet. May be used multiple times.
    WithTypes List<string>
    Filter members by type. May be used multiple times.
    Members []GetNetworkMembersMember
    NetworkId int
    ID the Network to list the members of.
    WithStatuses []string
    Filter members by status. May be used multiple times.
    WithSubnets []string
    Filter members by subnet. May be used multiple times.
    WithTypes []string
    Filter members by type. May be used multiple times.
    members list(object)
    network_id number
    ID the Network to list the members of.
    with_statuses list(string)
    Filter members by status. May be used multiple times.
    with_subnets list(string)
    Filter members by subnet. May be used multiple times.
    with_types list(string)
    Filter members by type. May be used multiple times.
    members List<GetNetworkMembersMember>
    networkId Integer
    ID the Network to list the members of.
    withStatuses List<String>
    Filter members by status. May be used multiple times.
    withSubnets List<String>
    Filter members by subnet. May be used multiple times.
    withTypes List<String>
    Filter members by type. May be used multiple times.
    members GetNetworkMembersMember[]
    networkId number
    ID the Network to list the members of.
    withStatuses string[]
    Filter members by status. May be used multiple times.
    withSubnets string[]
    Filter members by subnet. May be used multiple times.
    withTypes string[]
    Filter members by type. May be used multiple times.
    members Sequence[GetNetworkMembersMember]
    network_id int
    ID the Network to list the members of.
    with_statuses Sequence[str]
    Filter members by status. May be used multiple times.
    with_subnets Sequence[str]
    Filter members by subnet. May be used multiple times.
    with_types Sequence[str]
    Filter members by type. May be used multiple times.
    members List<Property Map>
    networkId Number
    ID the Network to list the members of.
    withStatuses List<String>
    Filter members by status. May be used multiple times.
    withSubnets List<String>
    Filter members by subnet. May be used multiple times.
    withTypes List<String>
    Filter members by type. May be used multiple times.

    Supporting Types

    GetNetworkMembersMember

    AliasIps List<string>
    Additional IP addresses of the Resource within the Network.
    Id int
    ID of the Resource attached to the Network.
    Ip string
    IP address of the Resource within the Network.
    Status string
    Status of the Resource within the Network.
    Subnet string
    IP range of the subnet the Resource is attached to.
    Type string
    Type of the Resource attached to the Network.
    AliasIps []string
    Additional IP addresses of the Resource within the Network.
    Id int
    ID of the Resource attached to the Network.
    Ip string
    IP address of the Resource within the Network.
    Status string
    Status of the Resource within the Network.
    Subnet string
    IP range of the subnet the Resource is attached to.
    Type string
    Type of the Resource attached to the Network.
    alias_ips list(string)
    Additional IP addresses of the Resource within the Network.
    id number
    ID of the Resource attached to the Network.
    ip string
    IP address of the Resource within the Network.
    status string
    Status of the Resource within the Network.
    subnet string
    IP range of the subnet the Resource is attached to.
    type string
    Type of the Resource attached to the Network.
    aliasIps List<String>
    Additional IP addresses of the Resource within the Network.
    id Integer
    ID of the Resource attached to the Network.
    ip String
    IP address of the Resource within the Network.
    status String
    Status of the Resource within the Network.
    subnet String
    IP range of the subnet the Resource is attached to.
    type String
    Type of the Resource attached to the Network.
    aliasIps string[]
    Additional IP addresses of the Resource within the Network.
    id number
    ID of the Resource attached to the Network.
    ip string
    IP address of the Resource within the Network.
    status string
    Status of the Resource within the Network.
    subnet string
    IP range of the subnet the Resource is attached to.
    type string
    Type of the Resource attached to the Network.
    alias_ips Sequence[str]
    Additional IP addresses of the Resource within the Network.
    id int
    ID of the Resource attached to the Network.
    ip str
    IP address of the Resource within the Network.
    status str
    Status of the Resource within the Network.
    subnet str
    IP range of the subnet the Resource is attached to.
    type str
    Type of the Resource attached to the Network.
    aliasIps List<String>
    Additional IP addresses of the Resource within the Network.
    id Number
    ID of the Resource attached to the Network.
    ip String
    IP address of the Resource within the Network.
    status String
    Status of the Resource within the Network.
    subnet String
    IP range of the subnet the Resource is attached to.
    type String
    Type of the Resource attached to the Network.

    Package Details

    Repository
    Hetzner Cloud pulumi/pulumi-hcloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the hcloud Terraform Provider.
    hcloud logo
    Viewing docs for Hetzner Cloud v1.43.3
    published on Tuesday, Oct 27, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial