Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.azurenative.network.kotlin.IpAllocationArgs.kt Maven / Gradle / Ivy
Go to download
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azurenative.network.kotlin
import com.pulumi.azurenative.network.IpAllocationArgs.builder
import com.pulumi.azurenative.network.kotlin.enums.IPVersion
import com.pulumi.azurenative.network.kotlin.enums.IpAllocationType
import com.pulumi.core.Either
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* IpAllocation resource.
* Azure REST API version: 2023-02-01. Prior API version in Azure Native 1.x: 2020-11-01.
* Other available API versions: 2023-04-01, 2023-05-01, 2023-06-01, 2023-09-01, 2023-11-01, 2024-01-01.
* ## Example Usage
* ### Create IpAllocation
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using AzureNative = Pulumi.AzureNative;
* return await Deployment.RunAsync(() =>
* {
* var ipAllocation = new AzureNative.Network.IpAllocation("ipAllocation", new()
* {
* AllocationTags =
* {
* { "VNetID", "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet1" },
* },
* IpAllocationName = "test-ipallocation",
* Location = "centraluseuap",
* Prefix = "3.2.5.0/24",
* ResourceGroupName = "rg1",
* Type = AzureNative.Network.IpAllocationType.Hypernet,
* });
* });
* ```
* ```go
* package main
* import (
* network "github.com/pulumi/pulumi-azure-native-sdk/network/v2"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := network.NewIpAllocation(ctx, "ipAllocation", &network.IpAllocationArgs{
* AllocationTags: pulumi.StringMap{
* "VNetID": pulumi.String("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet1"),
* },
* IpAllocationName: pulumi.String("test-ipallocation"),
* Location: pulumi.String("centraluseuap"),
* Prefix: pulumi.String("3.2.5.0/24"),
* ResourceGroupName: pulumi.String("rg1"),
* Type: pulumi.String(network.IpAllocationTypeHypernet),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.network.IpAllocation;
* import com.pulumi.azurenative.network.IpAllocationArgs;
* 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 ipAllocation = new IpAllocation("ipAllocation", IpAllocationArgs.builder()
* .allocationTags(Map.of("VNetID", "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/HypernetVnet1"))
* .ipAllocationName("test-ipallocation")
* .location("centraluseuap")
* .prefix("3.2.5.0/24")
* .resourceGroupName("rg1")
* .type("Hypernet")
* .build());
* }
* }
* ```
* ## Import
* An existing resource can be imported using its type token, name, and identifier, e.g.
* ```sh
* $ pulumi import azure-native:network:IpAllocation test-ipallocation /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/IpAllocations/{ipAllocationName}
* ```
* @property allocationTags IpAllocation tags.
* @property id Resource ID.
* @property ipAllocationName The name of the IpAllocation.
* @property ipamAllocationId The IPAM allocation ID.
* @property location Resource location.
* @property prefix The address prefix for the IpAllocation.
* @property prefixLength The address prefix length for the IpAllocation.
* @property prefixType The address prefix Type for the IpAllocation.
* @property resourceGroupName The name of the resource group.
* @property tags Resource tags.
* @property type The type for the IpAllocation.
*/
public data class IpAllocationArgs(
public val allocationTags: Output>? = null,
public val id: Output? = null,
public val ipAllocationName: Output? = null,
public val ipamAllocationId: Output? = null,
public val location: Output? = null,
public val prefix: Output? = null,
public val prefixLength: Output? = null,
public val prefixType: Output>? = null,
public val resourceGroupName: Output? = null,
public val tags: Output>? = null,
public val type: Output>? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azurenative.network.IpAllocationArgs =
com.pulumi.azurenative.network.IpAllocationArgs.builder()
.allocationTags(
allocationTags?.applyValue({ args0 ->
args0.map({ args0 ->
args0.key.to(args0.value)
}).toMap()
}),
)
.id(id?.applyValue({ args0 -> args0 }))
.ipAllocationName(ipAllocationName?.applyValue({ args0 -> args0 }))
.ipamAllocationId(ipamAllocationId?.applyValue({ args0 -> args0 }))
.location(location?.applyValue({ args0 -> args0 }))
.prefix(prefix?.applyValue({ args0 -> args0 }))
.prefixLength(prefixLength?.applyValue({ args0 -> args0 }))
.prefixType(
prefixType?.applyValue({ args0 ->
args0.transform({ args0 -> args0 }, { args0 ->
args0.let({ args0 -> args0.toJava() })
})
}),
)
.resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
.tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
.type(
type?.applyValue({ args0 ->
args0.transform({ args0 -> args0 }, { args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
).build()
}
/**
* Builder for [IpAllocationArgs].
*/
@PulumiTagMarker
public class IpAllocationArgsBuilder internal constructor() {
private var allocationTags: Output>? = null
private var id: Output? = null
private var ipAllocationName: Output? = null
private var ipamAllocationId: Output? = null
private var location: Output? = null
private var prefix: Output? = null
private var prefixLength: Output? = null
private var prefixType: Output>? = null
private var resourceGroupName: Output? = null
private var tags: Output>? = null
private var type: Output>? = null
/**
* @param value IpAllocation tags.
*/
@JvmName("phdnmwffelrkfsrd")
public suspend fun allocationTags(`value`: Output>) {
this.allocationTags = value
}
/**
* @param value Resource ID.
*/
@JvmName("yibtcvkhqgnwmblj")
public suspend fun id(`value`: Output) {
this.id = value
}
/**
* @param value The name of the IpAllocation.
*/
@JvmName("sxuqwkjunkocfnkv")
public suspend fun ipAllocationName(`value`: Output) {
this.ipAllocationName = value
}
/**
* @param value The IPAM allocation ID.
*/
@JvmName("npppktndaerxbvur")
public suspend fun ipamAllocationId(`value`: Output) {
this.ipamAllocationId = value
}
/**
* @param value Resource location.
*/
@JvmName("thmeobldrkiydews")
public suspend fun location(`value`: Output) {
this.location = value
}
/**
* @param value The address prefix for the IpAllocation.
*/
@JvmName("dupbssshggjuexut")
public suspend fun prefix(`value`: Output) {
this.prefix = value
}
/**
* @param value The address prefix length for the IpAllocation.
*/
@JvmName("sgdiugetyexxsiak")
public suspend fun prefixLength(`value`: Output) {
this.prefixLength = value
}
/**
* @param value The address prefix Type for the IpAllocation.
*/
@JvmName("bhukyjhqifkjnmyi")
public suspend fun prefixType(`value`: Output>) {
this.prefixType = value
}
/**
* @param value The name of the resource group.
*/
@JvmName("vpmovtqkflfeqkef")
public suspend fun resourceGroupName(`value`: Output) {
this.resourceGroupName = value
}
/**
* @param value Resource tags.
*/
@JvmName("ssuansqvomutuvrw")
public suspend fun tags(`value`: Output>) {
this.tags = value
}
/**
* @param value The type for the IpAllocation.
*/
@JvmName("kjskoefvprxjbosy")
public suspend fun type(`value`: Output>) {
this.type = value
}
/**
* @param value IpAllocation tags.
*/
@JvmName("ninnuwqlbtrafhos")
public suspend fun allocationTags(`value`: Map?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.allocationTags = mapped
}
/**
* @param values IpAllocation tags.
*/
@JvmName("qtghesdiqwvgwsnm")
public fun allocationTags(vararg values: Pair) {
val toBeMapped = values.toMap()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.allocationTags = mapped
}
/**
* @param value Resource ID.
*/
@JvmName("oanhgilahtoqflhx")
public suspend fun id(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.id = mapped
}
/**
* @param value The name of the IpAllocation.
*/
@JvmName("fxoyobrjxjuonsdt")
public suspend fun ipAllocationName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.ipAllocationName = mapped
}
/**
* @param value The IPAM allocation ID.
*/
@JvmName("qagcvhphsesaqdio")
public suspend fun ipamAllocationId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.ipamAllocationId = mapped
}
/**
* @param value Resource location.
*/
@JvmName("soouvehgyxgvekxv")
public suspend fun location(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.location = mapped
}
/**
* @param value The address prefix for the IpAllocation.
*/
@JvmName("hxaobqthuxsmywlu")
public suspend fun prefix(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.prefix = mapped
}
/**
* @param value The address prefix length for the IpAllocation.
*/
@JvmName("hsbsggqgtejvgcni")
public suspend fun prefixLength(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.prefixLength = mapped
}
/**
* @param value The address prefix Type for the IpAllocation.
*/
@JvmName("jmvbrkotxcfmxxuu")
public suspend fun prefixType(`value`: Either?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.prefixType = mapped
}
/**
* @param value The address prefix Type for the IpAllocation.
*/
@JvmName("lbfmkycduljprguu")
public fun prefixType(`value`: String) {
val toBeMapped = Either.ofLeft(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.prefixType = mapped
}
/**
* @param value The address prefix Type for the IpAllocation.
*/
@JvmName("eoepvvjojyletdde")
public fun prefixType(`value`: IPVersion) {
val toBeMapped = Either.ofRight(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.prefixType = mapped
}
/**
* @param value The name of the resource group.
*/
@JvmName("inmqtlfjdeoalqfx")
public suspend fun resourceGroupName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.resourceGroupName = mapped
}
/**
* @param value Resource tags.
*/
@JvmName("wjlhjdoiunxguvic")
public suspend fun tags(`value`: Map?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.tags = mapped
}
/**
* @param values Resource tags.
*/
@JvmName("tmvcqbymghdltmmu")
public fun tags(vararg values: Pair) {
val toBeMapped = values.toMap()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.tags = mapped
}
/**
* @param value The type for the IpAllocation.
*/
@JvmName("wicdehslbgrvaexx")
public suspend fun type(`value`: Either?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.type = mapped
}
/**
* @param value The type for the IpAllocation.
*/
@JvmName("cbmleuyexegsoemp")
public fun type(`value`: String) {
val toBeMapped = Either.ofLeft(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.type = mapped
}
/**
* @param value The type for the IpAllocation.
*/
@JvmName("hivktjycfmgbwwgm")
public fun type(`value`: IpAllocationType) {
val toBeMapped = Either.ofRight(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.type = mapped
}
internal fun build(): IpAllocationArgs = IpAllocationArgs(
allocationTags = allocationTags,
id = id,
ipAllocationName = ipAllocationName,
ipamAllocationId = ipamAllocationId,
location = location,
prefix = prefix,
prefixLength = prefixLength,
prefixType = prefixType,
resourceGroupName = resourceGroupName,
tags = tags,
type = type,
)
}