FormulaArgs

data class FormulaArgs(val description: Output<String>? = null, val formulaContent: Output<LabVirtualMachineCreationParameterArgs>? = null, val labName: Output<String>? = null, val location: Output<String>? = null, val name: Output<String>? = null, val osType: Output<String>? = null, val resourceGroupName: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val vm: Output<FormulaPropertiesFromVmArgs>? = null) : ConvertibleToJava<FormulaArgs>

A formula for creating a VM, specifying an image base and other parameters Uses Azure REST API version 2018-09-15. In version 2.x of the Azure Native provider, it used API version 2018-09-15.

Example Usage

Formulas_CreateOrUpdate

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",
});
});
package main
import (
devtestlab "github.com/pulumi/pulumi-azure-native-sdk/devtestlab/v3"
"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
})
}
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.

$ pulumi import azure-native:devtestlab:Formula {formulaName} /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/formulas/{name}

Constructors

Link copied to clipboard
constructor(description: Output<String>? = null, formulaContent: Output<LabVirtualMachineCreationParameterArgs>? = null, labName: Output<String>? = null, location: Output<String>? = null, name: Output<String>? = null, osType: Output<String>? = null, resourceGroupName: Output<String>? = null, tags: Output<Map<String, String>>? = null, vm: Output<FormulaPropertiesFromVmArgs>? = null)

Properties

Link copied to clipboard
val description: Output<String>? = null

The description of the formula.

Link copied to clipboard

The content of the formula.

Link copied to clipboard
val labName: Output<String>? = null

The name of the lab.

Link copied to clipboard
val location: Output<String>? = null

The location of the resource.

Link copied to clipboard
val name: Output<String>? = null

The name of the formula.

Link copied to clipboard
val osType: Output<String>? = null

The OS type of the formula.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group.

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

The tags of the resource.

Link copied to clipboard
val vm: Output<FormulaPropertiesFromVmArgs>? = null

Information about a VM from which a formula is to be created.

Functions

Link copied to clipboard
open override fun toJava(): FormulaArgs