We recommend using Azure Native.
Azure v6.28.0 published on Friday, Oct 3, 2025 by Pulumi
azure.network.getPublicIpPrefix
Start a Neo task
Explain and create an azure.network.getPublicIpPrefix resource
Use this data source to access information about an existing Public IP Prefix.
Example Usage
Reference An Existing)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = azure.network.getPublicIpPrefix({
name: "name_of_public_ip",
resourceGroupName: "name_of_resource_group",
});
export const publicIpPrefix = example.then(example => example.ipPrefix);
import pulumi
import pulumi_azure as azure
example = azure.network.get_public_ip_prefix(name="name_of_public_ip",
resource_group_name="name_of_resource_group")
pulumi.export("publicIpPrefix", example.ip_prefix)
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 {
example, err := network.LookupPublicIpPrefix(ctx, &network.LookupPublicIpPrefixArgs{
Name: "name_of_public_ip",
ResourceGroupName: "name_of_resource_group",
}, nil)
if err != nil {
return err
}
ctx.Export("publicIpPrefix", example.IpPrefix)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = Azure.Network.GetPublicIpPrefix.Invoke(new()
{
Name = "name_of_public_ip",
ResourceGroupName = "name_of_resource_group",
});
return new Dictionary<string, object?>
{
["publicIpPrefix"] = example.Apply(getPublicIpPrefixResult => getPublicIpPrefixResult.IpPrefix),
};
});
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.GetPublicIpPrefixArgs;
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.getPublicIpPrefix(GetPublicIpPrefixArgs.builder()
.name("name_of_public_ip")
.resourceGroupName("name_of_resource_group")
.build());
ctx.export("publicIpPrefix", example.ipPrefix());
}
}
variables:
example:
fn::invoke:
function: azure:network:getPublicIpPrefix
arguments:
name: name_of_public_ip
resourceGroupName: name_of_resource_group
outputs:
publicIpPrefix: ${example.ipPrefix}
API Providers
This data source uses the following Azure API Providers:
Microsoft.Network- 2024-05-01
Using getPublicIpPrefix
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 getPublicIpPrefix(args: GetPublicIpPrefixArgs, opts?: InvokeOptions): Promise<GetPublicIpPrefixResult>
function getPublicIpPrefixOutput(args: GetPublicIpPrefixOutputArgs, opts?: InvokeOptions): Output<GetPublicIpPrefixResult>def get_public_ip_prefix(name: Optional[str] = None,
resource_group_name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetPublicIpPrefixResult
def get_public_ip_prefix_output(name: Optional[pulumi.Input[str]] = None,
resource_group_name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetPublicIpPrefixResult]func LookupPublicIpPrefix(ctx *Context, args *LookupPublicIpPrefixArgs, opts ...InvokeOption) (*LookupPublicIpPrefixResult, error)
func LookupPublicIpPrefixOutput(ctx *Context, args *LookupPublicIpPrefixOutputArgs, opts ...InvokeOption) LookupPublicIpPrefixResultOutput> Note: This function is named LookupPublicIpPrefix in the Go SDK.
public static class GetPublicIpPrefix
{
public static Task<GetPublicIpPrefixResult> InvokeAsync(GetPublicIpPrefixArgs args, InvokeOptions? opts = null)
public static Output<GetPublicIpPrefixResult> Invoke(GetPublicIpPrefixInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetPublicIpPrefixResult> getPublicIpPrefix(GetPublicIpPrefixArgs args, InvokeOptions options)
public static Output<GetPublicIpPrefixResult> getPublicIpPrefix(GetPublicIpPrefixArgs args, InvokeOptions options)
fn::invoke:
function: azure:network/getPublicIpPrefix:getPublicIpPrefix
arguments:
# arguments dictionaryThe following arguments are supported:
- Name string
- Specifies the name of the public IP prefix.
- Resource
Group stringName - Specifies the name of the resource group.
- Name string
- Specifies the name of the public IP prefix.
- Resource
Group stringName - Specifies the name of the resource group.
- name String
- Specifies the name of the public IP prefix.
- resource
Group StringName - Specifies the name of the resource group.
- name string
- Specifies the name of the public IP prefix.
- resource
Group stringName - Specifies the name of the resource group.
- name str
- Specifies the name of the public IP prefix.
- resource_
group_ strname - Specifies the name of the resource group.
- name String
- Specifies the name of the public IP prefix.
- resource
Group StringName - Specifies the name of the resource group.
getPublicIpPrefix Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ip
Prefix string - The Public IP address range, in CIDR notation.
- Location string
- The supported Azure location where the resource exists.
- Name string
- Prefix
Length int - The number of bits of the prefix.
- Resource
Group stringName - Sku string
- The SKU of the Public IP Prefix.
- Sku
Tier string - The SKU Tier of the Public IP.
- Dictionary<string, string>
- A mapping of tags to assigned to the resource.
- Zones List<string>
- A list of Availability Zones in which this Public IP Prefix is located.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ip
Prefix string - The Public IP address range, in CIDR notation.
- Location string
- The supported Azure location where the resource exists.
- Name string
- Prefix
Length int - The number of bits of the prefix.
- Resource
Group stringName - Sku string
- The SKU of the Public IP Prefix.
- Sku
Tier string - The SKU Tier of the Public IP.
- map[string]string
- A mapping of tags to assigned to the resource.
- Zones []string
- A list of Availability Zones in which this Public IP Prefix is located.
- id String
- The provider-assigned unique ID for this managed resource.
- ip
Prefix String - The Public IP address range, in CIDR notation.
- location String
- The supported Azure location where the resource exists.
- name String
- prefix
Length Integer - The number of bits of the prefix.
- resource
Group StringName - sku String
- The SKU of the Public IP Prefix.
- sku
Tier String - The SKU Tier of the Public IP.
- Map<String,String>
- A mapping of tags to assigned to the resource.
- zones List<String>
- A list of Availability Zones in which this Public IP Prefix is located.
- id string
- The provider-assigned unique ID for this managed resource.
- ip
Prefix string - The Public IP address range, in CIDR notation.
- location string
- The supported Azure location where the resource exists.
- name string
- prefix
Length number - The number of bits of the prefix.
- resource
Group stringName - sku string
- The SKU of the Public IP Prefix.
- sku
Tier string - The SKU Tier of the Public IP.
- {[key: string]: string}
- A mapping of tags to assigned to the resource.
- zones string[]
- A list of Availability Zones in which this Public IP Prefix is located.
- id str
- The provider-assigned unique ID for this managed resource.
- ip_
prefix str - The Public IP address range, in CIDR notation.
- location str
- The supported Azure location where the resource exists.
- name str
- prefix_
length int - The number of bits of the prefix.
- resource_
group_ strname - sku str
- The SKU of the Public IP Prefix.
- sku_
tier str - The SKU Tier of the Public IP.
- Mapping[str, str]
- A mapping of tags to assigned to the resource.
- zones Sequence[str]
- A list of Availability Zones in which this Public IP Prefix is located.
- id String
- The provider-assigned unique ID for this managed resource.
- ip
Prefix String - The Public IP address range, in CIDR notation.
- location String
- The supported Azure location where the resource exists.
- name String
- prefix
Length Number - The number of bits of the prefix.
- resource
Group StringName - sku String
- The SKU of the Public IP Prefix.
- sku
Tier String - The SKU Tier of the Public IP.
- Map<String>
- A mapping of tags to assigned to the resource.
- zones List<String>
- A list of Availability Zones in which this Public IP Prefix is located.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.
