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.devtestlab.kotlin.FormulaArgs.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azurenative.devtestlab.kotlin
import com.pulumi.azurenative.devtestlab.FormulaArgs.builder
import com.pulumi.azurenative.devtestlab.kotlin.inputs.FormulaPropertiesFromVmArgs
import com.pulumi.azurenative.devtestlab.kotlin.inputs.FormulaPropertiesFromVmArgsBuilder
import com.pulumi.azurenative.devtestlab.kotlin.inputs.LabVirtualMachineCreationParameterArgs
import com.pulumi.azurenative.devtestlab.kotlin.inputs.LabVirtualMachineCreationParameterArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName
/**
* A formula for creating a VM, specifying an image base and other parameters
* Azure REST API version: 2018-09-15. Prior API version in Azure Native 1.x: 2018-09-15.
* Other available API versions: 2016-05-15.
* ## Example Usage
* ### Formulas_CreateOrUpdate
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using AzureNative = Pulumi.AzureNative;
* return await Deployment.RunAsync(() =>
* {
* var formula = new AzureNative.DevTestLab.Formula("formula", new()
* {
* Description = "Formula using a Linux base",
* FormulaContent = new AzureNative.DevTestLab.Inputs.LabVirtualMachineCreationParameterArgs
* {
* AllowClaim = false,
* Artifacts = new[]
* {
* new AzureNative.DevTestLab.Inputs.ArtifactInstallPropertiesArgs
* {
* ArtifactId = "/artifactsources/{artifactSourceName}/artifacts/linux-install-nodejs",
* Parameters = new() { },
* },
* },
* DisallowPublicIpAddress = true,
* GalleryImageReference = new AzureNative.DevTestLab.Inputs.GalleryImageReferenceArgs
* {
* Offer = "0001-com-ubuntu-server-groovy",
* OsType = "Linux",
* Publisher = "canonical",
* Sku = "20_10",
* Version = "latest",
* },
* IsAuthenticationWithSshKey = false,
* LabSubnetName = "Dtl{labName}Subnet",
* LabVirtualNetworkId = "/virtualnetworks/dtl{labName}",
* Location = "{location}",
* NetworkInterface = new AzureNative.DevTestLab.Inputs.NetworkInterfacePropertiesArgs
* {
* SharedPublicIpAddressConfiguration = new AzureNative.DevTestLab.Inputs.SharedPublicIpAddressConfigurationArgs
* {
* InboundNatRules = new[]
* {
* new AzureNative.DevTestLab.Inputs.InboundNatRuleArgs
* {
* BackendPort = 22,
* TransportProtocol = AzureNative.DevTestLab.TransportProtocol.Tcp,
* },
* },
* },
* },
* Notes = "Ubuntu Server 20.10",
* Size = "Standard_B1ms",
* StorageType = "Standard",
* UserName = "user",
* },
* LabName = "{labName}",
* Location = "{location}",
* Name = "{formulaName}",
* ResourceGroupName = "resourceGroupName",
* });
* });
* ```
* ```go
* package main
* import (
* devtestlab "github.com/pulumi/pulumi-azure-native-sdk/devtestlab/v2"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := devtestlab.NewFormula(ctx, "formula", &devtestlab.FormulaArgs{
* Description: pulumi.String("Formula using a Linux base"),
* FormulaContent: &devtestlab.LabVirtualMachineCreationParameterArgs{
* AllowClaim: pulumi.Bool(false),
* Artifacts: devtestlab.ArtifactInstallPropertiesArray{
* &devtestlab.ArtifactInstallPropertiesArgs{
* ArtifactId: pulumi.String("/artifactsources/{artifactSourceName}/artifacts/linux-install-nodejs"),
* Parameters: devtestlab.ArtifactParameterPropertiesArray{},
* },
* },
* DisallowPublicIpAddress: pulumi.Bool(true),
* GalleryImageReference: &devtestlab.GalleryImageReferenceArgs{
* Offer: pulumi.String("0001-com-ubuntu-server-groovy"),
* OsType: pulumi.String("Linux"),
* Publisher: pulumi.String("canonical"),
* Sku: pulumi.String("20_10"),
* Version: pulumi.String("latest"),
* },
* IsAuthenticationWithSshKey: pulumi.Bool(false),
* LabSubnetName: pulumi.String("Dtl{labName}Subnet"),
* LabVirtualNetworkId: pulumi.String("/virtualnetworks/dtl{labName}"),
* Location: pulumi.String("{location}"),
* NetworkInterface: &devtestlab.NetworkInterfacePropertiesArgs{
* SharedPublicIpAddressConfiguration: &devtestlab.SharedPublicIpAddressConfigurationArgs{
* InboundNatRules: devtestlab.InboundNatRuleArray{
* &devtestlab.InboundNatRuleArgs{
* BackendPort: pulumi.Int(22),
* TransportProtocol: pulumi.String(devtestlab.TransportProtocolTcp),
* },
* },
* },
* },
* Notes: pulumi.String("Ubuntu Server 20.10"),
* Size: pulumi.String("Standard_B1ms"),
* StorageType: pulumi.String("Standard"),
* UserName: pulumi.String("user"),
* },
* LabName: pulumi.String("{labName}"),
* Location: pulumi.String("{location}"),
* Name: pulumi.String("{formulaName}"),
* ResourceGroupName: pulumi.String("resourceGroupName"),
* })
* 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.devtestlab.Formula;
* import com.pulumi.azurenative.devtestlab.FormulaArgs;
* import com.pulumi.azurenative.devtestlab.inputs.LabVirtualMachineCreationParameterArgs;
* import com.pulumi.azurenative.devtestlab.inputs.GalleryImageReferenceArgs;
* import com.pulumi.azurenative.devtestlab.inputs.NetworkInterfacePropertiesArgs;
* import com.pulumi.azurenative.devtestlab.inputs.SharedPublicIpAddressConfigurationArgs;
* 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 formula = new Formula("formula", FormulaArgs.builder()
* .description("Formula using a Linux base")
* .formulaContent(LabVirtualMachineCreationParameterArgs.builder()
* .allowClaim(false)
* .artifacts(ArtifactInstallPropertiesArgs.builder()
* .artifactId("/artifactsources/{artifactSourceName}/artifacts/linux-install-nodejs")
* .parameters()
* .build())
* .disallowPublicIpAddress(true)
* .galleryImageReference(GalleryImageReferenceArgs.builder()
* .offer("0001-com-ubuntu-server-groovy")
* .osType("Linux")
* .publisher("canonical")
* .sku("20_10")
* .version("latest")
* .build())
* .isAuthenticationWithSshKey(false)
* .labSubnetName("Dtl{labName}Subnet")
* .labVirtualNetworkId("/virtualnetworks/dtl{labName}")
* .location("{location}")
* .networkInterface(NetworkInterfacePropertiesArgs.builder()
* .sharedPublicIpAddressConfiguration(SharedPublicIpAddressConfigurationArgs.builder()
* .inboundNatRules(InboundNatRuleArgs.builder()
* .backendPort(22)
* .transportProtocol("Tcp")
* .build())
* .build())
* .build())
* .notes("Ubuntu Server 20.10")
* .size("Standard_B1ms")
* .storageType("Standard")
* .userName("user")
* .build())
* .labName("{labName}")
* .location("{location}")
* .name("{formulaName}")
* .resourceGroupName("resourceGroupName")
* .build());
* }
* }
* ```
* ## Import
* An existing resource can be imported using its type token, name, and identifier, e.g.
* ```sh
* $ pulumi import azure-native:devtestlab:Formula {formulaName} /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/formulas/{name}
* ```
* @property description The description of the formula.
* @property formulaContent The content of the formula.
* @property labName The name of the lab.
* @property location The location of the resource.
* @property name The name of the formula.
* @property osType The OS type of the formula.
* @property resourceGroupName The name of the resource group.
* @property tags The tags of the resource.
* @property vm Information about a VM from which a formula is to be created.
*/
public data class FormulaArgs(
public val description: Output? = null,
public val formulaContent: Output? = null,
public val labName: Output? = null,
public val location: Output? = null,
public val name: Output? = null,
public val osType: Output? = null,
public val resourceGroupName: Output? = null,
public val tags: Output>? = null,
public val vm: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azurenative.devtestlab.FormulaArgs =
com.pulumi.azurenative.devtestlab.FormulaArgs.builder()
.description(description?.applyValue({ args0 -> args0 }))
.formulaContent(formulaContent?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.labName(labName?.applyValue({ args0 -> args0 }))
.location(location?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 }))
.osType(osType?.applyValue({ args0 -> args0 }))
.resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
.tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
.vm(vm?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}
/**
* Builder for [FormulaArgs].
*/
@PulumiTagMarker
public class FormulaArgsBuilder internal constructor() {
private var description: Output? = null
private var formulaContent: Output? = null
private var labName: Output? = null
private var location: Output? = null
private var name: Output? = null
private var osType: Output? = null
private var resourceGroupName: Output? = null
private var tags: Output>? = null
private var vm: Output? = null
/**
* @param value The description of the formula.
*/
@JvmName("aybndtpegmknnqua")
public suspend fun description(`value`: Output) {
this.description = value
}
/**
* @param value The content of the formula.
*/
@JvmName("ncildyjdmmuebdcb")
public suspend fun formulaContent(`value`: Output) {
this.formulaContent = value
}
/**
* @param value The name of the lab.
*/
@JvmName("mgcdaesmupwxufeg")
public suspend fun labName(`value`: Output) {
this.labName = value
}
/**
* @param value The location of the resource.
*/
@JvmName("ywoywoofwgeybatn")
public suspend fun location(`value`: Output) {
this.location = value
}
/**
* @param value The name of the formula.
*/
@JvmName("yptepsnjpiihsjer")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value The OS type of the formula.
*/
@JvmName("gkktcfvpyyrfpcbi")
public suspend fun osType(`value`: Output) {
this.osType = value
}
/**
* @param value The name of the resource group.
*/
@JvmName("jswpiccptydxrini")
public suspend fun resourceGroupName(`value`: Output) {
this.resourceGroupName = value
}
/**
* @param value The tags of the resource.
*/
@JvmName("mlukfpatojomyfge")
public suspend fun tags(`value`: Output>) {
this.tags = value
}
/**
* @param value Information about a VM from which a formula is to be created.
*/
@JvmName("cerylftwubottagk")
public suspend fun vm(`value`: Output) {
this.vm = value
}
/**
* @param value The description of the formula.
*/
@JvmName("unoctlscxwxidjmw")
public suspend fun description(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.description = mapped
}
/**
* @param value The content of the formula.
*/
@JvmName("jvxlowtjdlqomwdj")
public suspend fun formulaContent(`value`: LabVirtualMachineCreationParameterArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.formulaContent = mapped
}
/**
* @param argument The content of the formula.
*/
@JvmName("edoslkeifgccrube")
public suspend fun formulaContent(argument: suspend LabVirtualMachineCreationParameterArgsBuilder.() -> Unit) {
val toBeMapped = LabVirtualMachineCreationParameterArgsBuilder().applySuspend {
argument()
}.build()
val mapped = of(toBeMapped)
this.formulaContent = mapped
}
/**
* @param value The name of the lab.
*/
@JvmName("eblecaqussmtntmv")
public suspend fun labName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.labName = mapped
}
/**
* @param value The location of the resource.
*/
@JvmName("cnxivetxyrhhjbqx")
public suspend fun location(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.location = mapped
}
/**
* @param value The name of the formula.
*/
@JvmName("lfldssfgrkirrukb")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
/**
* @param value The OS type of the formula.
*/
@JvmName("ofyoopgvqelesdtu")
public suspend fun osType(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.osType = mapped
}
/**
* @param value The name of the resource group.
*/
@JvmName("iatxwxmroxwltomo")
public suspend fun resourceGroupName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.resourceGroupName = mapped
}
/**
* @param value The tags of the resource.
*/
@JvmName("uxommvnecxdybxdr")
public suspend fun tags(`value`: Map?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.tags = mapped
}
/**
* @param values The tags of the resource.
*/
@JvmName("vnbhcfknybbkhiea")
public fun tags(vararg values: Pair) {
val toBeMapped = values.toMap()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.tags = mapped
}
/**
* @param value Information about a VM from which a formula is to be created.
*/
@JvmName("ssdnttcuowhlglkh")
public suspend fun vm(`value`: FormulaPropertiesFromVmArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.vm = mapped
}
/**
* @param argument Information about a VM from which a formula is to be created.
*/
@JvmName("nlpyhmwupntxoofg")
public suspend fun vm(argument: suspend FormulaPropertiesFromVmArgsBuilder.() -> Unit) {
val toBeMapped = FormulaPropertiesFromVmArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.vm = mapped
}
internal fun build(): FormulaArgs = FormulaArgs(
description = description,
formulaContent = formulaContent,
labName = labName,
location = location,
name = name,
osType = osType,
resourceGroupName = resourceGroupName,
tags = tags,
vm = vm,
)
}