Formula

class Formula : KotlinCustomResource

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}

Properties

Link copied to clipboard
val author: Output<String>

The author of the formula.

Link copied to clipboard
val azureApiVersion: Output<String>

The Azure API version of the resource.

Link copied to clipboard
val creationDate: Output<String>

The creation date of the formula.

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

The description of the formula.

Link copied to clipboard

The content of the formula.

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

The location of the resource.

Link copied to clipboard
val name: Output<String>

The name of the resource.

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

The OS type of the formula.

Link copied to clipboard

The provisioning status of the resource.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val tags: Output<Map<String, String>>?

The tags of the resource.

Link copied to clipboard
val type: Output<String>

The type of the resource.

Link copied to clipboard

The unique immutable identifier of a resource (Guid).

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard

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