aws.batch.SchedulingPolicy
Explore with Pulumi AI
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:
- Scheduling
Policy Fair Share Policy - Name string
- Specifies the name of the scheduling policy.
- 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.
- Scheduling
Policy Fair Share Policy Args - Name string
- Specifies the name of the scheduling policy.
- 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.
- Scheduling
Policy Fair Share Policy - name String
- Specifies the name of the scheduling policy.
- 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.
- Scheduling
Policy Fair Share Policy - name string
- Specifies the name of the scheduling policy.
- {[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.
- Scheduling
Policy Fair Share Policy Args - name str
- Specifies the name of the scheduling policy.
- 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.
- Property Map
- name String
- Specifies the name of the scheduling policy.
- 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:
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.
- Arn string
- The Amazon Resource Name of the scheduling policy.
- Scheduling
Policy Fair Share Policy - Name string
- Specifies the name of the scheduling policy.
- 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. - 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.
- Scheduling
Policy Fair Share Policy Args - Name string
- Specifies the name of the scheduling policy.
- 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. - 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.
- Scheduling
Policy Fair Share Policy - name String
- Specifies the name of the scheduling policy.
- 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. - 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.
- Scheduling
Policy Fair Share Policy - name string
- Specifies the name of the scheduling policy.
- {[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. - {[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.
- Scheduling
Policy Fair Share Policy Args - name str
- Specifies the name of the scheduling policy.
- 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. - 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.
- Property Map
- name String
- Specifies the name of the scheduling policy.
- 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. - Map<String>
- A map of tags assigned to the resource, including those inherited from the provider
default_tags
configuration block.
Supporting Types
SchedulingPolicyFairSharePolicy, SchedulingPolicyFairSharePolicyArgs
- 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.
- int
- List<Scheduling
Policy Fair Share Policy Share Distribution> - 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.
- int
- []Scheduling
Policy Fair Share Policy Share Distribution - 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 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.
- Integer
- List<Scheduling
Policy Fair Share Policy Share Distribution> - 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 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.
- number
- Scheduling
Policy Fair Share Policy Share Distribution[] - 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.
- int
- Sequence[Scheduling
Policy Fair Share Policy Share Distribution] - 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 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.
- Number
- 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
- string
- A fair share identifier or fair share identifier prefix. For more information, see ShareAttributes.
- Weight
Factor double - The weight factor for the fair share identifier. For more information, see ShareAttributes.
- string
- A fair share identifier or fair share identifier prefix. For more information, see ShareAttributes.
- Weight
Factor float64 - The weight factor for the fair share identifier. For more information, see ShareAttributes.
- String
- A fair share identifier or fair share identifier prefix. For more information, see ShareAttributes.
- weight
Factor Double - The weight factor for the fair share identifier. For more information, see ShareAttributes.
- string
- A fair share identifier or fair share identifier prefix. For more information, see ShareAttributes.
- weight
Factor number - The weight factor for the fair share identifier. For more information, see ShareAttributes.
- 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.
- String
- A fair share identifier or fair share identifier prefix. For more information, see ShareAttributes.
- weight
Factor 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.