Pool Args
Contains information about a pool. API Version: 2021-01-01.
Example Usage
CreatePool - Custom Image
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var pool = new AzureNative.Batch.Pool("pool", new()
{
AccountName = "sampleacct",
DeploymentConfiguration = new AzureNative.Batch.Inputs.DeploymentConfigurationArgs
{
VirtualMachineConfiguration = new AzureNative.Batch.Inputs.VirtualMachineConfigurationArgs
{
ImageReference = new AzureNative.Batch.Inputs.ImageReferenceArgs
{
Id = "/subscriptions/subid/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1",
},
NodeAgentSkuId = "batch.node.ubuntu 18.04",
},
},
PoolName = "testpool",
ResourceGroupName = "default-azurebatch-japaneast",
VmSize = "STANDARD_D4",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.batch.Pool;
import com.pulumi.azurenative.batch.PoolArgs;
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 pool = new Pool("pool", PoolArgs.builder()
.accountName("sampleacct")
.deploymentConfiguration(Map.of("virtualMachineConfiguration", Map.ofEntries(
Map.entry("imageReference", Map.of("id", "/subscriptions/subid/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1")),
Map.entry("nodeAgentSkuId", "batch.node.ubuntu 18.04")
)))
.poolName("testpool")
.resourceGroupName("default-azurebatch-japaneast")
.vmSize("STANDARD_D4")
.build());
}
}
CreatePool - Full CloudServiceConfiguration
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var pool = new AzureNative.Batch.Pool("pool", new()
{
AccountName = "sampleacct",
ApplicationLicenses = new[]
{
"app-license0",
"app-license1",
},
ApplicationPackages = new[]
{
new AzureNative.Batch.Inputs.ApplicationPackageReferenceArgs
{
Id = "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/applications/app_1234",
Version = "asdf",
},
},
Certificates = new[]
{
new AzureNative.Batch.Inputs.CertificateReferenceArgs
{
Id = "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/certificates/sha1-1234567",
StoreLocation = AzureNative.Batch.CertificateStoreLocation.LocalMachine,
StoreName = "MY",
Visibility = new[]
{
AzureNative.Batch.CertificateVisibility.RemoteUser,
},
},
},
DeploymentConfiguration = new AzureNative.Batch.Inputs.DeploymentConfigurationArgs
{
CloudServiceConfiguration = new AzureNative.Batch.Inputs.CloudServiceConfigurationArgs
{
OsFamily = "4",
OsVersion = "WA-GUEST-OS-4.45_201708-01",
},
},
DisplayName = "my-pool-name",
InterNodeCommunication = AzureNative.Batch.InterNodeCommunicationState.Enabled,
Metadata = new[]
{
new AzureNative.Batch.Inputs.MetadataItemArgs
{
Name = "metadata-1",
Value = "value-1",
},
new AzureNative.Batch.Inputs.MetadataItemArgs
{
Name = "metadata-2",
Value = "value-2",
},
},
NetworkConfiguration = new AzureNative.Batch.Inputs.NetworkConfigurationArgs
{
PublicIPAddressConfiguration = new AzureNative.Batch.Inputs.PublicIPAddressConfigurationArgs
{
IpAddressIds = new[]
{
"/subscriptions/subid1/resourceGroups/rg13/providers/Microsoft.Network/publicIPAddresses/ip135",
"/subscriptions/subid2/resourceGroups/rg24/providers/Microsoft.Network/publicIPAddresses/ip268",
},
Provision = AzureNative.Batch.IPAddressProvisioningType.UserManaged,
},
SubnetId = "/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123",
},
PoolName = "testpool",
ResourceGroupName = "default-azurebatch-japaneast",
ScaleSettings = new AzureNative.Batch.Inputs.ScaleSettingsArgs
{
FixedScale = new AzureNative.Batch.Inputs.FixedScaleSettingsArgs
{
NodeDeallocationOption = AzureNative.Batch.ComputeNodeDeallocationOption.TaskCompletion,
ResizeTimeout = "PT8M",
TargetDedicatedNodes = 6,
TargetLowPriorityNodes = 28,
},
},
StartTask = new AzureNative.Batch.Inputs.StartTaskArgs
{
CommandLine = "cmd /c SET",
EnvironmentSettings = new[]
{
new AzureNative.Batch.Inputs.EnvironmentSettingArgs
{
Name = "MYSET",
Value = "1234",
},
},
MaxTaskRetryCount = 6,
ResourceFiles = new[]
{
new AzureNative.Batch.Inputs.ResourceFileArgs
{
FileMode = "777",
FilePath = "c:\\temp\\gohere",
HttpUrl = "https://testaccount.blob.core.windows.net/example-blob-file",
},
},
UserIdentity = new AzureNative.Batch.Inputs.UserIdentityArgs
{
AutoUser = new AzureNative.Batch.Inputs.AutoUserSpecificationArgs
{
ElevationLevel = AzureNative.Batch.ElevationLevel.Admin,
Scope = AzureNative.Batch.AutoUserScope.Pool,
},
},
WaitForSuccess = true,
},
TaskSchedulingPolicy = new AzureNative.Batch.Inputs.TaskSchedulingPolicyArgs
{
NodeFillType = AzureNative.Batch.ComputeNodeFillType.Pack,
},
TaskSlotsPerNode = 13,
UserAccounts = new[]
{
new AzureNative.Batch.Inputs.UserAccountArgs
{
ElevationLevel = AzureNative.Batch.ElevationLevel.Admin,
LinuxUserConfiguration = new AzureNative.Batch.Inputs.LinuxUserConfigurationArgs
{
Gid = 4567,
SshPrivateKey = "sshprivatekeyvalue",
Uid = 1234,
},
Name = "username1",
Password = "<ExamplePassword>",
},
},
VmSize = "STANDARD_D4",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.batch.Pool;
import com.pulumi.azurenative.batch.PoolArgs;
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 pool = new Pool("pool", PoolArgs.builder()
.accountName("sampleacct")
.applicationLicenses(
"app-license0",
"app-license1")
.applicationPackages(Map.ofEntries(
Map.entry("id", "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/applications/app_1234"),
Map.entry("version", "asdf")
))
.certificates(Map.ofEntries(
Map.entry("id", "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool/certificates/sha1-1234567"),
Map.entry("storeLocation", "LocalMachine"),
Map.entry("storeName", "MY"),
Map.entry("visibility", "RemoteUser")
))
.deploymentConfiguration(Map.of("cloudServiceConfiguration", Map.ofEntries(
Map.entry("osFamily", "4"),
Map.entry("osVersion", "WA-GUEST-OS-4.45_201708-01")
)))
.displayName("my-pool-name")
.interNodeCommunication("Enabled")
.metadata(
Map.ofEntries(
Map.entry("name", "metadata-1"),
Map.entry("value", "value-1")
),
Map.ofEntries(
Map.entry("name", "metadata-2"),
Map.entry("value", "value-2")
))
.networkConfiguration(Map.ofEntries(
Map.entry("publicIPAddressConfiguration", Map.ofEntries(
Map.entry("ipAddressIds",
"/subscriptions/subid1/resourceGroups/rg13/providers/Microsoft.Network/publicIPAddresses/ip135",
"/subscriptions/subid2/resourceGroups/rg24/providers/Microsoft.Network/publicIPAddresses/ip268"),
Map.entry("provision", "UserManaged")
)),
Map.entry("subnetId", "/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123")
))
.poolName("testpool")
.resourceGroupName("default-azurebatch-japaneast")
.scaleSettings(Map.of("fixedScale", Map.ofEntries(
Map.entry("nodeDeallocationOption", "TaskCompletion"),
Map.entry("resizeTimeout", "PT8M"),
Map.entry("targetDedicatedNodes", 6),
Map.entry("targetLowPriorityNodes", 28)
)))
.startTask(Map.ofEntries(
Map.entry("commandLine", "cmd /c SET"),
Map.entry("environmentSettings", Map.ofEntries(
Map.entry("name", "MYSET"),
Map.entry("value", "1234")
)),
Map.entry("maxTaskRetryCount", 6),
Map.entry("resourceFiles", Map.ofEntries(
Map.entry("fileMode", "777"),
Map.entry("filePath", "c:\\temp\\gohere"),
Map.entry("httpUrl", "https://testaccount.blob.core.windows.net/example-blob-file")
)),
Map.entry("userIdentity", Map.of("autoUser", Map.ofEntries(
Map.entry("elevationLevel", "Admin"),
Map.entry("scope", "Pool")
))),
Map.entry("waitForSuccess", true)
))
.taskSchedulingPolicy(Map.of("nodeFillType", "Pack"))
.taskSlotsPerNode(13)
.userAccounts(Map.ofEntries(
Map.entry("elevationLevel", "Admin"),
Map.entry("linuxUserConfiguration", Map.ofEntries(
Map.entry("gid", 4567),
Map.entry("sshPrivateKey", "sshprivatekeyvalue"),
Map.entry("uid", 1234)
)),
Map.entry("name", "username1"),
Map.entry("password", "<ExamplePassword>")
))
.vmSize("STANDARD_D4")
.build());
}
}
CreatePool - Full VirtualMachineConfiguration
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var pool = new AzureNative.Batch.Pool("pool", new()
{
AccountName = "sampleacct",
DeploymentConfiguration = new AzureNative.Batch.Inputs.DeploymentConfigurationArgs
{
VirtualMachineConfiguration = new AzureNative.Batch.Inputs.VirtualMachineConfigurationArgs
{
DataDisks = new[]
{
new AzureNative.Batch.Inputs.DataDiskArgs
{
Caching = AzureNative.Batch.CachingType.ReadWrite,
DiskSizeGB = 30,
Lun = 0,
StorageAccountType = AzureNative.Batch.StorageAccountType.Premium_LRS,
},
new AzureNative.Batch.Inputs.DataDiskArgs
{
Caching = AzureNative.Batch.CachingType.None,
DiskSizeGB = 200,
Lun = 1,
StorageAccountType = AzureNative.Batch.StorageAccountType.Standard_LRS,
},
},
DiskEncryptionConfiguration = new AzureNative.Batch.Inputs.DiskEncryptionConfigurationArgs
{
Targets = new[]
{
AzureNative.Batch.DiskEncryptionTarget.OsDisk,
AzureNative.Batch.DiskEncryptionTarget.TemporaryDisk,
},
},
ImageReference = new AzureNative.Batch.Inputs.ImageReferenceArgs
{
Offer = "WindowsServer",
Publisher = "MicrosoftWindowsServer",
Sku = "2016-Datacenter-SmallDisk",
Version = "latest",
},
LicenseType = "Windows_Server",
NodeAgentSkuId = "batch.node.windows amd64",
NodePlacementConfiguration = new AzureNative.Batch.Inputs.NodePlacementConfigurationArgs
{
Policy = AzureNative.Batch.NodePlacementPolicyType.Zonal,
},
WindowsConfiguration = new AzureNative.Batch.Inputs.WindowsConfigurationArgs
{
EnableAutomaticUpdates = false,
},
},
},
NetworkConfiguration = new AzureNative.Batch.Inputs.NetworkConfigurationArgs
{
EndpointConfiguration = new AzureNative.Batch.Inputs.PoolEndpointConfigurationArgs
{
InboundNatPools = new[]
{
new AzureNative.Batch.Inputs.InboundNatPoolArgs
{
BackendPort = 12001,
FrontendPortRangeEnd = 15100,
FrontendPortRangeStart = 15000,
Name = "testnat",
NetworkSecurityGroupRules = new[]
{
new AzureNative.Batch.Inputs.NetworkSecurityGroupRuleArgs
{
Access = AzureNative.Batch.NetworkSecurityGroupRuleAccess.Allow,
Priority = 150,
SourceAddressPrefix = "192.100.12.45",
SourcePortRanges = new[]
{
"1",
"2",
},
},
new AzureNative.Batch.Inputs.NetworkSecurityGroupRuleArgs
{
Access = AzureNative.Batch.NetworkSecurityGroupRuleAccess.Deny,
Priority = 3500,
SourceAddressPrefix = "*",
SourcePortRanges = new[]
{
"*",
},
},
},
Protocol = AzureNative.Batch.InboundEndpointProtocol.TCP,
},
},
},
},
PoolName = "testpool",
ResourceGroupName = "default-azurebatch-japaneast",
ScaleSettings = new AzureNative.Batch.Inputs.ScaleSettingsArgs
{
AutoScale = new AzureNative.Batch.Inputs.AutoScaleSettingsArgs
{
EvaluationInterval = "PT5M",
Formula = "$TargetDedicatedNodes=1",
},
},
VmSize = "STANDARD_D4",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.batch.Pool;
import com.pulumi.azurenative.batch.PoolArgs;
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 pool = new Pool("pool", PoolArgs.builder()
.accountName("sampleacct")
.deploymentConfiguration(Map.of("virtualMachineConfiguration", Map.ofEntries(
Map.entry("dataDisks",
Map.ofEntries(
Map.entry("caching", "ReadWrite"),
Map.entry("diskSizeGB", 30),
Map.entry("lun", 0),
Map.entry("storageAccountType", "Premium_LRS")
),
Map.ofEntries(
Map.entry("caching", "None"),
Map.entry("diskSizeGB", 200),
Map.entry("lun", 1),
Map.entry("storageAccountType", "Standard_LRS")
)),
Map.entry("diskEncryptionConfiguration", Map.of("targets",
"OsDisk",
"TemporaryDisk")),
Map.entry("imageReference", Map.ofEntries(
Map.entry("offer", "WindowsServer"),
Map.entry("publisher", "MicrosoftWindowsServer"),
Map.entry("sku", "2016-Datacenter-SmallDisk"),
Map.entry("version", "latest")
)),
Map.entry("licenseType", "Windows_Server"),
Map.entry("nodeAgentSkuId", "batch.node.windows amd64"),
Map.entry("nodePlacementConfiguration", Map.of("policy", "Zonal")),
Map.entry("windowsConfiguration", Map.of("enableAutomaticUpdates", false))
)))
.networkConfiguration(Map.of("endpointConfiguration", Map.of("inboundNatPools", Map.ofEntries(
Map.entry("backendPort", 12001),
Map.entry("frontendPortRangeEnd", 15100),
Map.entry("frontendPortRangeStart", 15000),
Map.entry("name", "testnat"),
Map.entry("networkSecurityGroupRules",
Map.ofEntries(
Map.entry("access", "Allow"),
Map.entry("priority", 150),
Map.entry("sourceAddressPrefix", "192.100.12.45"),
Map.entry("sourcePortRanges",
"1",
"2")
),
Map.ofEntries(
Map.entry("access", "Deny"),
Map.entry("priority", 3500),
Map.entry("sourceAddressPrefix", "*"),
Map.entry("sourcePortRanges", "*")
)),
Map.entry("protocol", "TCP")
))))
.poolName("testpool")
.resourceGroupName("default-azurebatch-japaneast")
.scaleSettings(Map.of("autoScale", Map.ofEntries(
Map.entry("evaluationInterval", "PT5M"),
Map.entry("formula", "$TargetDedicatedNodes=1")
)))
.vmSize("STANDARD_D4")
.build());
}
}
CreatePool - Minimal CloudServiceConfiguration
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var pool = new AzureNative.Batch.Pool("pool", new()
{
AccountName = "sampleacct",
DeploymentConfiguration = new AzureNative.Batch.Inputs.DeploymentConfigurationArgs
{
CloudServiceConfiguration = new AzureNative.Batch.Inputs.CloudServiceConfigurationArgs
{
OsFamily = "5",
},
},
PoolName = "testpool",
ResourceGroupName = "default-azurebatch-japaneast",
ScaleSettings = new AzureNative.Batch.Inputs.ScaleSettingsArgs
{
FixedScale = new AzureNative.Batch.Inputs.FixedScaleSettingsArgs
{
TargetDedicatedNodes = 3,
},
},
VmSize = "STANDARD_D4",
});
});
package main
import (
batch "github.com/pulumi/pulumi-azure-native-sdk/batch"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := batch.NewPool(ctx, "pool", &batch.PoolArgs{
AccountName: pulumi.String("sampleacct"),
DeploymentConfiguration: batch.DeploymentConfigurationResponse{
CloudServiceConfiguration: &batch.CloudServiceConfigurationArgs{
OsFamily: pulumi.String("5"),
},
},
PoolName: pulumi.String("testpool"),
ResourceGroupName: pulumi.String("default-azurebatch-japaneast"),
ScaleSettings: batch.ScaleSettingsResponse{
FixedScale: &batch.FixedScaleSettingsArgs{
TargetDedicatedNodes: pulumi.Int(3),
},
},
VmSize: pulumi.String("STANDARD_D4"),
})
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.batch.Pool;
import com.pulumi.azurenative.batch.PoolArgs;
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 pool = new Pool("pool", PoolArgs.builder()
.accountName("sampleacct")
.deploymentConfiguration(Map.of("cloudServiceConfiguration", Map.of("osFamily", "5")))
.poolName("testpool")
.resourceGroupName("default-azurebatch-japaneast")
.scaleSettings(Map.of("fixedScale", Map.of("targetDedicatedNodes", 3)))
.vmSize("STANDARD_D4")
.build());
}
}
CreatePool - Minimal VirtualMachineConfiguration
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var pool = new AzureNative.Batch.Pool("pool", new()
{
AccountName = "sampleacct",
DeploymentConfiguration = new AzureNative.Batch.Inputs.DeploymentConfigurationArgs
{
VirtualMachineConfiguration = new AzureNative.Batch.Inputs.VirtualMachineConfigurationArgs
{
ImageReference = new AzureNative.Batch.Inputs.ImageReferenceArgs
{
Offer = "UbuntuServer",
Publisher = "Canonical",
Sku = "18.04-LTS",
Version = "latest",
},
NodeAgentSkuId = "batch.node.ubuntu 18.04",
},
},
PoolName = "testpool",
ResourceGroupName = "default-azurebatch-japaneast",
ScaleSettings = new AzureNative.Batch.Inputs.ScaleSettingsArgs
{
AutoScale = new AzureNative.Batch.Inputs.AutoScaleSettingsArgs
{
EvaluationInterval = "PT5M",
Formula = "$TargetDedicatedNodes=1",
},
},
VmSize = "STANDARD_D4",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.batch.Pool;
import com.pulumi.azurenative.batch.PoolArgs;
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 pool = new Pool("pool", PoolArgs.builder()
.accountName("sampleacct")
.deploymentConfiguration(Map.of("virtualMachineConfiguration", Map.ofEntries(
Map.entry("imageReference", Map.ofEntries(
Map.entry("offer", "UbuntuServer"),
Map.entry("publisher", "Canonical"),
Map.entry("sku", "18.04-LTS"),
Map.entry("version", "latest")
)),
Map.entry("nodeAgentSkuId", "batch.node.ubuntu 18.04")
)))
.poolName("testpool")
.resourceGroupName("default-azurebatch-japaneast")
.scaleSettings(Map.of("autoScale", Map.ofEntries(
Map.entry("evaluationInterval", "PT5M"),
Map.entry("formula", "$TargetDedicatedNodes=1")
)))
.vmSize("STANDARD_D4")
.build());
}
}
CreatePool - No public IP
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var pool = new AzureNative.Batch.Pool("pool", new()
{
AccountName = "sampleacct",
DeploymentConfiguration = new AzureNative.Batch.Inputs.DeploymentConfigurationArgs
{
VirtualMachineConfiguration = new AzureNative.Batch.Inputs.VirtualMachineConfigurationArgs
{
ImageReference = new AzureNative.Batch.Inputs.ImageReferenceArgs
{
Id = "/subscriptions/subid/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1",
},
NodeAgentSkuId = "batch.node.ubuntu 18.04",
},
},
NetworkConfiguration = new AzureNative.Batch.Inputs.NetworkConfigurationArgs
{
PublicIPAddressConfiguration = new AzureNative.Batch.Inputs.PublicIPAddressConfigurationArgs
{
Provision = AzureNative.Batch.IPAddressProvisioningType.NoPublicIPAddresses,
},
SubnetId = "/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123",
},
PoolName = "testpool",
ResourceGroupName = "default-azurebatch-japaneast",
VmSize = "STANDARD_D4",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.batch.Pool;
import com.pulumi.azurenative.batch.PoolArgs;
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 pool = new Pool("pool", PoolArgs.builder()
.accountName("sampleacct")
.deploymentConfiguration(Map.of("virtualMachineConfiguration", Map.ofEntries(
Map.entry("imageReference", Map.of("id", "/subscriptions/subid/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1")),
Map.entry("nodeAgentSkuId", "batch.node.ubuntu 18.04")
)))
.networkConfiguration(Map.ofEntries(
Map.entry("publicIPAddressConfiguration", Map.of("provision", "NoPublicIPAddresses")),
Map.entry("subnetId", "/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123")
))
.poolName("testpool")
.resourceGroupName("default-azurebatch-japaneast")
.vmSize("STANDARD_D4")
.build());
}
}
CreatePool - Public IPs
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var pool = new AzureNative.Batch.Pool("pool", new()
{
AccountName = "sampleacct",
DeploymentConfiguration = new AzureNative.Batch.Inputs.DeploymentConfigurationArgs
{
VirtualMachineConfiguration = new AzureNative.Batch.Inputs.VirtualMachineConfigurationArgs
{
ImageReference = new AzureNative.Batch.Inputs.ImageReferenceArgs
{
Id = "/subscriptions/subid/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1",
},
NodeAgentSkuId = "batch.node.ubuntu 18.04",
},
},
NetworkConfiguration = new AzureNative.Batch.Inputs.NetworkConfigurationArgs
{
PublicIPAddressConfiguration = new AzureNative.Batch.Inputs.PublicIPAddressConfigurationArgs
{
IpAddressIds = new[]
{
"/subscriptions/subid1/resourceGroups/rg13/providers/Microsoft.Network/publicIPAddresses/ip135",
},
Provision = AzureNative.Batch.IPAddressProvisioningType.UserManaged,
},
SubnetId = "/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123",
},
PoolName = "testpool",
ResourceGroupName = "default-azurebatch-japaneast",
VmSize = "STANDARD_D4",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.batch.Pool;
import com.pulumi.azurenative.batch.PoolArgs;
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 pool = new Pool("pool", PoolArgs.builder()
.accountName("sampleacct")
.deploymentConfiguration(Map.of("virtualMachineConfiguration", Map.ofEntries(
Map.entry("imageReference", Map.of("id", "/subscriptions/subid/resourceGroups/networking-group/providers/Microsoft.Compute/galleries/testgallery/images/testimagedef/versions/0.0.1")),
Map.entry("nodeAgentSkuId", "batch.node.ubuntu 18.04")
)))
.networkConfiguration(Map.ofEntries(
Map.entry("publicIPAddressConfiguration", Map.ofEntries(
Map.entry("ipAddressIds", "/subscriptions/subid1/resourceGroups/rg13/providers/Microsoft.Network/publicIPAddresses/ip135"),
Map.entry("provision", "UserManaged")
)),
Map.entry("subnetId", "/subscriptions/subid/resourceGroups/rg1234/providers/Microsoft.Network/virtualNetworks/network1234/subnets/subnet123")
))
.poolName("testpool")
.resourceGroupName("default-azurebatch-japaneast")
.vmSize("STANDARD_D4")
.build());
}
}
CreatePool - UserAssignedIdentities
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var pool = new AzureNative.Batch.Pool("pool", new()
{
AccountName = "sampleacct",
DeploymentConfiguration = new AzureNative.Batch.Inputs.DeploymentConfigurationArgs
{
VirtualMachineConfiguration = new AzureNative.Batch.Inputs.VirtualMachineConfigurationArgs
{
ImageReference = new AzureNative.Batch.Inputs.ImageReferenceArgs
{
Offer = "UbuntuServer",
Publisher = "Canonical",
Sku = "18.04-LTS",
Version = "latest",
},
NodeAgentSkuId = "batch.node.ubuntu 18.04",
},
},
Identity = new AzureNative.Batch.Inputs.BatchPoolIdentityArgs
{
Type = AzureNative.Batch.PoolIdentityType.UserAssigned,
UserAssignedIdentities =
{
{ "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", null },
{ "/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2", null },
},
},
PoolName = "testpool",
ResourceGroupName = "default-azurebatch-japaneast",
ScaleSettings = new AzureNative.Batch.Inputs.ScaleSettingsArgs
{
AutoScale = new AzureNative.Batch.Inputs.AutoScaleSettingsArgs
{
EvaluationInterval = "PT5M",
Formula = "$TargetDedicatedNodes=1",
},
},
VmSize = "STANDARD_D4",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.batch.Pool;
import com.pulumi.azurenative.batch.PoolArgs;
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 pool = new Pool("pool", PoolArgs.builder()
.accountName("sampleacct")
.deploymentConfiguration(Map.of("virtualMachineConfiguration", Map.ofEntries(
Map.entry("imageReference", Map.ofEntries(
Map.entry("offer", "UbuntuServer"),
Map.entry("publisher", "Canonical"),
Map.entry("sku", "18.04-LTS"),
Map.entry("version", "latest")
)),
Map.entry("nodeAgentSkuId", "batch.node.ubuntu 18.04")
)))
.identity(Map.ofEntries(
Map.entry("type", "UserAssigned"),
Map.entry("userAssignedIdentities", Map.ofEntries(
Map.entry("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id1", ),
Map.entry("/subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.ManagedIdentity/userAssignedIdentities/id2", )
))
))
.poolName("testpool")
.resourceGroupName("default-azurebatch-japaneast")
.scaleSettings(Map.of("autoScale", Map.ofEntries(
Map.entry("evaluationInterval", "PT5M"),
Map.entry("formula", "$TargetDedicatedNodes=1")
)))
.vmSize("STANDARD_D4")
.build());
}
}
CreatePool - VirtualMachineConfiguration Extensions
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var pool = new AzureNative.Batch.Pool("pool", new()
{
AccountName = "sampleacct",
DeploymentConfiguration = new AzureNative.Batch.Inputs.DeploymentConfigurationArgs
{
VirtualMachineConfiguration = new AzureNative.Batch.Inputs.VirtualMachineConfigurationArgs
{
Extensions = new[]
{
new AzureNative.Batch.Inputs.VMExtensionArgs
{
AutoUpgradeMinorVersion = true,
Name = "batchextension1",
ProtectedSettings =
{
{ "protectedSettingsKey", "protectedSettingsValue" },
},
Publisher = "Microsoft.Azure.Security.Monitoring",
Settings =
{
{ "settingsKey", "settingsValue" },
},
Type = "SecurityMonitoringForLinux",
TypeHandlerVersion = "1.0",
},
},
ImageReference = new AzureNative.Batch.Inputs.ImageReferenceArgs
{
Offer = "UbuntuServer",
Publisher = "Canonical",
Sku = "16.04.0-LTS",
},
NodeAgentSkuId = "batch.node.ubuntu 16.04",
},
},
PoolName = "testpool",
ResourceGroupName = "default-azurebatch-japaneast",
ScaleSettings = new AzureNative.Batch.Inputs.ScaleSettingsArgs
{
AutoScale = new AzureNative.Batch.Inputs.AutoScaleSettingsArgs
{
EvaluationInterval = "PT5M",
Formula = "$TargetDedicatedNodes=1",
},
},
VmSize = "STANDARD_D4",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.batch.Pool;
import com.pulumi.azurenative.batch.PoolArgs;
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 pool = new Pool("pool", PoolArgs.builder()
.accountName("sampleacct")
.deploymentConfiguration(Map.of("virtualMachineConfiguration", Map.ofEntries(
Map.entry("extensions", Map.ofEntries(
Map.entry("autoUpgradeMinorVersion", true),
Map.entry("name", "batchextension1"),
Map.entry("protectedSettings", Map.of("protectedSettingsKey", "protectedSettingsValue")),
Map.entry("publisher", "Microsoft.Azure.Security.Monitoring"),
Map.entry("settings", Map.of("settingsKey", "settingsValue")),
Map.entry("type", "SecurityMonitoringForLinux"),
Map.entry("typeHandlerVersion", "1.0")
)),
Map.entry("imageReference", Map.ofEntries(
Map.entry("offer", "UbuntuServer"),
Map.entry("publisher", "Canonical"),
Map.entry("sku", "16.04.0-LTS")
)),
Map.entry("nodeAgentSkuId", "batch.node.ubuntu 16.04")
)))
.poolName("testpool")
.resourceGroupName("default-azurebatch-japaneast")
.scaleSettings(Map.of("autoScale", Map.ofEntries(
Map.entry("evaluationInterval", "PT5M"),
Map.entry("formula", "$TargetDedicatedNodes=1")
)))
.vmSize("STANDARD_D4")
.build());
}
}
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:batch:Pool testpool /subscriptions/subid/resourceGroups/default-azurebatch-japaneast/providers/Microsoft.Batch/batchAccounts/sampleacct/pools/testpool
Constructors
Properties
The name of the Batch account.
The list of application licenses must be a subset of available Batch service application licenses. If a license is requested which is not supported, pool creation will fail.
Changes to application package references affect all new compute nodes joining the pool, but do not affect compute nodes that are already in the pool until they are rebooted or reimaged. There is a maximum of 10 application package references on any given pool.
For Windows compute nodes, the Batch service installs the certificates to the specified certificate store and location. For Linux compute nodes, the certificates are stored in a directory inside the task working directory and an environment variable AZ_BATCH_CERTIFICATES_DIR is supplied to the task to query for this location. For certificates with visibility of 'remoteUser', a 'certs' directory is created in the user's home directory (e.g., /home/{user-name}/certs) and certificates are placed in that directory.
Using CloudServiceConfiguration specifies that the nodes should be creating using Azure Cloud Services (PaaS), while VirtualMachineConfiguration uses Azure Virtual Machines (IaaS).
The display name need not be unique and can contain any Unicode characters up to a maximum length of 1024.
The type of identity used for the Batch Pool.
This imposes restrictions on which nodes can be assigned to the pool. Enabling this value can reduce the chance of the requested number of nodes to be allocated in the pool. If not specified, this value defaults to 'Disabled'.
The Batch service does not assign any meaning to metadata; it is solely for the use of user code.
This supports Azure Files, NFS, CIFS/SMB, and Blobfuse.
The network configuration for a pool.
The name of the resource group that contains the Batch account.
Defines the desired size of the pool. This can either be 'fixedScale' where the requested targetDedicatedNodes is specified, or 'autoScale' which defines a formula which is periodically reevaluated. If this property is not specified, the pool will have a fixed scale with 0 targetDedicatedNodes.
In an PATCH (update) operation, this property can be set to an empty object to remove the start task from the pool.
If not specified, the default is spread.
The default value is 1. The maximum value is the smaller of 4 times the number of cores of the vmSize of the pool or 256.
For information about available sizes of virtual machines for Cloud Services pools (pools created with cloudServiceConfiguration), see Sizes for Cloud Services (https://azure.microsoft.com/documentation/articles/cloud-services-sizes-specs/). Batch supports all Cloud Services VM sizes except ExtraSmall. For information about available VM sizes for pools using images from the Virtual Machines Marketplace (pools created with virtualMachineConfiguration) see Sizes for Virtual Machines (Linux) (https://azure.microsoft.com/documentation/articles/virtual-machines-linux-sizes/) or Sizes for Virtual Machines (Windows) (https://azure.microsoft.com/documentation/articles/virtual-machines-windows-sizes/). Batch supports all Azure VM sizes except STANDARD_A0 and those with premium storage (STANDARD_GS, STANDARD_DS, and STANDARD_DSV2 series).