All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.network.PublicIp Maven / Gradle / Ivy

Go to download

A Pulumi package for creating and managing Microsoft Azure cloud resources, based on the Terraform azurerm provider. We recommend using the [Azure Native provider](https://github.com/pulumi/pulumi-azure-native) to provision Azure infrastructure. Azure Native provides complete coverage of Azure resources and same-day access to new resources and resource updates.

There is a newer version: 6.10.0-alpha.1731737215
Show newest version
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azure.network;

import com.pulumi.azure.Utilities;
import com.pulumi.azure.network.PublicIpArgs;
import com.pulumi.azure.network.inputs.PublicIpState;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * 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
 * 
 * <!--Start PulumiCodeChooser -->
 * 
 * {@code
 * 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());
 * 
 *     }
 * }
 * }
 * 
* <!--End PulumiCodeChooser --> * * ## Import * * Public IPs can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:network/publicIp:PublicIp myPublicIp /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/publicIPAddresses/myPublicIpAddress1 * ``` * */ @ResourceType(type="azure:network/publicIp:PublicIp") public class PublicIp extends com.pulumi.resources.CustomResource { /** * Defines the allocation method for this IP address. Possible values are `Static` or `Dynamic`. * * > **Note** `Dynamic` Public IP Addresses aren't allocated until they're assigned to a resource (such as a Virtual Machine or a Load Balancer) by design within Azure. See `ip_address` argument. * */ @Export(name="allocationMethod", refs={String.class}, tree="[0]") private Output allocationMethod; /** * @return Defines the allocation method for this IP address. Possible values are `Static` or `Dynamic`. * * > **Note** `Dynamic` Public IP Addresses aren't allocated until they're assigned to a resource (such as a Virtual Machine or a Load Balancer) by design within Azure. See `ip_address` argument. * */ public Output allocationMethod() { return this.allocationMethod; } /** * The DDoS protection mode of the public IP. Possible values are `Disabled`, `Enabled`, and `VirtualNetworkInherited`. Defaults to `VirtualNetworkInherited`. * */ @Export(name="ddosProtectionMode", refs={String.class}, tree="[0]") private Output ddosProtectionMode; /** * @return The DDoS protection mode of the public IP. Possible values are `Disabled`, `Enabled`, and `VirtualNetworkInherited`. Defaults to `VirtualNetworkInherited`. * */ public Output> ddosProtectionMode() { return Codegen.optional(this.ddosProtectionMode); } /** * The ID of DDoS protection plan associated with the public IP. * * > **Note:** `ddos_protection_plan_id` can only be set when `ddos_protection_mode` is `Enabled`. * */ @Export(name="ddosProtectionPlanId", refs={String.class}, tree="[0]") private Output ddosProtectionPlanId; /** * @return The ID of DDoS protection plan associated with the public IP. * * > **Note:** `ddos_protection_plan_id` can only be set when `ddos_protection_mode` is `Enabled`. * */ public Output> ddosProtectionPlanId() { return Codegen.optional(this.ddosProtectionPlanId); } /** * 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. * */ @Export(name="domainNameLabel", refs={String.class}, tree="[0]") private Output domainNameLabel; /** * @return 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. * */ public Output> domainNameLabel() { return Codegen.optional(this.domainNameLabel); } /** * Specifies the Edge Zone within the Azure Region where this Public IP should exist. Changing this forces a new Public IP to be created. * */ @Export(name="edgeZone", refs={String.class}, tree="[0]") private Output edgeZone; /** * @return Specifies the Edge Zone within the Azure Region where this Public IP should exist. Changing this forces a new Public IP to be created. * */ public Output> edgeZone() { return Codegen.optional(this.edgeZone); } /** * 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 * */ @Export(name="fqdn", refs={String.class}, tree="[0]") private Output fqdn; /** * @return 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 * */ public Output fqdn() { return this.fqdn; } /** * Specifies the timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. * */ @Export(name="idleTimeoutInMinutes", refs={Integer.class}, tree="[0]") private Output idleTimeoutInMinutes; /** * @return Specifies the timeout for the TCP idle connection. The value can be set between 4 and 30 minutes. * */ public Output> idleTimeoutInMinutes() { return Codegen.optional(this.idleTimeoutInMinutes); } /** * The IP address value that was allocated. * */ @Export(name="ipAddress", refs={String.class}, tree="[0]") private Output ipAddress; /** * @return The IP address value that was allocated. * */ public Output ipAddress() { return this.ipAddress; } /** * A mapping of IP tags to assign to the public IP. Changing this forces a new resource to be created. * * > **Note** IP Tag `RoutingPreference` requires multiple `zones` and `Standard` SKU to be set. * */ @Export(name="ipTags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> ipTags; /** * @return A mapping of IP tags to assign to the public IP. Changing this forces a new resource to be created. * * > **Note** IP Tag `RoutingPreference` requires multiple `zones` and `Standard` SKU to be set. * */ public Output>> ipTags() { return Codegen.optional(this.ipTags); } /** * The IP Version to use, IPv6 or IPv4. Changing this forces a new resource to be created. Defaults to `IPv4`. * * > **Note** Only `static` IP address allocation is supported for IPv6. * */ @Export(name="ipVersion", refs={String.class}, tree="[0]") private Output ipVersion; /** * @return The IP Version to use, IPv6 or IPv4. Changing this forces a new resource to be created. Defaults to `IPv4`. * * > **Note** Only `static` IP address allocation is supported for IPv6. * */ public Output> ipVersion() { return Codegen.optional(this.ipVersion); } /** * Specifies the supported Azure location where the Public IP should exist. Changing this forces a new resource to be created. * */ @Export(name="location", refs={String.class}, tree="[0]") private Output location; /** * @return Specifies the supported Azure location where the Public IP should exist. Changing this forces a new resource to be created. * */ public Output location() { return this.location; } /** * Specifies the name of the Public IP. Changing this forces a new Public IP to be created. * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return Specifies the name of the Public IP. Changing this forces a new Public IP to be created. * */ public Output name() { return this.name; } /** * 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. * */ @Export(name="publicIpPrefixId", refs={String.class}, tree="[0]") private Output publicIpPrefixId; /** * @return 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. * */ public Output> publicIpPrefixId() { return Codegen.optional(this.publicIpPrefixId); } /** * The name of the Resource Group where this Public IP should exist. Changing this forces a new Public IP to be created. * */ @Export(name="resourceGroupName", refs={String.class}, tree="[0]") private Output resourceGroupName; /** * @return The name of the Resource Group where this Public IP should exist. Changing this forces a new Public IP to be created. * */ public Output resourceGroupName() { return this.resourceGroupName; } /** * 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. * */ @Export(name="reverseFqdn", refs={String.class}, tree="[0]") private Output reverseFqdn; /** * @return 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. * */ public Output> reverseFqdn() { return Codegen.optional(this.reverseFqdn); } /** * The SKU of the Public IP. Accepted values are `Basic` and `Standard`. Defaults to `Standard`. Changing this forces a new resource to be created. * * > **Note** Public IP Standard SKUs require `allocation_method` to be set to `Static`. * */ @Export(name="sku", refs={String.class}, tree="[0]") private Output sku; /** * @return The SKU of the Public IP. Accepted values are `Basic` and `Standard`. Defaults to `Standard`. Changing this forces a new resource to be created. * * > **Note** Public IP Standard SKUs require `allocation_method` to be set to `Static`. * */ public Output> sku() { return Codegen.optional(this.sku); } /** * 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. * * > **Note** When `sku_tier` is set to `Global`, `sku` must be set to `Standard`. * */ @Export(name="skuTier", refs={String.class}, tree="[0]") private Output skuTier; /** * @return 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. * * > **Note** When `sku_tier` is set to `Global`, `sku` must be set to `Standard`. * */ public Output> skuTier() { return Codegen.optional(this.skuTier); } /** * A mapping of tags to assign to the resource. * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return A mapping of tags to assign to the resource. * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * A collection containing the availability zone to allocate the Public IP in. Changing this forces a new resource to be created. * * > **Note:** Availability Zones are only supported with a [Standard SKU](https://docs.microsoft.com/azure/virtual-network/virtual-network-ip-addresses-overview-arm#standard) and [in select regions](https://docs.microsoft.com/azure/availability-zones/az-overview) at this time. Standard SKU Public IP Addresses that do not specify a zone are **not** zone-redundant by default. * */ @Export(name="zones", refs={List.class,String.class}, tree="[0,1]") private Output> zones; /** * @return A collection containing the availability zone to allocate the Public IP in. Changing this forces a new resource to be created. * * > **Note:** Availability Zones are only supported with a [Standard SKU](https://docs.microsoft.com/azure/virtual-network/virtual-network-ip-addresses-overview-arm#standard) and [in select regions](https://docs.microsoft.com/azure/availability-zones/az-overview) at this time. Standard SKU Public IP Addresses that do not specify a zone are **not** zone-redundant by default. * */ public Output>> zones() { return Codegen.optional(this.zones); } /** * * @param name The _unique_ name of the resulting resource. */ public PublicIp(java.lang.String name) { this(name, PublicIpArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public PublicIp(java.lang.String name, PublicIpArgs args) { this(name, args, null); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. * @param options A bag of options that control this resource's behavior. */ public PublicIp(java.lang.String name, PublicIpArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:network/publicIp:PublicIp", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private PublicIp(java.lang.String name, Output id, @Nullable PublicIpState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure:network/publicIp:PublicIp", name, state, makeResourceOptions(options, id), false); } private static PublicIpArgs makeArgs(PublicIpArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? PublicIpArgs.Empty : args; } private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() .version(Utilities.getVersion()) .build(); return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); } /** * Get an existing Host resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state * @param options Optional settings to control the behavior of the CustomResource. */ public static PublicIp get(java.lang.String name, Output id, @Nullable PublicIpState state, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new PublicIp(name, id, state, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy