Skip to main content

service_environments

Creates, updates, deletes, gets or lists a service_environments resource.

Overview

Nameservice_environments
TypeResource
Idaws.batch.service_environments

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
capacity_limitsarrayThe capacity limits for the service environment. This defines the maximum resources that can be used by service jobs in this environment.
service_environment_arnstringThe Amazon Resource Name (ARN) of the service environment.
service_environment_namestringThe name of the service environment.
service_environment_typestringThe type of service environment. For SageMaker Training jobs, this value is SAGEMAKER_TRAINING. (SAGEMAKER_TRAINING)
statestringThe state of the service environment. Valid values are ENABLED and DISABLED. (ENABLED, DISABLED)
statusstringThe current status of the service environment. (CREATING, UPDATING, DELETING, DELETED, VALID, INVALID)
tagsobjectThe 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:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_service_environmentsselectregionDescribes one or more of your service environments.
create_service_environmentinsertregion, serviceEnvironmentName, serviceEnvironmentType, capacityLimitsCreates a service environment for running service jobs. Service environments define capacity limits for specific service types such as SageMaker Training jobs.
update_service_environmentupdateregion, serviceEnvironmentUpdates 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_environmentdeleteregionDeletes 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.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

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

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
;

UPDATE examples

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

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
;