Skip to main content

service_environments

Creates, updates, deletes or gets a service_environment resource or lists service_environments in a region

Overview

Nameservice_environments
TypeResource
DescriptionResource Type definition for AWS::Batch::ServiceEnvironment
Idawscc.batch.service_environments

Fields

NameDatatypeDescription
service_environment_arnstring
service_environment_namestring
statestring
service_environment_typestring
capacity_limitsarray
tagsobjectA key-value pair to associate with a resource.
regionstringAWS region.

For more information, see AWS::Batch::ServiceEnvironment.

Methods

NameResourceAccessible byRequired Params
create_resourceservice_environmentsINSERTServiceEnvironmentType, CapacityLimits, region
delete_resourceservice_environmentsDELETEIdentifier, region
update_resourceservice_environmentsUPDATEIdentifier, PatchDocument, region
list_resourcesservice_environments_list_onlySELECTregion
get_resourceservice_environmentsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual service_environment.

SELECT
region,
service_environment_arn,
service_environment_name,
state,
service_environment_type,
capacity_limits,
tags
FROM awscc.batch.service_environments
WHERE
region = '{{ region }}' AND
Identifier = '{{ service_environment_arn }}';

INSERT example

Use the following StackQL query and manifest file to create a new service_environment resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.batch.service_environments (
ServiceEnvironmentType,
CapacityLimits,
region
)
SELECT
'{{ service_environment_type }}',
'{{ capacity_limits }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a service_environment resource, using stack-deploy.

/*+ update */
UPDATE awscc.batch.service_environments
SET PatchDocument = string('{{ {
"State": state,
"CapacityLimits": capacity_limits,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ service_environment_arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.batch.service_environments
WHERE
Identifier = '{{ service_environment_arn }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

To operate on the service_environments resource, the following permissions are required:

Batch:CreateServiceEnvironment,
Batch:TagResource,
Batch:DescribeServiceEnvironments,
Iam:CreateServiceLinkedRole