Module batch

@pulumi/azure > batch

class Account

extends CustomResource

Manages an Azure Batch account.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const testResourceGroup = new azure.core.ResourceGroup("test", {
    location: "westeurope",
});
const testStorageAccount = new azure.storage.Account("test", {
    accountReplicationType: "LRS",
    accountTier: "Standard",
    location: testResourceGroup.location,
    resourceGroupName: testResourceGroup.name,
});
const testAccount = new azure.batch.Account("test", {
    location: testResourceGroup.location,
    poolAllocationMode: "BatchService",
    resourceGroupName: testResourceGroup.name,
    storageAccountId: testStorageAccount.id,
    tags: {
        env: "test",
    },
});

constructor

new Account(name: string, args: AccountArgs, opts?: pulumi.CustomResourceOptions)

Create a Account resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: AccountState, opts?: pulumi.CustomResourceOptions): Account

Get an existing Account resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property location

public location: pulumi.Output<string>;

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

property name

public name: pulumi.Output<string>;

Specifies the name of the Batch account. Changing this forces a new resource to be created.

property poolAllocationMode

public poolAllocationMode: pulumi.Output<string | undefined>;

Specifies the mode to use for pool allocation. Possible values are BatchService or UserSubscription. Defaults to BatchService.

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

The name of the resource group in which to create the Batch account. Changing this forces a new resource to be created.

property storageAccountId

public storageAccountId: pulumi.Output<string>;

Specifies the storage account to use for the Batch account. If not specified, Azure Batch will manage the storage.

property tags

public tags: pulumi.Output<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class Pool

extends CustomResource

Manages an Azure Batch pool.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const testResourceGroup = new azure.core.ResourceGroup("test", {
    location: "%s",
});
const testStorageAccount = new azure.storage.Account("test", {
    accountReplicationType: "LRS",
    accountTier: "Standard",
    location: testResourceGroup.location,
    resourceGroupName: testResourceGroup.name,
});
const testAccount = new azure.batch.Account("test", {
    location: testResourceGroup.location,
    poolAllocationMode: "BatchService",
    resourceGroupName: testResourceGroup.name,
    storageAccountId: testStorageAccount.id,
    tags: {
        env: "test",
    },
});
const testPool = new azure.batch.Pool("test", {
    accountName: testAccount.name,
    autoScale: {
        evaluationInterval: "PT15M",
        formula: `      startingNumberOfVMs = 1;
      maxNumberofVMs = 25;
      pendingTaskSamplePercent = $PendingTasks.GetSamplePercent(180 * TimeInterval_Second);
      pendingTaskSamples = pendingTaskSamplePercent < 70 ? startingNumberOfVMs : avg($PendingTasks.GetSample(180 *   TimeInterval_Second));
      $TargetDedicatedNodes=min(maxNumberofVMs, pendingTaskSamples);
`,
    },
    displayName: "Test Acc Pool Auto",
    nodeAgentSkuId: "batch.node.ubuntu 16.04",
    resourceGroupName: testResourceGroup.name,
    startTask: {
        commandLine: "echo 'Hello World from $env'",
        environment: {
            env: "TEST",
        },
        maxTaskRetryCount: 1,
        userIdentity: {
            autoUser: {
                elevationLevel: "NonAdmin",
                scope: "Task",
            },
        },
        waitForSuccess: true,
    },
    storageImageReference: {
        offer: "UbuntuServer",
        publisher: "Canonical",
        sku: "16.04.0-LTS",
        version: "latest",
    },
    vmSize: "Standard_A1",
});

constructor

new Pool(name: string, args: PoolArgs, opts?: pulumi.CustomResourceOptions)

Create a Pool resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: PoolState, opts?: pulumi.CustomResourceOptions): Pool

Get an existing Pool resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

static isInstance(obj: any): boolean

Returns true if the given object is an instance of CustomResource. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property accountName

public accountName: pulumi.Output<string>;

Specifies the name of the Batch account in which the pool will be created. Changing this forces a new resource to be created.

property autoScale

public autoScale: pulumi.Output<{
    evaluationInterval: string;
    formula: string;
} | undefined>;

A auto_scale block that describes the scale settings when using auto scale.

property displayName

public displayName: pulumi.Output<string | undefined>;

Specifies the display name of the Batch pool.

property fixedScale

public fixedScale: pulumi.Output<{
    resizeTimeout: string;
    targetDedicatedNodes: number;
    targetLowPriorityNodes: number;
} | undefined>;

A fixed_scale block that describes the scale settings when using fixed scale.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property maxTasksPerNode

public maxTasksPerNode: pulumi.Output<number | undefined>;

Specifies the maximum number of tasks that can run concurrently on a single compute node in the pool. Defaults to 1.

property name

public name: pulumi.Output<string>;

Specifies the name of the Batch pool. Changing this forces a new resource to be created.

property nodeAgentSkuId

public nodeAgentSkuId: pulumi.Output<string>;

Specifies the Sku of the node agents that will be created in the Batch pool.

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

