scheduling_policies
Creates, updates, deletes or gets a scheduling_policy resource or lists scheduling_policies in a region
Overview
| Name | scheduling_policies |
| Type | Resource |
| Description | Resource Type definition for AWS::Batch::SchedulingPolicy |
| Id | awscc.batch.scheduling_policies |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
name | string | Name of Scheduling Policy. |
arn | string | ARN of the Scheduling Policy. |
fairshare_policy | object | Fair Share Policy for the Job Queue. |
tags | object | A key-value pair to associate with a resource. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
arn | string | ARN of the Scheduling Policy. |
region | string | AWS region. |
For more information, see AWS::Batch::SchedulingPolicy.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | scheduling_policies | INSERT | region |
delete_resource | scheduling_policies | DELETE | Identifier, region |
update_resource | scheduling_policies | UPDATE | Identifier, PatchDocument, region |
list_resources | scheduling_policies_list_only | SELECT | region |
get_resource | scheduling_policies | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual scheduling_policy.
SELECT
region,
name,
arn,
fairshare_policy,
tags
FROM awscc.batch.scheduling_policies
WHERE
region = 'us-east-1' AND
Identifier = '{{ arn }}';
Lists all scheduling_policies in a region.
SELECT
region,
arn
FROM awscc.batch.scheduling_policies_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new scheduling_policy resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.batch.scheduling_policies (
Name,
FairsharePolicy,
Tags,
region
)
SELECT
'{{ name }}',
'{{ fairshare_policy }}',
'{{ tags }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.batch.scheduling_policies (
Name,
FairsharePolicy,
Tags,
region
)
SELECT
'{{ name }}',
'{{ fairshare_policy }}',
'{{ tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: scheduling_policy
props:
- name: name
value: '{{ name }}'
- name: fairshare_policy
value:
share_decay_seconds: null
compute_reservation: null
share_distribution:
- share_identifier: '{{ share_identifier }}'
weight_factor: null
- name: tags
value: {}
UPDATE example
Use the following StackQL query and manifest file to update a scheduling_policy resource, using stack-deploy.
/*+ update */
UPDATE awscc.batch.scheduling_policies
SET PatchDocument = string('{{ {
"FairsharePolicy": fairshare_policy
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';
DELETE example
/*+ delete */
DELETE FROM awscc.batch.scheduling_policies
WHERE
Identifier = '{{ arn }}' AND
region = 'us-east-1';
Permissions
To operate on the scheduling_policies resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
Batch:CreateSchedulingPolicy,
Batch:TagResource
Batch:DescribeSchedulingPolicies
Batch:UpdateSchedulingPolicy,
Batch:TagResource,
Batch:UnTagResource
Batch:DescribeSchedulingPolicies,
Batch:DeleteSchedulingPolicy
Batch:ListSchedulingPolicies,
Batch:DescribeSchedulingPolicies