aws logo
AWS Classic v5.33.0, Mar 24 23

aws.batch.SchedulingPolicy

Provides a Batch Scheduling Policy resource.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.Batch.SchedulingPolicy("example", new()
    {
        FairSharePolicy = new Aws.Batch.Inputs.SchedulingPolicyFairSharePolicyArgs
        {
            ComputeReservation = 1,
            ShareDecaySeconds = 3600,
            ShareDistributions = new[]
            {
                new Aws.Batch.Inputs.SchedulingPolicyFairSharePolicyShareDistributionArgs
                {
                    ShareIdentifier = "A1*",
                    WeightFactor = 0.1,
                },
                new Aws.Batch.Inputs.SchedulingPolicyFairSharePolicyShareDistributionArgs
                {
                    ShareIdentifier = "A2",
                    WeightFactor = 0.2,
                },
            },
        },
        Tags = 
        {
            { "Name", "Example Batch Scheduling Policy" },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/batch"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := batch.NewSchedulingPolicy(ctx, "example", &batch.SchedulingPolicyArgs{
			FairSharePolicy: &batch.SchedulingPolicyFairSharePolicyArgs{
				ComputeReservation: pulumi.Int(1),
				ShareDecaySeconds:  pulumi.Int(3600),
				ShareDistributions: batch.SchedulingPolicyFairSharePolicyShareDistributionArray{
					&batch.SchedulingPolicyFairSharePolicyShareDistributionArgs{
						ShareIdentifier: pulumi.String("A1*"),
						WeightFactor:    pulumi.Float64(0.1),
					},
					&batch.SchedulingPolicyFairSharePolicyShareDistributionArgs{
						ShareIdentifier: pulumi.String("A2"),
						WeightFactor:    pulumi.Float64(0.2),
					},
				},
			},
			Tags: pulumi.StringMap{
				"Name": pulumi.String("Example Batch Scheduling Policy"),
			},
		})
		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.aws.batch.SchedulingPolicy;
import com.pulumi.aws.batch.SchedulingPolicyArgs;
import com.pulumi.aws.batch.inputs.SchedulingPolicyFairSharePolicyArgs;
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 example = new SchedulingPolicy("example", SchedulingPolicyArgs.builder()        
            .fairSharePolicy(SchedulingPolicyFairSharePolicyArgs.builder()
                .computeReservation(1)
                .shareDecaySeconds(3600)
                .shareDistributions(                
                    SchedulingPolicyFairSharePolicyShareDistributionArgs.builder()
                        .shareIdentifier("A1*")
                        .weightFactor(0.1)
                        .build(),
                    SchedulingPolicyFairSharePolicyShareDistributionArgs.builder()
                        .shareIdentifier("A2")
                        .weightFactor(0.2)
                        .build())
                .build())
            .tags(Map.of("Name", "Example Batch Scheduling Policy"))
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example = aws.batch.SchedulingPolicy("example",
    fair_share_policy=aws.batch.SchedulingPolicyFairSharePolicyArgs(
        compute_reservation=1,
        share_decay_seconds=3600,
        share_distributions=[
            aws.batch.SchedulingPolicyFairSharePolicyShareDistributionArgs(
                share_identifier="A1*",
                weight_factor=0.1,
            ),
            aws.batch.SchedulingPolicyFairSharePolicyShareDistributionArgs(
                share_identifier="A2",
                weight_factor=0.2,
            ),
        ],
    ),
    tags={
        "Name": "Example Batch Scheduling Policy",
    })
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.batch.SchedulingPolicy("example", {
    fairSharePolicy: {
        computeReservation: 1,
        shareDecaySeconds: 3600,
        shareDistributions: [
            {
                shareIdentifier: "A1*",
                weightFactor: 0.1,
            },
            {
                shareIdentifier: "A2",
                weightFactor: 0.2,
            },
        ],
    },
    tags: {
        Name: "Example Batch Scheduling Policy",
    },
});
resources:
  example:
    type: aws:batch:SchedulingPolicy
    properties:
      fairSharePolicy:
        computeReservation: 1
        shareDecaySeconds: 3600
        shareDistributions:
          - shareIdentifier: A1*
            weightFactor: 0.1
          - shareIdentifier: A2
            weightFactor: 0.2
      tags:
        Name: Example Batch Scheduling Policy

Create SchedulingPolicy Resource

new SchedulingPolicy(name: string, args?: SchedulingPolicyArgs, opts?: CustomResourceOptions);
@overload
def SchedulingPolicy(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     fair_share_policy: Optional[SchedulingPolicyFairSharePolicyArgs] = None,
                     name: Optional[str] = None,
                     tags: Optional[Mapping[str, str]] = None)
@overload
def SchedulingPolicy(resource_name: str,
                     args: Optional[SchedulingPolicyArgs] = None,
                     opts: Optional[ResourceOptions] = None)
func NewSchedulingPolicy(ctx *Context, name string, args *SchedulingPolicyArgs, opts ...ResourceOption) (*SchedulingPolicy, error)
public SchedulingPolicy(string name, SchedulingPolicyArgs? args = null, CustomResourceOptions? opts = null)
public SchedulingPolicy(String name, SchedulingPolicyArgs args)
public SchedulingPolicy(String name, SchedulingPolicyArgs args, CustomResourceOptions options)
type: aws:batch:SchedulingPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args SchedulingPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args SchedulingPolicyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args SchedulingPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args SchedulingPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args SchedulingPolicyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

SchedulingPolicy Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The SchedulingPolicy resource accepts the following input properties:

FairSharePolicy SchedulingPolicyFairSharePolicyArgs
Name string

Specifies the name of the scheduling policy.

Tags Dictionary<string, string>

Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

FairSharePolicy SchedulingPolicyFairSharePolicyArgs
Name string

Specifies the name of the scheduling policy.

Tags map[string]string

Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

fairSharePolicy SchedulingPolicyFairSharePolicyArgs
name String

Specifies the name of the scheduling policy.

tags Map<String,String>

Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

fairSharePolicy SchedulingPolicyFairSharePolicyArgs
name string

Specifies the name of the scheduling policy.

tags {[key: string]: string}

Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

fair_share_policy SchedulingPolicyFairSharePolicyArgs
name str

Specifies the name of the scheduling policy.

tags Mapping[str, str]

Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

fairSharePolicy Property Map
name String

Specifies the name of the scheduling policy.

tags Map<String>

Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Outputs

All input properties are implicitly available as output properties. Additionally, the SchedulingPolicy resource produces the following output properties:

Arn string

The Amazon Resource Name of the scheduling policy.

Id string

The provider-assigned unique ID for this managed resource.

TagsAll Dictionary<string, string>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Arn string

The Amazon Resource Name of the scheduling policy.

Id string

The provider-assigned unique ID for this managed resource.

TagsAll map[string]string

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

The Amazon Resource Name of the scheduling policy.

id String

The provider-assigned unique ID for this managed resource.

tagsAll Map<String,String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn string

The Amazon Resource Name of the scheduling policy.

id string

The provider-assigned unique ID for this managed resource.

tagsAll {[key: string]: string}

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn str

The Amazon Resource Name of the scheduling policy.

id str

The provider-assigned unique ID for this managed resource.

tags_all Mapping[str, str]

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

The Amazon Resource Name of the scheduling policy.

id String

The provider-assigned unique ID for this managed resource.

tagsAll Map<String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Look up Existing SchedulingPolicy Resource

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

public static get(name: string, id: Input<ID>, state?: SchedulingPolicyState, opts?: CustomResourceOptions): SchedulingPolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        fair_share_policy: Optional[SchedulingPolicyFairSharePolicyArgs] = None,
        name: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None) -> SchedulingPolicy
func GetSchedulingPolicy(ctx *Context, name string, id IDInput, state *SchedulingPolicyState, opts ...ResourceOption) (*SchedulingPolicy, error)
public static SchedulingPolicy Get(string name, Input<string> id, SchedulingPolicyState? state, CustomResourceOptions? opts = null)
public static SchedulingPolicy get(String name, Output<String> id, SchedulingPolicyState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Arn string

The Amazon Resource Name of the scheduling policy.

FairSharePolicy SchedulingPolicyFairSharePolicyArgs
Name string

Specifies the name of the scheduling policy.

Tags Dictionary<string, string>

Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

TagsAll Dictionary<string, string>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Arn string

The Amazon Resource Name of the scheduling policy.

FairSharePolicy SchedulingPolicyFairSharePolicyArgs
Name string

Specifies the name of the scheduling policy.

Tags map[string]string

Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

TagsAll map[string]string

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

The Amazon Resource Name of the scheduling policy.

fairSharePolicy SchedulingPolicyFairSharePolicyArgs
name String

Specifies the name of the scheduling policy.

tags Map<String,String>

Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll Map<String,String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn string

The Amazon Resource Name of the scheduling policy.

fairSharePolicy SchedulingPolicyFairSharePolicyArgs
name string

Specifies the name of the scheduling policy.

tags {[key: string]: string}

Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll {[key: string]: string}

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn str

The Amazon Resource Name of the scheduling policy.

fair_share_policy SchedulingPolicyFairSharePolicyArgs
name str

Specifies the name of the scheduling policy.

tags Mapping[str, str]

Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tags_all Mapping[str, str]

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

arn String

The Amazon Resource Name of the scheduling policy.

fairSharePolicy Property Map
name String

Specifies the name of the scheduling policy.

tags Map<String>

Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

tagsAll Map<String>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Supporting Types

SchedulingPolicyFairSharePolicy

ComputeReservation int

A value used to reserve some of the available maximum vCPU for fair share identifiers that have not yet been used. For more information, see FairsharePolicy.

ShareDecaySeconds int
ShareDistributions List<SchedulingPolicyFairSharePolicyShareDistribution>

One or more share distribution blocks which define the weights for the fair share identifiers for the fair share policy. For more information, see FairsharePolicy. The share_distribution block is documented below.

ComputeReservation int

A value used to reserve some of the available maximum vCPU for fair share identifiers that have not yet been used. For more information, see FairsharePolicy.

ShareDecaySeconds int
ShareDistributions []SchedulingPolicyFairSharePolicyShareDistribution

One or more share distribution blocks which define the weights for the fair share identifiers for the fair share policy. For more information, see FairsharePolicy. The share_distribution block is documented below.

computeReservation Integer

A value used to reserve some of the available maximum vCPU for fair share identifiers that have not yet been used. For more information, see FairsharePolicy.

shareDecaySeconds Integer
shareDistributions List<SchedulingPolicyFairSharePolicyShareDistribution>

One or more share distribution blocks which define the weights for the fair share identifiers for the fair share policy. For more information, see FairsharePolicy. The share_distribution block is documented below.

computeReservation number

A value used to reserve some of the available maximum vCPU for fair share identifiers that have not yet been used. For more information, see FairsharePolicy.

shareDecaySeconds number
shareDistributions SchedulingPolicyFairSharePolicyShareDistribution[]

One or more share distribution blocks which define the weights for the fair share identifiers for the fair share policy. For more information, see FairsharePolicy. The share_distribution block is documented below.

compute_reservation int

A value used to reserve some of the available maximum vCPU for fair share identifiers that have not yet been used. For more information, see FairsharePolicy.

share_decay_seconds int
share_distributions Sequence[SchedulingPolicyFairSharePolicyShareDistribution]

One or more share distribution blocks which define the weights for the fair share identifiers for the fair share policy. For more information, see FairsharePolicy. The share_distribution block is documented below.

computeReservation Number

A value used to reserve some of the available maximum vCPU for fair share identifiers that have not yet been used. For more information, see FairsharePolicy.

shareDecaySeconds Number
shareDistributions List<Property Map>

One or more share distribution blocks which define the weights for the fair share identifiers for the fair share policy. For more information, see FairsharePolicy. The share_distribution block is documented below.

SchedulingPolicyFairSharePolicyShareDistribution

ShareIdentifier string

A fair share identifier or fair share identifier prefix. For more information, see ShareAttributes.

WeightFactor double

The weight factor for the fair share identifier. For more information, see ShareAttributes.

ShareIdentifier string

A fair share identifier or fair share identifier prefix. For more information, see ShareAttributes.

WeightFactor float64

The weight factor for the fair share identifier. For more information, see ShareAttributes.

shareIdentifier String

A fair share identifier or fair share identifier prefix. For more information, see ShareAttributes.

weightFactor Double

The weight factor for the fair share identifier. For more information, see ShareAttributes.

shareIdentifier string

A fair share identifier or fair share identifier prefix. For more information, see ShareAttributes.

weightFactor number

The weight factor for the fair share identifier. For more information, see ShareAttributes.

share_identifier str

A fair share identifier or fair share identifier prefix. For more information, see ShareAttributes.

weight_factor float

The weight factor for the fair share identifier. For more information, see ShareAttributes.

shareIdentifier String

A fair share identifier or fair share identifier prefix. For more information, see ShareAttributes.

weightFactor Number

The weight factor for the fair share identifier. For more information, see ShareAttributes.

Import

Batch Scheduling Policy can be imported using the arn, e.g.,

 $ pulumi import aws:batch/schedulingPolicy:SchedulingPolicy test_policy arn:aws:batch:us-east-1:123456789012:scheduling-policy/sample

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.