The name of the resource group in which to create the Batch pool. Changing this forces a new resource to be created.

property startTask

public startTask: pulumi.Output<{
    commandLine: string;
    environment: {[key: string]: any};
    maxTaskRetryCount: number;
    userIdentity: {
        autoUser: {
            elevationLevel: string;
            scope: string;
        };
        userName: string;
    };
    waitForSuccess: boolean;
} | undefined>;

A start_task block that describes the start task settings for the Batch pool.

property stopPendingResizeOperation

public stopPendingResizeOperation: pulumi.Output<boolean | undefined>;

property storageImageReference

public storageImageReference: pulumi.Output<{
    id: string;
    offer: string;
    publisher: string;
    sku: string;
    version: string;
}>;

A storage_image_reference for the virtual machines that will compose the Batch pool.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

property vmSize

public vmSize: pulumi.Output<string>;

Specifies the size of the VM created in the Batch pool.

function getAccount

getAccount(args: GetAccountArgs, opts?: pulumi.InvokeOptions): Promise<GetAccountResult>

Use this data source to access information about an existing Batch Account.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const test = pulumi.output(azure.batch.getAccount({
    name: "testbatchaccount",
    resourceGroupName: "test",
}));

export const poolAllocationMode = test.apply(test => test.poolAllocationMode);

function getPool

getPool(args: GetPoolArgs, opts?: pulumi.InvokeOptions): Promise<GetPoolResult>

Use this data source to access information about an existing Batch pool

interface AccountArgs

The set of arguments for constructing a Account resource.

property location

location: pulumi.Input<string>;

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

Specifies the name of the Batch account. Changing this forces a new resource to be created.

property poolAllocationMode

poolAllocationMode?: pulumi.Input<string>;

Specifies the mode to use for pool allocation. Possible values are BatchService or UserSubscription. Defaults to BatchService.

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

The name of the resource group in which to create the Batch account. Changing this forces a new resource to be created.

property storageAccountId

storageAccountId?: pulumi.Input<string>;

Specifies the storage account to use for the Batch account. If not specified, Azure Batch will manage the storage.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

interface AccountState

Input properties used for looking up and filtering Account resources.

property location

location?: pulumi.Input<string>;

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

Specifies the name of the Batch account. Changing this forces a new resource to be created.

property poolAllocationMode

poolAllocationMode?: pulumi.Input<string>;

Specifies the mode to use for pool allocation. Possible values are BatchService or UserSubscription. Defaults to BatchService.

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

The name of the resource group in which to create the Batch account. Changing this forces a new resource to be created.

property storageAccountId

storageAccountId?: pulumi.Input<string>;

Specifies the storage account to use for the Batch account. If not specified, Azure Batch will manage the storage.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

interface GetAccountArgs

A collection of arguments for invoking getAccount.

property name

name: string;

The name of the Batch account.

property resourceGroupName

resourceGroupName: string;

The Name of the Resource Group where this Batch account exists.

interface GetAccountResult

A collection of values returned by getAccount.

property id

id: string;

id is the provider-assigned unique ID for this managed resource.

property location

location: string;

The Azure Region in which this Batch account exists.

property poolAllocationMode

poolAllocationMode: string;

The pool allocation mode configured for this Batch account.

property storageAccountId

storageAccountId: string;

The ID of the Storage Account used for this Batch account.

property tags

tags: {[key: string]: any};

A map of tags assigned to the Batch account.

interface GetPoolArgs

A collection of arguments for invoking getPool.

property accountName

accountName: string;

property name

name: string;

property resourceGroupName

resourceGroupName: string;

property startTask

startTask?: {
    commandLine: string;
    environment: {[key: string]: any};
    maxTaskRetryCount: number;
    userIdentities: {
        autoUsers: {
            elevationLevel: string;
            scope: string;
        }[];
        userName: string;
    }[];
    waitForSuccess: boolean;
};

interface GetPoolResult

A collection of values returned by getPool.

property autoScales

autoScales: {
    evaluationInterval: string;
    formula: string;
}[];

A auto_scale block that describes the scale settings when using auto scale.

property displayName

displayName: string;

property fixedScales

fixedScales: {
    resizeTimeout: string;
    targetDedicatedNodes: number;
    targetLowPriorityNodes: number;
}[];

A fixed_scale block that describes the scale settings when using fixed scale.

property id

id: string;

id is the provider-assigned unique ID for this managed resource.

property maxTasksPerNode

maxTasksPerNode: number;

The maximum number of tasks that can run concurrently on a single compute node in the pool.

property nodeAgentSkuId

nodeAgentSkuId: string;

The Sku of the node agents in the Batch pool.

property storageImageReferences

storageImageReferences: {
    id: string;
    offer: string;
    publisher: string;
    sku: string;
    version: string;
}[];

The reference of the storage image used by the nodes in the Batch pool.

property vmSize

vmSize: string;

The size of the VM created in the Batch pool.

interface PoolArgs

