Azure Classic

Pulumi Official
Package maintained by Pulumi
v5.6.0 published on Friday, May 20, 2022 by Pulumi

getPublicIpPrefix

Use this data source to access information about an existing Public IP Prefix.

Example Usage

Reference An Existing)

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var example = Output.Create(Azure.Network.GetPublicIpPrefix.InvokeAsync(new Azure.Network.GetPublicIpPrefixArgs
        {
            Name = "name_of_public_ip",
            ResourceGroupName = "name_of_resource_group",
        }));
        this.PublicIpPrefix = example.Apply(example => example.IpPrefix);
    }

    [Output("publicIpPrefix")]
    public Output<string> PublicIpPrefix { get; set; }
}
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v5/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
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var example = Output.of(NetworkFunctions.getPublicIpPrefix(GetPublicIpPrefixArgs.builder()
            .name("name_of_public_ip")
            .resourceGroupName("name_of_resource_group")
            .build()));

        ctx.export("publicIpPrefix", example.apply(getPublicIpPrefixResult -> getPublicIpPrefixResult.getIpPrefix()));
        }
}
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)
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);
variables:
  example:
    Fn::Invoke:
      Function: azure:network:getPublicIpPrefix
      Arguments:
        name: name_of_public_ip
        resourceGroupName: name_of_resource_group
outputs:
  publicIpPrefix: ${example.ipPrefix}

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)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: azure:network/getPublicIpPrefix:getPublicIpPrefix
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Name string

Specifies the name of the public IP prefix.

ResourceGroupName string

Specifies the name of the resource group.

Name string

Specifies the name of the public IP prefix.

ResourceGroupName string

Specifies the name of the resource group.

name String

Specifies the name of the public IP prefix.

resourceGroupName String

Specifies the name of the resource group.

name string

Specifies the name of the public IP prefix.

resourceGroupName string

Specifies the name of the resource group.

name str

Specifies the name of the public IP prefix.

resource_group_name str

Specifies the name of the resource group.

name String

Specifies the name of the public IP prefix.

resourceGroupName String

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.

IpPrefix string
Location string

The supported Azure location where the resource exists.

Name string

The name of the Public IP prefix resource.

PrefixLength int

The number of bits of the prefix.

ResourceGroupName string

The name of the resource group in which to create the public IP.

Sku string

The SKU of the Public IP Prefix.

Tags 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.

IpPrefix string
Location string

The supported Azure location where the resource exists.

Name string

The name of the Public IP prefix resource.

PrefixLength int

The number of bits of the prefix.

ResourceGroupName string

The name of the resource group in which to create the public IP.

Sku string

The SKU of the Public IP Prefix.

Tags 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.

ipPrefix String
location String

The supported Azure location where the resource exists.

name String

The name of the Public IP prefix resource.

prefixLength Integer

The number of bits of the prefix.

resourceGroupName String

The name of the resource group in which to create the public IP.

sku String

The SKU of the Public IP Prefix.

tags Map

A mapping of tags to assigned to the resource.

zones List

A list of Availability Zones in which this Public IP Prefix is located.

id string

The provider-assigned unique ID for this managed resource.

ipPrefix string
location string

The supported Azure location where the resource exists.

name string

The name of the Public IP prefix resource.

prefixLength number

The number of bits of the prefix.

resourceGroupName string

The name of the resource group in which to create the public IP.

sku string

The SKU of the Public IP Prefix.

tags {[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
location str

The supported Azure location where the resource exists.

name str

The name of the Public IP prefix resource.

prefix_length int

The number of bits of the prefix.

resource_group_name str

The name of the resource group in which to create the public IP.

sku str

The SKU of the Public IP Prefix.

tags 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.

ipPrefix String
location String

The supported Azure location where the resource exists.

name String

The name of the Public IP prefix resource.

prefixLength Number

The number of bits of the prefix.

resourceGroupName String

The name of the resource group in which to create the public IP.

sku String

The SKU of the Public IP Prefix.

tags Map

A mapping of tags to assigned to the resource.

zones List

A list of Availability Zones in which this Public IP Prefix is located.

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.