We recommend using Azure Native.
Azure v6.21.0 published on Friday, Mar 7, 2025 by Pulumi
azure.network.getPublicIPs
Explore with Pulumi AI
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",
});
import pulumi
import pulumi_azure as azure
example = azure.network.get_public_i_ps(resource_group_name="pip-test",
    attachment_status="Attached")
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
	})
}
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",
    });
});
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());
    }
}
variables:
  example:
    fn::invoke:
      function: azure:network:getPublicIPs
      arguments:
        resourceGroupName: pip-test
        attachmentStatus: Attached
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>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]func GetPublicIPs(ctx *Context, args *GetPublicIPsArgs, opts ...InvokeOption) (*GetPublicIPsResult, error)
func GetPublicIPsOutput(ctx *Context, args *GetPublicIPsOutputArgs, opts ...InvokeOption) GetPublicIPsResultOutput> 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)
}public static CompletableFuture<GetPublicIPsResult> getPublicIPs(GetPublicIPsArgs args, InvokeOptions options)
public static Output<GetPublicIPsResult> getPublicIPs(GetPublicIPsArgs args, InvokeOptions options)
fn::invoke:
  function: azure:network/getPublicIPs:getPublicIPs
  arguments:
    # arguments dictionaryThe following arguments are supported:
- ResourceGroup stringName 
- Specifies the name of the resource group.
- AllocationType string
- The Allocation Type for the Public IP Address. Possible values include StaticorDynamic.
- 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 namefield, case sensitive.
- ResourceGroup stringName 
- Specifies the name of the resource group.
- AllocationType string
- The Allocation Type for the Public IP Address. Possible values include StaticorDynamic.
- 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 namefield, case sensitive.
- resourceGroup StringName 
- Specifies the name of the resource group.
- allocationType String
- The Allocation Type for the Public IP Address. Possible values include StaticorDynamic.
- 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 namefield, case sensitive.
- resourceGroup stringName 
- Specifies the name of the resource group.
- allocationType string
- The Allocation Type for the Public IP Address. Possible values include StaticorDynamic.
- 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 namefield, case sensitive.
- resource_group_ strname 
- Specifies the name of the resource group.
- allocation_type str
- The Allocation Type for the Public IP Address. Possible values include StaticorDynamic.
- 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 namefield, case sensitive.
- resourceGroup StringName 
- Specifies the name of the resource group.
- allocationType String
- The Allocation Type for the Public IP Address. Possible values include StaticorDynamic.
- 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 namefield, case sensitive.
getPublicIPs Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- PublicIps List<GetPublic IPs Public Ip> 
- A List of public_ipsblocks as defined below filtered by the criteria above.
- ResourceGroup stringName 
- AllocationType string
- AttachmentStatus string
- NamePrefix string
- Id string
- The provider-assigned unique ID for this managed resource.
- PublicIps []GetPublic IPs Public Ip 
- A List of public_ipsblocks as defined below filtered by the criteria above.
- ResourceGroup stringName 
- AllocationType string
- AttachmentStatus string
- NamePrefix string
- id String
- The provider-assigned unique ID for this managed resource.
- publicIps List<GetPublic IPs Public Ip> 
- A List of public_ipsblocks as defined below filtered by the criteria above.
- resourceGroup StringName 
- allocationType String
- attachmentStatus String
- namePrefix String
- id string
- The provider-assigned unique ID for this managed resource.
- publicIps GetPublic IPs Public Ip[] 
- A List of public_ipsblocks as defined below filtered by the criteria above.
- resourceGroup stringName 
- allocationType string
- attachmentStatus string
- namePrefix string
- id str
- The provider-assigned unique ID for this managed resource.
- public_ips Sequence[GetPublic IPs Public Ip] 
- A List of public_ipsblocks as defined below filtered by the criteria above.
- resource_group_ strname 
- 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_ipsblocks as defined below filtered by the criteria above.
- resourceGroup StringName 
- allocationType String
- attachmentStatus String
- namePrefix String
Supporting Types
GetPublicIPsPublicIp    
- DomainName stringLabel 
- The Domain Name Label of the Public IP Address
- Fqdn string
- The FQDN of the Public IP Address
- Id string
- The ID of the Public IP Address
- IpAddress string
- The IP address of the Public IP Address
- Name string
- The Name of the Public IP Address
- DomainName stringLabel 
- The Domain Name Label of the Public IP Address
- Fqdn string
- The FQDN of the Public IP Address
- Id string
- The ID of the Public IP Address
- IpAddress string
- The IP address of the Public IP Address
- Name string
- The Name of the Public IP Address
- domainName StringLabel 
- The Domain Name Label of the Public IP Address
- fqdn String
- The FQDN of the Public IP Address
- id String
- The ID of the Public IP Address
- ipAddress String
- The IP address of the Public IP Address
- name String
- The Name of the Public IP Address
- domainName stringLabel 
- The Domain Name Label of the Public IP Address
- fqdn string
- The FQDN of the Public IP Address
- id string
- The ID of the Public IP Address
- ipAddress string
- The IP address of the Public IP Address
- name string
- The Name of the Public IP Address
- domain_name_ strlabel 
- The Domain Name Label of the Public IP Address
- fqdn str
- The FQDN of the Public IP Address
- id str
- The ID of the Public IP Address
- ip_address str
- The IP address of the Public IP Address
- name str
- The Name of the Public IP Address
- domainName StringLabel 
- The Domain Name Label of the Public IP Address
- fqdn String
- The FQDN of the Public IP Address
- id String
- The ID of the Public IP Address
- ipAddress String
- The IP address of the Public IP Address
- name 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 azurermTerraform Provider.