Skip to main content

compute_environments

Creates, updates, deletes or gets a compute_environment resource or lists compute_environments in a region

Overview

Namecompute_environments
TypeResource
DescriptionResource Type definition for AWS::Batch::ComputeEnvironment
Idawscc.batch.compute_environments

Fields

NameDatatypeDescription
compute_environment_arnstring
compute_environment_namestring
compute_resourcesobject
replace_compute_environmentboolean
service_rolestring
statestring
tagsobjectA key-value pair to associate with a resource.
typestring
update_policyobject
unmanagedv_cpusinteger
eks_configurationobject
contextstring
regionstringAWS region.

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

Methods

NameResourceAccessible byRequired Params
create_resourcecompute_environmentsINSERTType, region
delete_resourcecompute_environmentsDELETEIdentifier, region
update_resourcecompute_environmentsUPDATEIdentifier, PatchDocument, region
list_resourcescompute_environments_list_onlySELECTregion
get_resourcecompute_environmentsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual compute_environment.

SELECT
region,
compute_environment_arn,
compute_environment_name,
compute_resources,
replace_compute_environment,
service_role,
state,
tags,
type,
update_policy,
unmanagedv_cpus,
eks_configuration,
context
FROM awscc.batch.compute_environments
WHERE
region = 'us-east-1' AND
Identifier = '{{ compute_environment_arn }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.batch.compute_environments (
Type,
region
)
SELECT
'{{ type }}',
'{{ region }}';

UPDATE example

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

/*+ update */
UPDATE awscc.batch.compute_environments
SET PatchDocument = string('{{ {
"ReplaceComputeEnvironment": replace_compute_environment,
"ServiceRole": service_role,
"State": state,
"UpdatePolicy": update_policy,
"UnmanagedvCpus": unmanagedv_cpus,
"Context": context
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ compute_environment_arn }}';

DELETE example

/*+ delete */
DELETE FROM awscc.batch.compute_environments
WHERE
Identifier = '{{ compute_environment_arn }}' AND
region = 'us-east-1';

Permissions

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

Batch:CreateComputeEnvironment,
Batch:TagResource,
Batch:DescribeComputeEnvironments,
iam:CreateServiceLinkedRole,
Iam:PassRole,
Eks:DescribeCluster,
ec2:DescribeLaunchTemplateVersions