compute_environments
Creates, updates, deletes or gets a compute_environment
resource or lists compute_environments
in a region
Overview
Name | compute_environments |
Type | Resource |
Description | Resource Type definition for AWS::Batch::ComputeEnvironment |
Id | aws.batch.compute_environments |
Fields
Name | Datatype | Description |
---|---|---|
compute_environment_arn | string | |
compute_environment_name | string | |
compute_resources | object | |
replace_compute_environment | boolean | |
service_role | string | |
state | string | |
tags | object | A key-value pair to associate with a resource. |
type | string | |
update_policy | object | |
unmanagedv_cpus | integer | |
eks_configuration | object | |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | Type, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all compute_environments
in a region.
SELECT
region,
compute_environment_arn,
compute_environment_name,
compute_resources,
replace_compute_environment,
service_role,
state,
tags,
type,
update_policy,
unmanagedv_cpus,
eks_configuration
FROM aws.batch.compute_environments
WHERE region = 'us-east-1';
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
FROM aws.batch.compute_environments
WHERE region = 'us-east-1' AND data__Identifier = '<ComputeEnvironmentArn>';
INSERT
example
Use the following StackQL query and manifest file to create a new compute_environment
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.batch.compute_environments (
Type,
region
)
SELECT
'{{ Type }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.batch.compute_environments (
ComputeEnvironmentName,
ComputeResources,
ReplaceComputeEnvironment,
ServiceRole,
State,
Tags,
Type,
UpdatePolicy,
UnmanagedvCpus,
EksConfiguration,
region
)
SELECT
'{{ ComputeEnvironmentName }}',
'{{ ComputeResources }}',
'{{ ReplaceComputeEnvironment }}',
'{{ ServiceRole }}',
'{{ State }}',
'{{ Tags }}',
'{{ Type }}',
'{{ UpdatePolicy }}',
'{{ UnmanagedvCpus }}',
'{{ EksConfiguration }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: compute_environment
props:
- name: ComputeEnvironmentName
value: '{{ ComputeEnvironmentName }}'
- name: ComputeResources
value:
AllocationStrategy: '{{ AllocationStrategy }}'
BidPercentage: '{{ BidPercentage }}'
DesiredvCpus: '{{ DesiredvCpus }}'
Ec2Configuration:
- ImageIdOverride: '{{ ImageIdOverride }}'
ImageType: '{{ ImageType }}'
ImageKubernetesVersion: '{{ ImageKubernetesVersion }}'
Ec2KeyPair: '{{ Ec2KeyPair }}'
ImageId: '{{ ImageId }}'
InstanceRole: '{{ InstanceRole }}'
InstanceTypes:
- '{{ InstanceTypes[0] }}'
LaunchTemplate:
LaunchTemplateId: '{{ LaunchTemplateId }}'
LaunchTemplateName: '{{ LaunchTemplateName }}'
Version: '{{ Version }}'
MaxvCpus: '{{ MaxvCpus }}'
MinvCpus: '{{ MinvCpus }}'
PlacementGroup: '{{ PlacementGroup }}'
SecurityGroupIds:
- '{{ SecurityGroupIds[0] }}'
SpotIamFleetRole: '{{ SpotIamFleetRole }}'
Subnets:
- '{{ Subnets[0] }}'
Tags: {}
Type: '{{ Type }}'
UpdateToLatestImageVersion: '{{ UpdateToLatestImageVersion }}'
- name: ReplaceComputeEnvironment
value: '{{ ReplaceComputeEnvironment }}'
- name: ServiceRole
value: '{{ ServiceRole }}'
- name: State
value: '{{ State }}'
- name: Tags
value: {}
- name: Type
value: '{{ Type }}'
- name: UpdatePolicy
value:
TerminateJobsOnUpdate: '{{ TerminateJobsOnUpdate }}'
JobExecutionTimeoutMinutes: '{{ JobExecutionTimeoutMinutes }}'
- name: UnmanagedvCpus
value: '{{ UnmanagedvCpus }}'
- name: EksConfiguration
value:
EksClusterArn: '{{ EksClusterArn }}'
KubernetesNamespace: '{{ KubernetesNamespace }}'
DELETE
example
/*+ delete */
DELETE FROM aws.batch.compute_environments
WHERE data__Identifier = '<ComputeEnvironmentArn>'
AND region = 'us-east-1';
Permissions
To operate on the compute_environments
resource, the following permissions are required:
Create
Batch:CreateComputeEnvironment,
Batch:TagResource,
Batch:DescribeComputeEnvironments,
iam:CreateServiceLinkedRole,
Iam:PassRole,
Eks:DescribeCluster
Read
Batch:DescribeComputeEnvironments
Update
Batch:UpdateComputeEnvironment,
Batch:DescribeComputeEnvironments,
Batch:TagResource,
Batch:UnTagResource,
Iam:PassRole,
Eks:DescribeCluster
Delete
Batch:DeleteComputeEnvironment,
Batch:DescribeComputeEnvironments,
Batch:UpdateComputeEnvironment,
Iam:PassRole,
Eks:DescribeCluster
List
Batch:DescribeComputeEnvironments