Skip to content

EMR

CloudMock emulates Amazon EMR, supporting cluster lifecycle, job flow steps, instance groups, and tagging.

OperationStatusNotes
RunJobFlowSupportedCreates an EMR cluster
DescribeClusterSupportedReturns cluster details
ListClustersSupportedLists clusters
TerminateJobFlowsSupportedTerminates clusters
AddJobFlowStepsSupportedAdds steps to a cluster
ListStepsSupportedLists steps for a cluster
DescribeStepSupportedReturns step details
AddInstanceGroupsSupportedAdds instance groups
ListInstanceGroupsSupportedLists instance groups
ModifyInstanceGroupsSupportedModifies instance group capacity
SetTerminationProtectionSupportedEnables or disables termination protection
SetVisibleToAllUsersSupportedSets cluster visibility
AddTagsSupportedAdds tags to a cluster
RemoveTagsSupportedRemoves tags from a cluster
import { EMRClient, RunJobFlowCommand } from '@aws-sdk/client-emr';
const client = new EMRClient({
endpoint: 'http://localhost:4566',
region: 'us-east-1',
credentials: { accessKeyId: 'test', secretAccessKey: 'test' },
});
const { JobFlowId } = await client.send(new RunJobFlowCommand({
Name: 'my-cluster',
ReleaseLabel: 'emr-6.10.0',
Instances: {
MasterInstanceType: 'm5.xlarge',
SlaveInstanceType: 'm5.xlarge',
InstanceCount: 3,
},
ServiceRole: 'EMR_DefaultRole',
JobFlowRole: 'EMR_EC2_DefaultRole',
}));
console.log(JobFlowId);
import boto3
client = boto3.client('emr',
endpoint_url='http://localhost:4566',
region_name='us-east-1',
aws_access_key_id='test',
aws_secret_access_key='test')
response = client.run_job_flow(
Name='my-cluster',
ReleaseLabel='emr-6.10.0',
Instances={
'MasterInstanceType': 'm5.xlarge',
'SlaveInstanceType': 'm5.xlarge',
'InstanceCount': 3,
},
ServiceRole='EMR_DefaultRole',
JobFlowRole='EMR_EC2_DefaultRole')
print(response['JobFlowId'])
cloudmock.yml
services:
elasticmapreduce:
enabled: true
  • No actual Hadoop/Spark clusters are provisioned
  • Steps are stored but not executed
  • Instance groups do not launch real EC2 instances