get Public Ip Prefix
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);
Content copied to clipboard
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)
Content copied to clipboard
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),
};
});
Content copied to clipboard
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
})
}
Content copied to clipboard
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());
}
}
Content copied to clipboard
variables:
example:
fn::invoke:
function: azure:network:getPublicIpPrefix
arguments:
name: name_of_public_ip
resourceGroupName: name_of_resource_group
outputs:
publicIpPrefix: ${example.ipPrefix}
Content copied to clipboard
API Providers
This data source uses the following Azure API Providers:
Microsoft.Network
: 2024-05-01
Return
A collection of values returned by getPublicIpPrefix.
Parameters
argument
A collection of arguments for invoking getPublicIpPrefix.
Return
A collection of values returned by getPublicIpPrefix.
Parameters
name
Specifies the name of the public IP prefix.
resource Group Name
Specifies the name of the resource group.
See also
suspend fun getPublicIpPrefix(argument: suspend GetPublicIpPrefixPlainArgsBuilder.() -> Unit): GetPublicIpPrefixResult
Return
A collection of values returned by getPublicIpPrefix.
Parameters
argument
Builder for com.pulumi.azure.network.kotlin.inputs.GetPublicIpPrefixPlainArgs.