1. Packages
  2. Azure Classic
  3. API Docs
  4. network
  5. getPublicIPs

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

azure.network.getPublicIPs

Explore with Pulumi AI

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

Use this data source to access information about a set of existing Public IP Addresses.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = azure.network.getPublicIPs({
    resourceGroupName: "pip-test",
    attachmentStatus: "Attached",
});
Copy
import pulumi
import pulumi_azure as azure

example = azure.network.get_public_i_ps(resource_group_name="pip-test",
    attachment_status="Attached")
Copy
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/network"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := network.GetPublicIPs(ctx, &network.GetPublicIPsArgs{
			ResourceGroupName: "pip-test",
			AttachmentStatus:  pulumi.StringRef("Attached"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var example = Azure.Network.GetPublicIPs.Invoke(new()
    {
        ResourceGroupName = "pip-test",
        AttachmentStatus = "Attached",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.network.NetworkFunctions;
import com.pulumi.azure.network.inputs.GetPublicIPsArgs;
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 = NetworkFunctions.getPublicIPs(GetPublicIPsArgs.builder()
            .resourceGroupName("pip-test")
            .attachmentStatus("Attached")
            .build());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: azure:network:getPublicIPs
      arguments:
        resourceGroupName: pip-test
        attachmentStatus: Attached
Copy

Using getPublicIPs

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 getPublicIPs(args: GetPublicIPsArgs, opts?: InvokeOptions): Promise<GetPublicIPsResult>
function getPublicIPsOutput(args: GetPublicIPsOutputArgs, opts?: InvokeOptions): Output<GetPublicIPsResult>
Copy
def get_public_i_ps(allocation_type: Optional[str] = None,
                    attachment_status: Optional[str] = None,
                    name_prefix: Optional[str] = None,
                    resource_group_name: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetPublicIPsResult
def get_public_i_ps_output(allocation_type: Optional[pulumi.Input[str]] = None,
                    attachment_status: Optional[pulumi.Input[str]] = None,
                    name_prefix: Optional[pulumi.Input[str]] = None,
                    resource_group_name: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetPublicIPsResult]
Copy
func GetPublicIPs(ctx *Context, args *GetPublicIPsArgs, opts ...InvokeOption) (*GetPublicIPsResult, error)
func GetPublicIPsOutput(ctx *Context, args *GetPublicIPsOutputArgs, opts ...InvokeOption) GetPublicIPsResultOutput
Copy

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

public static class GetPublicIPs 
{
    public static Task<GetPublicIPsResult> InvokeAsync(GetPublicIPsArgs args, InvokeOptions? opts = null)
    public static Output<GetPublicIPsResult> Invoke(GetPublicIPsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetPublicIPsResult> getPublicIPs(GetPublicIPsArgs args, InvokeOptions options)
public static Output<GetPublicIPsResult> getPublicIPs(GetPublicIPsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: azure:network/getPublicIPs:getPublicIPs
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ResourceGroupName This property is required. string
Specifies the name of the resource group.
AllocationType string
The Allocation Type for the Public IP Address. Possible values include Static or Dynamic.
AttachmentStatus string
Filter to include IP Addresses which are attached to a device, such as a VM/LB (Attached) or unattached (Unattached).
NamePrefix string
A prefix match used for the IP Addresses name field, case sensitive.
ResourceGroupName This property is required. string
Specifies the name of the resource group.
AllocationType string
The Allocation Type for the Public IP Address. Possible values include Static or Dynamic.
AttachmentStatus string
Filter to include IP Addresses which are attached to a device, such as a VM/LB (Attached) or unattached (Unattached).
NamePrefix string
A prefix match used for the IP Addresses name field, case sensitive.
resourceGroupName This property is required. String
Specifies the name of the resource group.
allocationType String
The Allocation Type for the Public IP Address. Possible values include Static or Dynamic.
attachmentStatus String
Filter to include IP Addresses which are attached to a device, such as a VM/LB (Attached) or unattached (Unattached).
namePrefix String
A prefix match used for the IP Addresses name field, case sensitive.
resourceGroupName This property is required. string
Specifies the name of the resource group.
allocationType string
The Allocation Type for the Public IP Address. Possible values include Static or Dynamic.
attachmentStatus string
Filter to include IP Addresses which are attached to a device, such as a VM/LB (Attached) or unattached (Unattached).
namePrefix string
A prefix match used for the IP Addresses name field, case sensitive.
resource_group_name This property is required. str
Specifies the name of the resource group.
allocation_type str
The Allocation Type for the Public IP Address. Possible values include Static or Dynamic.
attachment_status str
Filter to include IP Addresses which are attached to a device, such as a VM/LB (Attached) or unattached (Unattached).
name_prefix str
A prefix match used for the IP Addresses name field, case sensitive.
resourceGroupName This property is required. String
Specifies the name of the resource group.
allocationType String
The Allocation Type for the Public IP Address. Possible values include Static or Dynamic.
attachmentStatus String
Filter to include IP Addresses which are attached to a device, such as a VM/LB (Attached) or unattached (Unattached).
namePrefix String
A prefix match used for the IP Addresses name field, case sensitive.

getPublicIPs Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
PublicIps List<GetPublicIPsPublicIp>
A List of public_ips blocks as defined below filtered by the criteria above.
ResourceGroupName string
AllocationType string
AttachmentStatus string
NamePrefix string
Id string
The provider-assigned unique ID for this managed resource.
PublicIps []GetPublicIPsPublicIp
A List of public_ips blocks as defined below filtered by the criteria above.
ResourceGroupName string
AllocationType string
AttachmentStatus string
NamePrefix string
id String
The provider-assigned unique ID for this managed resource.
publicIps List<GetPublicIPsPublicIp>
A List of public_ips blocks as defined below filtered by the criteria above.
resourceGroupName String
allocationType String
attachmentStatus String
namePrefix String
id string
The provider-assigned unique ID for this managed resource.
publicIps GetPublicIPsPublicIp[]
A List of public_ips blocks as defined below filtered by the criteria above.
resourceGroupName string
allocationType string
attachmentStatus string
namePrefix string
id str
The provider-assigned unique ID for this managed resource.
public_ips Sequence[GetPublicIPsPublicIp]
A List of public_ips blocks as defined below filtered by the criteria above.
resource_group_name str
allocation_type str
attachment_status str
name_prefix str
id String
The provider-assigned unique ID for this managed resource.
publicIps List<Property Map>
A List of public_ips blocks as defined below filtered by the criteria above.
resourceGroupName String
allocationType String
attachmentStatus String
namePrefix String

Supporting Types

GetPublicIPsPublicIp

DomainNameLabel This property is required. string
The Domain Name Label of the Public IP Address
Fqdn This property is required. string
The FQDN of the Public IP Address
Id This property is required. string
The ID of the Public IP Address
IpAddress This property is required. string
The IP address of the Public IP Address
Name This property is required. string
The Name of the Public IP Address
DomainNameLabel This property is required. string
The Domain Name Label of the Public IP Address
Fqdn This property is required. string
The FQDN of the Public IP Address
Id This property is required. string
The ID of the Public IP Address
IpAddress This property is required. string
The IP address of the Public IP Address
Name This property is required. string
The Name of the Public IP Address
domainNameLabel This property is required. String
The Domain Name Label of the Public IP Address
fqdn This property is required. String
The FQDN of the Public IP Address
id This property is required. String
The ID of the Public IP Address
ipAddress This property is required. String
The IP address of the Public IP Address
name This property is required. String
The Name of the Public IP Address
domainNameLabel This property is required. string
The Domain Name Label of the Public IP Address
fqdn This property is required. string
The FQDN of the Public IP Address
id This property is required. string
The ID of the Public IP Address
ipAddress This property is required. string
The IP address of the Public IP Address
name This property is required. string
The Name of the Public IP Address
domain_name_label This property is required. str
The Domain Name Label of the Public IP Address
fqdn This property is required. str
The FQDN of the Public IP Address
id This property is required. str
The ID of the Public IP Address
ip_address This property is required. str
The IP address of the Public IP Address
name This property is required. str
The Name of the Public IP Address
domainNameLabel This property is required. String
The Domain Name Label of the Public IP Address
fqdn This property is required. String
The FQDN of the Public IP Address
id This property is required. String
The ID of the Public IP Address
ipAddress This property is required. String
The IP address of the Public IP Address
name This property is required. String
The Name of the Public IP Address

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi