Prefix Args
Manages a custom IPv4 prefix or custom IPv6 prefix.
Example Usage
IPv4 custom prefix
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example-resources",
location: "West Europe",
});
const examplePrefix = new azure.customip.Prefix("example", {
name: "example-CustomIPPrefix",
location: example.location,
resourceGroupName: example.name,
cidr: "1.2.3.4/22",
zones: [
"1",
"2",
"3",
],
commissioningEnabled: true,
roaValidityEndDate: "2099-12-12",
wanValidationSignedMessage: "signed message for WAN validation",
tags: {
env: "test",
},
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_prefix = azure.customip.Prefix("example",
name="example-CustomIPPrefix",
location=example.location,
resource_group_name=example.name,
cidr="1.2.3.4/22",
zones=[
"1",
"2",
"3",
],
commissioning_enabled=True,
roa_validity_end_date="2099-12-12",
wan_validation_signed_message="signed message for WAN validation",
tags={
"env": "test",
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "example-resources",
Location = "West Europe",
});
var examplePrefix = new Azure.CustomIp.Prefix("example", new()
{
Name = "example-CustomIPPrefix",
Location = example.Location,
ResourceGroupName = example.Name,
Cidr = "1.2.3.4/22",
Zones = new[]
{
"1",
"2",
"3",
},
CommissioningEnabled = true,
RoaValidityEndDate = "2099-12-12",
WanValidationSignedMessage = "signed message for WAN validation",
Tags =
{
{ "env", "test" },
},
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/customip"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("example-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
_, err = customip.NewPrefix(ctx, "example", &customip.PrefixArgs{
Name: pulumi.String("example-CustomIPPrefix"),
Location: example.Location,
ResourceGroupName: example.Name,
Cidr: pulumi.String("1.2.3.4/22"),
Zones: pulumi.StringArray{
pulumi.String("1"),
pulumi.String("2"),
pulumi.String("3"),
},
CommissioningEnabled: pulumi.Bool(true),
RoaValidityEndDate: pulumi.String("2099-12-12"),
WanValidationSignedMessage: pulumi.String("signed message for WAN validation"),
Tags: pulumi.StringMap{
"env": pulumi.String("test"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.customip.Prefix;
import com.pulumi.azure.customip.PrefixArgs;
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) {
var example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("example-resources")
.location("West Europe")
.build());
var examplePrefix = new Prefix("examplePrefix", PrefixArgs.builder()
.name("example-CustomIPPrefix")
.location(example.location())
.resourceGroupName(example.name())
.cidr("1.2.3.4/22")
.zones(
"1",
"2",
"3")
.commissioningEnabled(true)
.roaValidityEndDate("2099-12-12")
.wanValidationSignedMessage("signed message for WAN validation")
.tags(Map.of("env", "test"))
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
examplePrefix:
type: azure:customip:Prefix
name: example
properties:
name: example-CustomIPPrefix
location: ${example.location}
resourceGroupName: ${example.name}
cidr: 1.2.3.4/22
zones:
- '1'
- '2'
- '3'
commissioningEnabled: true
roaValidityEndDate: 2099-12-12
wanValidationSignedMessage: signed message for WAN validation
tags:
env: test
IPv6 custom prefix
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
import * as std from "@pulumi/std";
const example = new azure.core.ResourceGroup("example", {
name: "example-resources",
location: "West Europe",
});
const global = new azure.customip.Prefix("global", {
name: "example-Global-CustomIPPrefix",
location: test.location,
resourceGroupName: test.name,
cidr: "2001:db8:1::/48",
roaValidityEndDate: "2199-12-12",
wanValidationSignedMessage: "signed message for WAN validation",
});
const regional = new azure.customip.Prefix("regional", {
name: "example-Regional-CustomIPPrefix",
location: test.location,
resourceGroupName: test.name,
parentCustomIpPrefixId: global.id,
cidr: global.cidr.apply(cidr => std.cidrsubnetOutput({
input: cidr,
newbits: 16,
netnum: 1,
})).apply(invoke => invoke.result),
zones: ["1"],
});
import pulumi
import pulumi_azure as azure
import pulumi_std as std
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
global_ = azure.customip.Prefix("global",
name="example-Global-CustomIPPrefix",
location=test["location"],
resource_group_name=test["name"],
cidr="2001:db8:1::/48",
roa_validity_end_date="2199-12-12",
wan_validation_signed_message="signed message for WAN validation")
regional = azure.customip.Prefix("regional",
name="example-Regional-CustomIPPrefix",
location=test["location"],
resource_group_name=test["name"],
parent_custom_ip_prefix_id=global_.id,
cidr=global_.cidr.apply(lambda cidr: std.cidrsubnet_output(input=cidr,
newbits=16,
netnum=1)).apply(lambda invoke: invoke.result),
zones=["1"])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
using Std = Pulumi.Std;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "example-resources",
Location = "West Europe",
});
var @global = new Azure.CustomIp.Prefix("global", new()
{
Name = "example-Global-CustomIPPrefix",
Location = test.Location,
ResourceGroupName = test.Name,
Cidr = "2001:db8:1::/48",
RoaValidityEndDate = "2199-12-12",
WanValidationSignedMessage = "signed message for WAN validation",
});
var regional = new Azure.CustomIp.Prefix("regional", new()
{
Name = "example-Regional-CustomIPPrefix",
Location = test.Location,
ResourceGroupName = test.Name,
ParentCustomIpPrefixId = @global.Id,
Cidr = @global.Cidr.Apply(cidr => Std.Cidrsubnet.Invoke(new()
{
Input = cidr,
Newbits = 16,
Netnum = 1,
})).Apply(invoke => invoke.Result),
Zones = new[]
{
"1",
},
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/customip"
"github.com/pulumi/pulumi-std/sdk/go/std"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("example-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
global, err := customip.NewPrefix(ctx, "global", &customip.PrefixArgs{
Name: pulumi.String("example-Global-CustomIPPrefix"),
Location: pulumi.Any(test.Location),
ResourceGroupName: pulumi.Any(test.Name),
Cidr: pulumi.String("2001:db8:1::/48"),
RoaValidityEndDate: pulumi.String("2199-12-12"),
WanValidationSignedMessage: pulumi.String("signed message for WAN validation"),
})
if err != nil {
return err
}
_, err = customip.NewPrefix(ctx, "regional", &customip.PrefixArgs{
Name: pulumi.String("example-Regional-CustomIPPrefix"),
Location: pulumi.Any(test.Location),
ResourceGroupName: pulumi.Any(test.Name),
ParentCustomIpPrefixId: global.ID(),
Cidr: pulumi.String(global.Cidr.ApplyT(func(cidr string) (std.CidrsubnetResult, error) {
return std.CidrsubnetResult(interface{}(std.CidrsubnetOutput(ctx, std.CidrsubnetOutputArgs{
Input: cidr,
Newbits: 16,
Netnum: 1,
}, nil))), nil
}).(std.CidrsubnetResultOutput).ApplyT(func(invoke std.CidrsubnetResult) (*string, error) {
return invoke.Result, nil
}).(pulumi.StringPtrOutput)),
Zones: pulumi.StringArray{
pulumi.String("1"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.customip.Prefix;
import com.pulumi.azure.customip.PrefixArgs;
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) {
var example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("example-resources")
.location("West Europe")
.build());
var global = new Prefix("global", PrefixArgs.builder()
.name("example-Global-CustomIPPrefix")
.location(test.location())
.resourceGroupName(test.name())
.cidr("2001:db8:1::/48")
.roaValidityEndDate("2199-12-12")
.wanValidationSignedMessage("signed message for WAN validation")
.build());
var regional = new Prefix("regional", PrefixArgs.builder()
.name("example-Regional-CustomIPPrefix")
.location(test.location())
.resourceGroupName(test.name())
.parentCustomIpPrefixId(global.id())
.cidr(global.cidr().applyValue(cidr -> StdFunctions.cidrsubnet()).applyValue(invoke -> invoke.result()))
.zones("1")
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
global:
type: azure:customip:Prefix
properties:
name: example-Global-CustomIPPrefix
location: ${test.location}
resourceGroupName: ${test.name}
cidr: 2001:db8:1::/48
roaValidityEndDate: 2199-12-12
wanValidationSignedMessage: signed message for WAN validation
regional:
type: azure:customip:Prefix
properties:
name: example-Regional-CustomIPPrefix
location: ${test.location}
resourceGroupName: ${test.name}
parentCustomIpPrefixId: ${global.id}
cidr:
fn::invoke:
function: std:cidrsubnet
arguments:
input: ${global.cidr}
newbits: 16
netnum: 1
return: result
zones:
- '1'
Import
A Custom IP Prefix can be imported using the resource id
, e.g.
$ pulumi import azure:customip/prefix:Prefix example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/customIPPrefixes/customIPPrefix1
Constructors
Properties
Specifies that the custom IP prefix should be commissioned after provisioning in Azure. Defaults to false
. !>Warning Changing the value of commissioning_enabled
from true
to false
causes the IP prefix to stop being advertised by Azure and is functionally equivalent to deleting it when used in a production setting.
Specifies that the custom IP prefix should not be publicly advertised on the Internet when commissioned (regional commissioning feature). Defaults to false
. !>Warning Changing the value of internet_advertising_disabled
from true
to false
causes the IP prefix to stop being advertised by Azure and is functionally equivalent to deleting it when used in a production setting.
Specifies the ID of the parent prefix. Only needed when creating a regional/child IPv6 prefix. Changing this forces a new resource to be created.
The name of the Resource Group in which to create the Custom IP Prefix. Changing this forces a new resource to be created.
The expiration date of the Route Origin Authorization (ROA) document which has been filed with the Routing Internet Registry (RIR) for this prefix. The expected format is YYYY-MM-DD
. Required when provisioning an IPv4 prefix or IPv6 global prefix. Changing this forces a new resource to be created.
The signed base64-encoded authorization message, which will be sent to Microsoft for WAN verification. Required when provisioning an IPv4 prefix or IPv6 global prefix. Refer to Azure documentation for more details about the process for your RIR. Changing this forces a new resource to be created.