

This is the new *CloudFormation Template Reference Guide*. Please update your bookmarks and links. For help getting started with CloudFormation, see the [AWS CloudFormation User Guide](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/Welcome.html).

# AWS::Batch::SchedulingPolicy
<a name="aws-resource-batch-schedulingpolicy"></a>

The `AWS::Batch::SchedulingPolicy` resource specifies the parameters for an AWS Batch scheduling policy. For more information, see [Scheduling Policies](https://docs.aws.amazon.com/batch/latest/userguide/scheduling_policies.html) in the * AWS Batch User Guide *.

## Syntax
<a name="aws-resource-batch-schedulingpolicy-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-resource-batch-schedulingpolicy-syntax.json"></a>

```
{
  "Type" : "AWS::Batch::SchedulingPolicy",
  "Properties" : {
      "[FairsharePolicy](#cfn-batch-schedulingpolicy-fairsharepolicy)" : FairsharePolicy,
      "[Name](#cfn-batch-schedulingpolicy-name)" : String,
      "[QuotaSharePolicy](#cfn-batch-schedulingpolicy-quotasharepolicy)" : QuotaSharePolicy,
      "[Tags](#cfn-batch-schedulingpolicy-tags)" : {Key: Value, ...}
    }
}
```

### YAML
<a name="aws-resource-batch-schedulingpolicy-syntax.yaml"></a>

```
Type: AWS::Batch::SchedulingPolicy
Properties:
  [FairsharePolicy](#cfn-batch-schedulingpolicy-fairsharepolicy): 
    FairsharePolicy
  [Name](#cfn-batch-schedulingpolicy-name): String
  [QuotaSharePolicy](#cfn-batch-schedulingpolicy-quotasharepolicy): 
    QuotaSharePolicy
  [Tags](#cfn-batch-schedulingpolicy-tags): 
    Key: Value
```

## Properties
<a name="aws-resource-batch-schedulingpolicy-properties"></a>

`FairsharePolicy`  <a name="cfn-batch-schedulingpolicy-fairsharepolicy"></a>
The fair-share scheduling policy details. Only one of fairsharePolicy or quotaSharePolicy can be set. Once set, this policy type cannot be removed or changed to a quotaSharePolicy.  
*Required*: No  
*Type*: [FairsharePolicy](aws-properties-batch-schedulingpolicy-fairsharepolicy.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Name`  <a name="cfn-batch-schedulingpolicy-name"></a>
The name of the fair-share scheduling policy. It can be up to 128 letters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (\$1).  
*Required*: No  
*Type*: String  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

`QuotaSharePolicy`  <a name="cfn-batch-schedulingpolicy-quotasharepolicy"></a>
The quota share scheduling policy details.  
*Required*: No  
*Type*: [QuotaSharePolicy](aws-properties-batch-schedulingpolicy-quotasharepolicy.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`Tags`  <a name="cfn-batch-schedulingpolicy-tags"></a>
The tags that you apply to the scheduling policy to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see [Tagging AWS Resources](https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in *AWS General Reference*.  
These tags can be updated or removed using the [TagResource](https://docs.aws.amazon.com/batch/latest/APIReference/API_TagResource.html) and [UntagResource](https://docs.aws.amazon.com/batch/latest/APIReference/API_UntagResource.html) API operations.  
*Required*: No  
*Type*: Object of String  
*Pattern*: `.*`  
*Update requires*: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

## Return values
<a name="aws-resource-batch-schedulingpolicy-return-values"></a>

### Ref
<a name="aws-resource-batch-schedulingpolicy-return-values-ref"></a>

When you pass the logical ID of this resource to the intrinsic `Ref` function, `Ref` returns the scheduling policy ARN, such as `arn:aws:batch:us-east-1:111122223333:scheduling-policy/HighPriority`.

For more information about using the `Ref` function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-ref.html).

### Fn::GetAtt
<a name="aws-resource-batch-schedulingpolicy-return-values-fn--getatt"></a>

The `Fn::GetAtt` intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the `Fn::GetAtt` intrinsic function, see [https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html](https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-getatt.html).

#### 
<a name="aws-resource-batch-schedulingpolicy-return-values-fn--getatt-fn--getatt"></a>

`Arn`  <a name="Arn-fn::getatt"></a>
Returns the scheduling policy ARN, such as `arn:aws:batch:us-east-1:111122223333:scheduling-policy/HighPriority`.

## See also
<a name="aws-resource-batch-schedulingpolicy--seealso"></a>
+ [Scheduling Policy Parameters](https://docs.aws.amazon.com/batch/latest/userguide/scheduling_policy_parameters.html) in the * AWS Batch User Guide *.

# AWS::Batch::SchedulingPolicy FairsharePolicy
<a name="aws-properties-batch-schedulingpolicy-fairsharepolicy"></a>

The fair-share scheduling policy details.

## Syntax
<a name="aws-properties-batch-schedulingpolicy-fairsharepolicy-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-batch-schedulingpolicy-fairsharepolicy-syntax.json"></a>

```
{
  "[ComputeReservation](#cfn-batch-schedulingpolicy-fairsharepolicy-computereservation)" : Number,
  "[ShareDecaySeconds](#cfn-batch-schedulingpolicy-fairsharepolicy-sharedecayseconds)" : Number,
  "[ShareDistribution](#cfn-batch-schedulingpolicy-fairsharepolicy-sharedistribution)" : [ ShareAttributes, ... ]
}
```

### YAML
<a name="aws-properties-batch-schedulingpolicy-fairsharepolicy-syntax.yaml"></a>

```
  [ComputeReservation](#cfn-batch-schedulingpolicy-fairsharepolicy-computereservation): Number
  [ShareDecaySeconds](#cfn-batch-schedulingpolicy-fairsharepolicy-sharedecayseconds): Number
  [ShareDistribution](#cfn-batch-schedulingpolicy-fairsharepolicy-sharedistribution): 
    - ShareAttributes
```

## Properties
<a name="aws-properties-batch-schedulingpolicy-fairsharepolicy-properties"></a>

`ComputeReservation`  <a name="cfn-batch-schedulingpolicy-fairsharepolicy-computereservation"></a>
A value used to reserve some of the available maximum vCPU for share identifiers that aren't already used.  
The reserved ratio is `(computeReservation/100)^ActiveFairShares` where ` ActiveFairShares ` is the number of active share identifiers.  
For example, a `computeReservation` value of 50 indicates that AWS Batch reserves 50% of the maximum available vCPU if there's only one share identifier. It reserves 25% if there are two share identifiers. It reserves 12.5% if there are three share identifiers. A `computeReservation` value of 25 indicates that AWS Batch should reserve 25% of the maximum available vCPU if there's only one share identifier, 6.25% if there are two fair share identifiers, and 1.56% if there are three share identifiers.  
The minimum value is 0 and the maximum value is 99.  
*Required*: No  
*Type*: Number  
*Minimum*: `0`  
*Maximum*: `99`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ShareDecaySeconds`  <a name="cfn-batch-schedulingpolicy-fairsharepolicy-sharedecayseconds"></a>
The amount of time (in seconds) to use to calculate a fair-share percentage for each share identifier in use. A value of zero (0) indicates the default minimum time window (600 seconds). The maximum supported value is 604800 (1 week).  
The decay allows for more recently run jobs to have more weight than jobs that ran earlier. Consider adjusting this number if you have jobs that (on average) run longer than ten minutes, or a large difference in job count or job run times between share identifiers, and the allocation of resources doesn't meet your needs.  
*Required*: No  
*Type*: Number  
*Minimum*: `0`  
*Maximum*: `604800`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`ShareDistribution`  <a name="cfn-batch-schedulingpolicy-fairsharepolicy-sharedistribution"></a>
An array of `SharedIdentifier` objects that contain the weights for the share identifiers for the fair-share policy. Share identifiers that aren't included have a default weight of `1.0`.  
*Required*: No  
*Type*: Array of [ShareAttributes](aws-properties-batch-schedulingpolicy-shareattributes.md)  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## See also
<a name="aws-properties-batch-schedulingpolicy-fairsharepolicy--seealso"></a>
+ [FairsharePolicy](https://docs.aws.amazon.com/batch/latest/APIReference/API_FairsharePolicy.html) in the * AWS Batch API Reference *.

# AWS::Batch::SchedulingPolicy QuotaSharePolicy
<a name="aws-properties-batch-schedulingpolicy-quotasharepolicy"></a>

The quota share scheduling policy details for a job queue.

## Syntax
<a name="aws-properties-batch-schedulingpolicy-quotasharepolicy-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-batch-schedulingpolicy-quotasharepolicy-syntax.json"></a>

```
{
  "[IdleResourceAssignmentStrategy](#cfn-batch-schedulingpolicy-quotasharepolicy-idleresourceassignmentstrategy)" : String
}
```

### YAML
<a name="aws-properties-batch-schedulingpolicy-quotasharepolicy-syntax.yaml"></a>

```
  [IdleResourceAssignmentStrategy](#cfn-batch-schedulingpolicy-quotasharepolicy-idleresourceassignmentstrategy): String
```

## Properties
<a name="aws-properties-batch-schedulingpolicy-quotasharepolicy-properties"></a>

`IdleResourceAssignmentStrategy`  <a name="cfn-batch-schedulingpolicy-quotasharepolicy-idleresourceassignmentstrategy"></a>
The strategy that determines how idle resources are assigned to quota shares that are borrowing capacity. Currently, only `FIFO` is supported.  
*Required*: No  
*Type*: String  
*Allowed values*: `FIFO`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

# AWS::Batch::SchedulingPolicy ShareAttributes
<a name="aws-properties-batch-schedulingpolicy-shareattributes"></a>

Specifies the weights for the share identifiers for the fair-share policy. Share identifiers that aren't included have a default weight of `1.0`.

## Syntax
<a name="aws-properties-batch-schedulingpolicy-shareattributes-syntax"></a>

To declare this entity in your CloudFormation template, use the following syntax:

### JSON
<a name="aws-properties-batch-schedulingpolicy-shareattributes-syntax.json"></a>

```
{
  "[ShareIdentifier](#cfn-batch-schedulingpolicy-shareattributes-shareidentifier)" : String,
  "[WeightFactor](#cfn-batch-schedulingpolicy-shareattributes-weightfactor)" : Number
}
```

### YAML
<a name="aws-properties-batch-schedulingpolicy-shareattributes-syntax.yaml"></a>

```
  [ShareIdentifier](#cfn-batch-schedulingpolicy-shareattributes-shareidentifier): String
  [WeightFactor](#cfn-batch-schedulingpolicy-shareattributes-weightfactor): Number
```

## Properties
<a name="aws-properties-batch-schedulingpolicy-shareattributes-properties"></a>

`ShareIdentifier`  <a name="cfn-batch-schedulingpolicy-shareattributes-shareidentifier"></a>
A share identifier or share identifier prefix. If the string ends with an asterisk (\$1), this entry specifies the weight factor to use for share identifiers that start with that prefix. The list of share identifiers in a fair-share policy can't overlap. For example, you can't have one that specifies a `shareIdentifier` of `UserA*` and another that specifies a `shareIdentifier` of `UserA1`.  
There can be no more than 500 share identifiers active in a job queue.  
The string is limited to 255 alphanumeric characters, and can be followed by an asterisk (\$1).  
*Required*: No  
*Type*: String  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

`WeightFactor`  <a name="cfn-batch-schedulingpolicy-shareattributes-weightfactor"></a>
The weight factor for the share identifier. The default value is 1.0. A lower value has a higher priority for compute resources. For example, jobs that use a share identifier with a weight factor of 0.125 (1/8) get 8 times the compute resources of jobs that use a share identifier with a weight factor of 1.  
The smallest supported value is 0.0001, and the largest supported value is 999.9999.  
*Required*: No  
*Type*: Number  
*Minimum*: `0`  
*Maximum*: `1000`  
*Update requires*: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

## See also
<a name="aws-properties-batch-schedulingpolicy-shareattributes--seealso"></a>
+ [ShareAttributes](https://docs.aws.amazon.com/batch/latest/APIReference/API_ShareAttributes.html) in the * AWS Batch API Reference *.