service_environments
Creates, updates, deletes, gets or lists a service_environments resource.
Overview
| Name | service_environments |
| Type | Resource |
| Id | aws.batch.service_environments |
Fields
The following fields are returned by SELECT queries:
- describe_service_environments
| Name | Datatype | Description |
|---|---|---|
capacity_limits | array | The capacity limits for the service environment. This defines the maximum resources that can be used by service jobs in this environment. |
service_environment_arn | string | The Amazon Resource Name (ARN) of the service environment. |
service_environment_name | string | The name of the service environment. |
service_environment_type | string | The type of service environment. For SageMaker Training jobs, this value is SAGEMAKER_TRAINING. (SAGEMAKER_TRAINING) |
state | string | The state of the service environment. Valid values are ENABLED and DISABLED. (ENABLED, DISABLED) |
status | string | The current status of the service environment. (CREATING, UPDATING, DELETING, DELETED, VALID, INVALID) |
tags | object | The tags associated with the service environment. Each tag consists of a key and an optional value. For more information, see Tagging your Batch resources. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_service_environments | select | region | Describes one or more of your service environments. | |
create_service_environment | insert | region, serviceEnvironmentName, serviceEnvironmentType, capacityLimits | Creates a service environment for running service jobs. Service environments define capacity limits for specific service types such as SageMaker Training jobs. | |
update_service_environment | update | region, serviceEnvironment | Updates a service environment. You can update the state of a service environment from ENABLED to DISABLED to prevent new service jobs from being placed in the service environment. | |
delete_service_environment | delete | region | Deletes a Service environment. Before you can delete a service environment, you must first set its state to DISABLED with the UpdateServiceEnvironment API operation and disassociate it from any job queues with the UpdateJobQueue API operation. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_service_environments
Describes one or more of your service environments.
SELECT
capacity_limits,
service_environment_arn,
service_environment_name,
service_environment_type,
state,
status,
tags
FROM aws.batch.service_environments
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_service_environment
- Manifest
Creates a service environment for running service jobs. Service environments define capacity limits for specific service types such as SageMaker Training jobs.
INSERT INTO aws.batch.service_environments (
serviceEnvironmentName,
serviceEnvironmentType,
state,
capacityLimits,
tags,
region
)
SELECT
'{{ serviceEnvironmentName }}' /* required */,
'{{ serviceEnvironmentType }}' /* required */,
'{{ state }}',
'{{ capacityLimits }}' /* required */,
'{{ tags }}',
'{{ region }}'
RETURNING
service_environment_arn,
service_environment_name
;
# Description fields are for documentation purposes
- name: service_environments
props:
- name: region
value: "{{ region }}"
description: Required parameter for the service_environments resource.
- name: serviceEnvironmentName
value: "{{ serviceEnvironmentName }}"
- name: serviceEnvironmentType
value: "{{ serviceEnvironmentType }}"
valid_values: ['SAGEMAKER_TRAINING']
- name: state
value: "{{ state }}"
valid_values: ['ENABLED', 'DISABLED']
- name: capacityLimits
value:
- maxCapacity: {{ maxCapacity }}
capacityUnit: "{{ capacityUnit }}"
- name: tags
value: "{{ tags }}"
UPDATE examples
- update_service_environment
Updates a service environment. You can update the state of a service environment from ENABLED to DISABLED to prevent new service jobs from being placed in the service environment.
UPDATE aws.batch.service_environments
SET
serviceEnvironment = '{{ serviceEnvironment }}',
state = '{{ state }}',
capacityLimits = '{{ capacityLimits }}'
WHERE
region = '{{ region }}' --required
AND serviceEnvironment = '{{ serviceEnvironment }}' --required
RETURNING
service_environment_arn,
service_environment_name;
DELETE examples
- delete_service_environment
Deletes a Service environment. Before you can delete a service environment, you must first set its state to DISABLED with the UpdateServiceEnvironment API operation and disassociate it from any job queues with the UpdateJobQueue API operation.
DELETE FROM aws.batch.service_environments
WHERE region = '{{ region }}' --required
;