In this step,
The json configuration for the Compute Environment is given below
{
"computeEnvironmentName": "dl1_mnp_ce",
"type": "MANAGED",
"state": "ENABLED",
"computeResources": {
"type": "EC2",
"minvCpus": 0,
"maxvCpus": 384,
"desiredvCpus": 0,
"launchTemplate": {
"launchTemplateId": "LAUNCH_TEMPLATE",
"version": "1"
},
"instanceTypes": [
"dl1.24xlarge"
],
"subnets": [
"SUBNET"
],
"ec2KeyPair": "PEM_KEY_NAME",
"instanceRole": "INSTANCE_ROLE",
"tags": {
"Name": "dl1_mnp_ce"
}
},
"serviceRole": "BATCH_SERVICE_ROLE"
}
Note: When you are entering strings inside JSON file, it has to be quoted for a valid json
PlaceHolder | Replace With |
---|---|
INSTANCE_ROLE | arn:aws:iam::xxxxxxxx:instance-profile/ecsInstanceRole |
LAUNCH_TEMPLATE | lt-xxxxxxxx |
SUBNET | subnet-xxxxxxxx |
PEM_KEY_NAME | key_name w/o .pem extension |
BATCH_SERVICE_ROLE | arn:aws:iam::xxxxxxxxxxx:role/service-role/AWSBatchServiceRole |
After editing the placeholders, execute the command below to create the compute environment
aws batch create-compute-environment --cli-input-json file://dl1_batch_ce.json
The json configuration for the Job Queue ,
{
"jobQueueName": "dl1_mnp_jq",
"state": "ENABLED",
"priority": 1,
"computeEnvironmentOrder": [
{
"order": 1,
"computeEnvironment": "dl1_mnp_ce"
}
]
}
aws batch create-job-queue --cli-input-json file://dl1_batch_jq.json