SchedulingPolicy class

Provides a Batch Scheduling Policy resource.

Example Usage

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

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

example = aws.batch.SchedulingPolicy("example",
    fair_share_policy={
        "share_distributions": [
            {
                "share_identifier": "A1*",
                "weight_factor": 0.1,
            },
            {
                "share_identifier": "A2",
                "weight_factor": 0.2,
            },
        ],
        "compute_reservation": 1,
        "share_decay_seconds": 3600,
    },
    name="example",
    tags={
        "Name": "Example Batch Scheduling Policy",
    })
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

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

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/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{
				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),
					},
				},
				ComputeReservation: pulumi.Int(1),
				ShareDecaySeconds:  pulumi.Int(3600),
			},
			Name: pulumi.String("example"),
			Tags: pulumi.StringMap{
				"Name": pulumi.String("Example Batch Scheduling Policy"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

resource "aws_batch_schedulingpolicy" "example" {
  fair_share_policy = {
    share_distributions = [{
      "shareIdentifier" = "A1*"
      "weightFactor"    = 0.1
      }, {
      "shareIdentifier" = "A2"
      "weightFactor"    = 0.2
    }]
    compute_reservation = 1
    share_decay_seconds = 3600
  }
  name = "example"
  tags = {
    "Name" = "Example Batch Scheduling Policy"
  }
}
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 com.pulumi.aws.batch.inputs.SchedulingPolicyFairSharePolicyShareDistributionArgs;
import java.util.ArrayList;
import java.util.Arrays;
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()
                .shareDistributions(
                    SchedulingPolicyFairSharePolicyShareDistributionArgs.builder()
                        .shareIdentifier("A1*")
                        .weightFactor(0.1)
                        .build(),
                    SchedulingPolicyFairSharePolicyShareDistributionArgs.builder()
                        .shareIdentifier("A2")
                        .weightFactor(0.2)
                        .build())
                .computeReservation(1)
                .shareDecaySeconds(3600)
                .build())
            .name("example")
            .tags(Map.of("Name", "Example Batch Scheduling Policy"))
            .build());

    }
}
resources:
  example:
    type: aws:batch:SchedulingPolicy
    properties:
      fairSharePolicy:
        shareDistributions:
          - shareIdentifier: A1*
            weightFactor: 0.1
          - shareIdentifier: A2
            weightFactor: 0.2
        computeReservation: 1
        shareDecaySeconds: 3600
      name: example
      tags:
        Name: Example Batch Scheduling Policy

Import

Using pulumi import, import Batch Scheduling Policy using the arn. For example:

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

Constructors

SchedulingPolicy(String name, {SchedulingPolicyArgs? args, CustomResourceOptions? options})
Creates a new SchedulingPolicy. name The Pulumi resource name. args Arguments used to configure this SchedulingPolicy. The set of arguments for SchedulingPolicy. options Resource options controlling this resource's behavior.
SchedulingPolicy.reference(String urn)
Creates a typed reference to an existing SchedulingPolicy resource.

Properties

arn ↔ Output<String>
ARN of the scheduling policy.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
fairSharePolicy ↔ Output<SchedulingPolicyFairSharePolicy?>
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
name ↔ Output<String>
Specifies the name of the scheduling policy.
latefinal
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tags ↔ Output<Map<String, String>?>
Key-value map of resource tags. If configured with a provider defaultTags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
latefinal
tagsAll ↔ Output<Map<String, String>>
A map of tags assigned to the resource, including those inherited from the provider defaultTags configuration block.
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {SchedulingPolicyState? state, CustomResourceOptions? options}) → SchedulingPolicy
Gets an existing SchedulingPolicy resource's state with the given name and id.