PublicIp

class PublicIp : KotlinCustomResource

Manages a Public IP Address.

Note If this resource is to be associated with a resource that requires disassociation before destruction (such as azure.network.NetworkInterface) it is recommended to set the lifecycle argument create_before_destroy = true. Otherwise, it can fail to disassociate on destruction.

Example Usage

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 examplePublicIp = new azure.network.PublicIp("example", {
name: "acceptanceTestPublicIp1",
resourceGroupName: example.name,
location: example.location,
allocationMethod: "Static",
tags: {
environment: "Production",
},
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_public_ip = azure.network.PublicIp("example",
name="acceptanceTestPublicIp1",
resource_group_name=example.name,
location=example.location,
allocation_method="Static",
tags={
"environment": "Production",
})
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 examplePublicIp = new Azure.Network.PublicIp("example", new()
{
Name = "acceptanceTestPublicIp1",
ResourceGroupName = example.Name,
Location = example.Location,
AllocationMethod = "Static",
Tags =
{
{ "environment", "Production" },
},
});
});
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"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 := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("example-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
_, err = network.NewPublicIp(ctx, "example", &network.PublicIpArgs{
Name: pulumi.String("acceptanceTestPublicIp1"),
ResourceGroupName: example.Name,
Location: example.Location,
AllocationMethod: pulumi.String("Static"),
Tags: pulumi.StringMap{
"environment": pulumi.String("Production"),
},
})
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.network.PublicIp;
import com.pulumi.azure.network.PublicIpArgs;
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 examplePublicIp = new PublicIp("examplePublicIp", PublicIpArgs.builder()
.name("acceptanceTestPublicIp1")
.resourceGroupName(example.name())
.location(example.location())
.allocationMethod("Static")
.tags(Map.of("environment", "Production"))
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
examplePublicIp:
type: azure:network:PublicIp
name: example
properties:
name: acceptanceTestPublicIp1
resourceGroupName: ${example.name}
location: ${example.location}
allocationMethod: Static
tags:
environment: Production

Import

Public IPs can be imported using the resource id, e.g.

$ pulumi import azure:network/publicIp:PublicIp myPublicIp /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/publicIPAddresses/myPublicIpAddress1

Properties

Link copied to clipboard

Defines the allocation method for this IP address. Possible values are Static or Dynamic.

Link copied to clipboard

The DDoS protection mode of the public IP. Possible values are Disabled, Enabled, and VirtualNetworkInherited. Defaults to VirtualNetworkInherited.

Link copied to clipboard

The ID of DDoS protection plan associated with the public IP.

Link copied to clipboard
val domainNameLabel: Output<String>?

Label for the Domain Name. Will be used to make up the FQDN. If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system.

Link copied to clipboard

Scope for the domain name label. If a domain name label scope is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS system with a hashed value includes in FQDN. Possible values are NoReuse, ResourceGroupReuse, SubscriptionReuse and TenantReuse. Changing this forces a new Public IP to be created.

Link copied to clipboard
val edgeZone: Output<String>?

Specifies the Edge Zone within the Azure Region where this Public IP should exist. Changing this forces a new Public IP to be created.

Link copied to clipboard
val fqdn: Output<String>

Fully qualified domain name of the A DNS record associated with the public IP. domain_name_label must be specified to get the fqdn. This is the concatenation of the domain_name_label and the regionalized DNS zone

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

Specifies the timeout for the TCP idle connection. The value can be set between 4 and 30 minutes.

Link copied to clipboard
val ipAddress: Output<String>

The IP address value that was allocated.

Link copied to clipboard
val ipTags: Output<Map<String, String>>?

A mapping of IP tags to assign to the public IP. Changing this forces a new resource to be created.

Link copied to clipboard
val ipVersion: Output<String>?

The IP Version to use, IPv6 or IPv4. Changing this forces a new resource to be created. Defaults to IPv4.

Link copied to clipboard
val location: Output<String>

Specifies the supported Azure location where the Public IP should exist. Changing this forces a new resource to be created.

Link copied to clipboard
val name: Output<String>

Specifies the name of the Public IP. Changing this forces a new Public IP to be created.

Link copied to clipboard
val publicIpPrefixId: Output<String>?

If specified then public IP address allocated will be provided from the public IP prefix resource. Changing this forces a new resource to be created.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The name of the Resource Group where this Public IP should exist. Changing this forces a new Public IP to be created.

Link copied to clipboard
val reverseFqdn: Output<String>?

A fully qualified domain name that resolves to this public IP address. If the reverseFqdn is specified, then a PTR DNS record is created pointing from the IP address in the in-addr.arpa domain to the reverse FQDN.

Link copied to clipboard
val sku: Output<String>?

The SKU of the Public IP. Accepted values are Basic and Standard. Defaults to Standard. Changing this forces a new resource to be created.

Link copied to clipboard
val skuTier: Output<String>?

The SKU Tier that should be used for the Public IP. Possible values are Regional and Global. Defaults to Regional. Changing this forces a new resource to be created.

Link copied to clipboard
val tags: Output<Map<String, String>>?

A mapping of tags to assign to the resource.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val zones: Output<List<String>>?

A collection containing the availability zone to allocate the Public IP in. Changing this forces a new resource to be created.