The set of arguments for constructing a Pool resource.

property accountName

accountName: pulumi.Input<string>;

Specifies the name of the Batch account in which the pool will be created. Changing this forces a new resource to be created.

property autoScale

autoScale?: pulumi.Input<{
    evaluationInterval: pulumi.Input<string>;
    formula: pulumi.Input<string>;
}>;

A auto_scale block that describes the scale settings when using auto scale.

property displayName

displayName?: pulumi.Input<string>;

Specifies the display name of the Batch pool.

property fixedScale

fixedScale?: pulumi.Input<{
    resizeTimeout: pulumi.Input<string>;
    targetDedicatedNodes: pulumi.Input<number>;
    targetLowPriorityNodes: pulumi.Input<number>;
}>;

A fixed_scale block that describes the scale settings when using fixed scale.

property maxTasksPerNode

maxTasksPerNode?: pulumi.Input<number>;

Specifies the maximum number of tasks that can run concurrently on a single compute node in the pool. Defaults to 1.

property name

name?: pulumi.Input<string>;

Specifies the name of the Batch pool. Changing this forces a new resource to be created.

property nodeAgentSkuId

nodeAgentSkuId: pulumi.Input<string>;

Specifies the Sku of the node agents that will be created in the Batch pool.

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

The name of the resource group in which to create the Batch pool. Changing this forces a new resource to be created.

property startTask

startTask?: pulumi.Input<{
    commandLine: pulumi.Input<string>;
    environment: pulumi.Input<{[key: string]: any}>;
    maxTaskRetryCount: pulumi.Input<number>;
    userIdentity: pulumi.Input<{
        autoUser: pulumi.Input<{
            elevationLevel: pulumi.Input<string>;
            scope: pulumi.Input<string>;
        }>;
        userName: pulumi.Input<string>;
    }>;
    waitForSuccess: pulumi.Input<boolean>;
}>;

A start_task block that describes the start task settings for the Batch pool.

property stopPendingResizeOperation

stopPendingResizeOperation?: pulumi.Input<boolean>;

property storageImageReference

storageImageReference: pulumi.Input<{
    id: pulumi.Input<string>;
    offer: pulumi.Input<string>;
    publisher: pulumi.Input<string>;
    sku: pulumi.Input<string>;
    version: pulumi.Input<string>;
}>;

A storage_image_reference for the virtual machines that will compose the Batch pool.

property vmSize

vmSize: pulumi.Input<string>;

Specifies the size of the VM created in the Batch pool.

interface PoolState

Input properties used for looking up and filtering Pool resources.

property accountName

accountName?: pulumi.Input<string>;

Specifies the name of the Batch account in which the pool will be created. Changing this forces a new resource to be created.

property autoScale

autoScale?: pulumi.Input<{
    evaluationInterval: pulumi.Input<string>;
    formula: pulumi.Input<string>;
}>;

A auto_scale block that describes the scale settings when using auto scale.

property displayName

displayName?: pulumi.Input<string>;

Specifies the display name of the Batch pool.

property fixedScale

fixedScale?: pulumi.Input<{
    resizeTimeout: pulumi.Input<string>;
    targetDedicatedNodes: pulumi.Input<number>;
    targetLowPriorityNodes: pulumi.Input<number>;
}>;

A fixed_scale block that describes the scale settings when using fixed scale.

property maxTasksPerNode

maxTasksPerNode?: pulumi.Input<number>;

Specifies the maximum number of tasks that can run concurrently on a single compute node in the pool. Defaults to 1.

property name

name?: pulumi.Input<string>;

Specifies the name of the Batch pool. Changing this forces a new resource to be created.

property nodeAgentSkuId

nodeAgentSkuId?: pulumi.Input<string>;

Specifies the Sku of the node agents that will be created in the Batch pool.

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

The name of the resource group in which to create the Batch pool. Changing this forces a new resource to be created.

property startTask

startTask?: pulumi.Input<{
    commandLine: pulumi.Input<string>;
    environment: pulumi.Input<{[key: string]: any}>;
    maxTaskRetryCount: pulumi.Input<number>;
    userIdentity: pulumi.Input<{
        autoUser: pulumi.Input<{
            elevationLevel: pulumi.Input<string>;
            scope: pulumi.Input<string>;
        }>;
        userName: pulumi.Input<string>;
    }>;
    waitForSuccess: pulumi.Input<boolean>;
}>;

A start_task block that describes the start task settings for the Batch pool.

property stopPendingResizeOperation

stopPendingResizeOperation?: pulumi.Input<boolean>;

property storageImageReference

storageImageReference?: pulumi.Input<{
    id: pulumi.Input<string>;
    offer: pulumi.Input<string>;
    publisher: pulumi.Input<string>;
    sku: pulumi.Input<string>;
    version: pulumi.Input<string>;
}>;

A storage_image_reference for the virtual machines that will compose the Batch pool.

property vmSize

vmSize?: pulumi.Input<string>;

Specifies the size of the VM created in the Batch pool.