1. Packages
  2. AWS
  3. API Docs
  4. batch
  5. SchedulingPolicy
AWS v6.54.0 published on Friday, Sep 27, 2024 by Pulumi

aws.batch.SchedulingPolicy

Explore with Pulumi AI

aws logo
AWS v6.54.0 published on Friday, Sep 27, 2024 by Pulumi

    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", {
        name: "example",
        fairSharePolicy: {
            computeReservation: 1,
            shareDecaySeconds: 3600,
            shareDistributions: [
                {
                    shareIdentifier: "A1*",
                    weightFactor: 0.1,
                },
                {
                    shareIdentifier: "A2",
                    weightFactor: 0.2,
                },
            ],
        },
        tags: {
            Name: "Example Batch Scheduling Policy",
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.batch.SchedulingPolicy("example",
        name="example",
        fair_share_policy={
            "compute_reservation": 1,
            "share_decay_seconds": 3600,
            "share_distributions": [
                {
                    "share_identifier": "A1*",
                    "weight_factor": 0.1,
                },
                {
                    "share_identifier": "A2",
                    "weight_factor": 0.2,
                },
            ],
        },
        tags={
            "Name": "Example Batch Scheduling Policy",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/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{
    			Name: pulumi.String("example"),
    			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
    	})
    }
    
    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()
        {
            Name = "example",
            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 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()
                .name("example")
                .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());
    
        }
    }
    
    resources:
      example:
        type: aws:batch:SchedulingPolicy
        properties:
          name: example
          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

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new SchedulingPolicy(name: string, args?: SchedulingPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def SchedulingPolicy(resource_name: str,
                         args: Optional[SchedulingPolicyArgs] = None,
                         opts: Optional[ResourceOptions] = None)
    
    @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)
    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.
    
    

    Parameters

    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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var schedulingPolicyResource = new Aws.Batch.SchedulingPolicy("schedulingPolicyResource", new()
    {
        FairSharePolicy = new Aws.Batch.Inputs.SchedulingPolicyFairSharePolicyArgs
        {
            ComputeReservation = 0,
            ShareDecaySeconds = 0,
            ShareDistributions = new[]
            {
                new Aws.Batch.Inputs.SchedulingPolicyFairSharePolicyShareDistributionArgs
                {
                    ShareIdentifier = "string",
                    WeightFactor = 0,
                },
            },
        },
        Name = "string",
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := batch.NewSchedulingPolicy(ctx, "schedulingPolicyResource", &batch.SchedulingPolicyArgs{
    	FairSharePolicy: &batch.SchedulingPolicyFairSharePolicyArgs{
    		ComputeReservation: pulumi.Int(0),
    		ShareDecaySeconds:  pulumi.Int(0),
    		ShareDistributions: batch.SchedulingPolicyFairSharePolicyShareDistributionArray{
    			&batch.SchedulingPolicyFairSharePolicyShareDistributionArgs{
    				ShareIdentifier: pulumi.String("string"),
    				WeightFactor:    pulumi.Float64(0),
    			},
    		},
    	},
    	Name: pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var schedulingPolicyResource = new SchedulingPolicy("schedulingPolicyResource", SchedulingPolicyArgs.builder()
        .fairSharePolicy(SchedulingPolicyFairSharePolicyArgs.builder()
            .computeReservation(0)
            .shareDecaySeconds(0)
            .shareDistributions(SchedulingPolicyFairSharePolicyShareDistributionArgs.builder()
                .shareIdentifier("string")
                .weightFactor(0)
                .build())
            .build())
        .name("string")
        .tags(Map.of("string", "string"))
        .build());
    
    scheduling_policy_resource = aws.batch.SchedulingPolicy("schedulingPolicyResource",
        fair_share_policy={
            "computeReservation": 0,
            "shareDecaySeconds": 0,
            "shareDistributions": [{
                "shareIdentifier": "string",
                "weightFactor": 0,
            }],
        },
        name="string",
        tags={
            "string": "string",
        })
    
    const schedulingPolicyResource = new aws.batch.SchedulingPolicy("schedulingPolicyResource", {
        fairSharePolicy: {
            computeReservation: 0,
            shareDecaySeconds: 0,
            shareDistributions: [{
                shareIdentifier: "string",
                weightFactor: 0,
            }],
        },
        name: "string",
        tags: {
            string: "string",
        },
    });
    
    type: aws:batch:SchedulingPolicy
    properties:
        fairSharePolicy:
            computeReservation: 0
            shareDecaySeconds: 0
            shareDistributions:
                - shareIdentifier: string
                  weightFactor: 0
        name: string
        tags:
            string: string
    

    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 SchedulingPolicyFairSharePolicy
    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 SchedulingPolicyFairSharePolicy
    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 SchedulingPolicyFairSharePolicy
    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.

    Deprecated: Please use tags instead.

    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.

    Deprecated: Please use tags instead.

    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.

    Deprecated: Please use tags instead.

    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.

    Deprecated: Please use tags instead.

    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.

    Deprecated: Please use tags instead.

    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.

    Deprecated: Please use tags instead.

    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 SchedulingPolicyFairSharePolicy
    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.

    Deprecated: Please use tags instead.

    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.

    Deprecated: Please use tags instead.

    arn String
    The Amazon Resource Name of the scheduling policy.
    fairSharePolicy SchedulingPolicyFairSharePolicy
    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.

    Deprecated: Please use tags instead.

    arn string
    The Amazon Resource Name of the scheduling policy.
    fairSharePolicy SchedulingPolicyFairSharePolicy
    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.

    Deprecated: Please use tags instead.

    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.

    Deprecated: Please use tags instead.

    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.

    Deprecated: Please use tags instead.

    Supporting Types

    SchedulingPolicyFairSharePolicy, SchedulingPolicyFairSharePolicyArgs

    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, SchedulingPolicyFairSharePolicyShareDistributionArgs

    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

    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
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    AWS v6.54.0 published on Friday, Sep 27, 2024 by Pulumi