com.pulumi.azure.customip.Prefix Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure Show documentation
Show all versions of azure Show documentation
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.
// *** 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.customip;
import com.pulumi.azure.Utilities;
import com.pulumi.azure.customip.PrefixArgs;
import com.pulumi.azure.customip.inputs.PrefixState;
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.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Manages a custom IPv4 prefix or custom IPv6 prefix.
*
* ## Example Usage
*
* *IPv4 custom prefix*
* <!--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.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());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* *IPv6 custom prefix*
* <!--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.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());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* A Custom IP Prefix can be imported using the `resource id`, e.g.
*
* ```sh
* $ pulumi import azure:customip/prefix:Prefix example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/customIPPrefixes/customIPPrefix1
* ```
*
*/
@ResourceType(type="azure:customip/prefix:Prefix")
public class Prefix extends com.pulumi.resources.CustomResource {
/**
* The `cidr` of the Custom IP Prefix, either IPv4 or IPv6. Changing this forces a new resource to be created.
*
*/
@Export(name="cidr", refs={String.class}, tree="[0]")
private Output cidr;
/**
* @return The `cidr` of the Custom IP Prefix, either IPv4 or IPv6. Changing this forces a new resource to be created.
*
*/
public Output cidr() {
return this.cidr;
}
/**
* 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.
*
*/
@Export(name="commissioningEnabled", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> commissioningEnabled;
/**
* @return 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.
*
*/
public Output> commissioningEnabled() {
return Codegen.optional(this.commissioningEnabled);
}
/**
* 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.
*
*/
@Export(name="internetAdvertisingDisabled", refs={Boolean.class}, tree="[0]")
private Output* @Nullable */ Boolean> internetAdvertisingDisabled;
/**
* @return 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.
*
*/
public Output> internetAdvertisingDisabled() {
return Codegen.optional(this.internetAdvertisingDisabled);
}
/**
* The location where the Custom IP Prefix should exist. Changing this forces a new resource to be created.
*
*/
@Export(name="location", refs={String.class}, tree="[0]")
private Output location;
/**
* @return The location where the Custom IP Prefix should exist. Changing this forces a new resource to be created.
*
*/
public Output location() {
return this.location;
}
/**
* The name of the Custom IP Prefix. Changing this forces a new resource to be created.
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return The name of the Custom IP Prefix. Changing this forces a new resource to be created.
*
*/
public Output name() {
return this.name;
}
/**
* 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.
*
*/
@Export(name="parentCustomIpPrefixId", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> parentCustomIpPrefixId;
/**
* @return 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.
*
*/
public Output> parentCustomIpPrefixId() {
return Codegen.optional(this.parentCustomIpPrefixId);
}
/**
* The name of the Resource Group in which to create the Custom IP Prefix. Changing this forces a new resource to be created.
*
*/
@Export(name="resourceGroupName", refs={String.class}, tree="[0]")
private Output resourceGroupName;
/**
* @return The name of the Resource Group in which to create the Custom IP Prefix. Changing this forces a new resource to be created.
*
*/
public Output resourceGroupName() {
return this.resourceGroupName;
}
/**
* 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.
*
*/
@Export(name="roaValidityEndDate", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> roaValidityEndDate;
/**
* @return 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.
*
*/
public Output> roaValidityEndDate() {
return Codegen.optional(this.roaValidityEndDate);
}
/**
* A mapping of tags to assign to the Custom IP Prefix.
*
*/
@Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
private Output* @Nullable */ Map> tags;
/**
* @return A mapping of tags to assign to the Custom IP Prefix.
*
*/
public Output>> tags() {
return Codegen.optional(this.tags);
}
/**
* 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](https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/create-custom-ip-address-prefix-cli#certificate-readiness) for more details about the process for your RIR. Changing this forces a new resource to be created.
*
*/
@Export(name="wanValidationSignedMessage", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> wanValidationSignedMessage;
/**
* @return 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](https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/create-custom-ip-address-prefix-cli#certificate-readiness) for more details about the process for your RIR. Changing this forces a new resource to be created.
*
*/
public Output> wanValidationSignedMessage() {
return Codegen.optional(this.wanValidationSignedMessage);
}
/**
* Specifies a list of Availability Zones in which this Custom IP Prefix should be located. Should not be specified when creating an IPv6 global prefix. Changing this forces a new resource to be created.
*
* > **Note:** In regions with [availability zones](https://docs.microsoft.com/en-us/azure/availability-zones/az-overview), the Custom IP Prefix must be specified as either `Zone-redundant` or assigned to a specific zone. It can't be created with no zone specified in these regions. All IPs from the prefix must have the same zonal properties.
*
*/
@Export(name="zones", refs={List.class,String.class}, tree="[0,1]")
private Output* @Nullable */ List> zones;
/**
* @return Specifies a list of Availability Zones in which this Custom IP Prefix should be located. Should not be specified when creating an IPv6 global prefix. Changing this forces a new resource to be created.
*
* > **Note:** In regions with [availability zones](https://docs.microsoft.com/en-us/azure/availability-zones/az-overview), the Custom IP Prefix must be specified as either `Zone-redundant` or assigned to a specific zone. It can't be created with no zone specified in these regions. All IPs from the prefix must have the same zonal properties.
*
*/
public Output>> zones() {
return Codegen.optional(this.zones);
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public Prefix(java.lang.String name) {
this(name, PrefixArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public Prefix(java.lang.String name, PrefixArgs 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 Prefix(java.lang.String name, PrefixArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:customip/prefix:Prefix", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private Prefix(java.lang.String name, Output id, @Nullable PrefixState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure:customip/prefix:Prefix", name, state, makeResourceOptions(options, id), false);
}
private static PrefixArgs makeArgs(PrefixArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? PrefixArgs.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 Prefix get(java.lang.String name, Output id, @Nullable PrefixState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new Prefix(name, id, state, options);
}
}