---
title: "Create Scaler"
method: POST
path: "/aws/emr/mrScaler"
tags: ["Elastigroup AWS EMR Scaler"]
---

# Create Scaler

`POST /aws/emr/mrScaler`

Create a new EMR cluster.

## Parameters

- `#/paths/~1azure~1costs/get/parameters/0` — unresolved $ref

## Request body

- object
  - `mrScaler` object, required
    - `name` string, required — MRScaler name
    - `description` string — description for the MRScaler
    - `region` string, required — The region of the source cluster
    - `strategy` object, required — The strategy for creating the group. At least one of `wrapping`, `cloning`, or `new` is required.
      - `wrapping` object — Required unless either of `strategy.cloning` or `strategy.new` is specified. In wrap mode, MRScaler will manage an existing cluster and will scale up/down cluster task groups only. MRScaler will manage only instance groups that were created by Spot.
        - `sourceClusterId` string
      - `new` object — Required unless `strategy.wrapping` or `strategy.cloning` is specified. In new mode, MRScaler will create a new cluster with the parameters specified in the request.
        - `releaseLabel` string
        - `numberOfRetries` integer
      - `cloning` object — Required unless either of `strategy.wrapping` or `strategy.new` is specified. In clone mode, MRScaler will create a new cluster that will be copied from the origin cluster. MRScaler will manage the entire cluster (the origin cluster will not be affected)
        - `originClusterId` string — The ID of the cluster to clone
        - `includeSteps` boolean — Include cloning of steps from the original cluster
        - `numberOfRetries` integer — number of times to retry if provisioning timeout is exceeded
      - `provisioningTimeout` object — EMR clusters occasionally get stuck in provisioning status due to unhealthy clusters, slowness or other issues. In such cases, a timeout can be used to automatically terminate the cluster after the defined period of time.
        - `timeout` integer — Time (minutes) after which the cluster is automatically terminated if it's still in provisioning status.
        - `timeoutAction` 'terminate' | 'terminateAndRetry' — Desired action if the timeout is exceeded. Currently `terminate` and `terminateAndRetry` are supported.
    - `compute` object — describes the compute resources for the MR scaler
      - `ebsRootVolumeSize` integer — The EBS root volume size in GB
      - `availabilityZones` object[] — Array of availability zone objects
        - `name` string — AZ name - **required in clone or new strategy only**
        - `subnetId` string — EC2/VPC subnet ID - **required in clone or new strategy only**
      - `bootstrapActions` union — Describe bootstrap actions. For more information please see: [Advanced - Using Bootstrap And Configuration Files](https://docs.flexera.com/spot/elastigroup/tools-integrations/elastic-mapreduce/advanced-import-use-bootstrap-and-configuration-files)
        - object
          - `file` object, required — Bootstraps file for the group
            - `bucket` string — The S3 bucket name
            - `key` string — The S3 Bucket key
        - object
          - `jsonConfiguration` object[], required — Bootstraps configuration for the group
            - `name` string, required — The name of bootstrap action
            - `scriptBootstrapAction` object, required — The script run by the bootstrap action.
              - …
      - `steps` union — Describe emr steps. For more information please see: [Advanced - Using Bootstrap And Configuration Files](https://docs.flexera.com/spot/elastigroup/tools-integrations/elastic-mapreduce/advanced-import-use-bootstrap-and-configuration-files)
        - object
          - `file` object, required — Steps file for the group
            - `bucket` string — The S3 bucket name
            - `key` string — The S3 Bucket key
        - object
          - `jsonConfiguration` object[], required — Steps configuration for the group
            - `name` string, required — The name of configured step
            - `actionOnFailure` string — Valid values "TERMINATE_JOB_FLOW", "TERMINATE_CLUSTER", "CANCEL_AND_WAIT", "CONTINUE"
            - `stepConfig` object, required — The JAR file used for the step.
              - …
      - `instanceGroups` object[] — Array of instance groups for this MR scaler
        - `masterGroup` object
          - `instanceTypes` InstanceTypes — unresolved $ref
          - `target` integer — Number of instances in the master group - **required in clone or new strategy only**
          - `lifeCycle` LifeCycle, required — unresolved $ref
          - `configurations` union
            - 0 — unresolved $ref
            - 1 — unresolved $ref
        - `coreGroup` object
          - `instanceTypes` string[] — Instance types to choose from for the group - **required in clone or new strategy only**
          - `capacity` object — Capacity specifications for the group: minimum, maximum, and target compute resources
            - `minimum` integer — Minimum number of instances in group
            - `target` integer — Desired number of instances in group
            - `maximum` integer — Maximum number of instances in group
            - `unit` string — Unit of "instance" for the number of instances or unit of "weight" for the number of vCPU
          - `lifeCycle` 'SPOT' | 'ON_DEMAND' — **required** only with `clone` or `new` strategy
          - `ebsConfiguration` object — Information about the EBS configurations that will be attached to each EC2 instance in the group.
            - `ebsBlockDeviceConfigs` object[], required — An array of Amazon EBS volume specifications attached to a cluster instance.
              - …
            - `ebsOptimized` boolean, required — Indicates whether an Amazon EBS volume is EBS-optimized.
          - `configurations` union
            - 0 — unresolved $ref
            - 1 — unresolved $ref
        - `taskGroup` object
          - `instanceTypes` InstanceTypes — unresolved $ref
          - `capacity` Capacity — unresolved $ref
          - `lifeCycle` LifeCycle — unresolved $ref
          - `ebsConfiguration` EbsConfiguration — unresolved $ref
          - `configurations` union
            - 0 — unresolved $ref
            - 1 — unresolved $ref
      - `instanceWeights` object[] — An array of custom-weight settings
        - `instanceType` string, required — The instance type to set weight for
        - `weightedCapacity` integer, required — Weight for the chosen instance type.
      - `emrManagedMasterSecurityGroup` string — EMR Managed Security group that will be set to the master instance group
      - `emrManagedSlaveSecurityGroup` string — EMR Managed Security group that will be set to the slave instance group
      - `additionalMasterSecurityGroups` string[] — A list of additional Amazon EC2 security group IDs for the master node.
      - `additionalSlaveSecurityGroups` string[] — A list of additional Amazon EC2 security group IDs for the core and task nodes.
      - `serviceAccessSecurityGroup` string — The identifier of the Amazon EC2 security group for the Amazon EMR service to access clusters in VPC private subnets
      - `customAmiId` string — The ID of a custom Amazon EBS-backed Linux AMI if the cluster uses a custom AMI.
      - `repoUpgradeOnBoot` 'SECURITY' | 'NONE' — **Applies only when CustomAmiID is used**. Specifies the type of updates that are applied from the Amazon Linux AMI package repositories when an instance boots using the AMI.
      - `tags` object[] — array of key:value pairs of tags
        - `tagKey` string — The tag's key
        - `tagValue` string — The tag's value
      - `ec2KeyName` string — The name of an Amazon EC2 key-pair that can be used to `SSH` to the master node.
      - `applications` object[] — A case-insensitive array of applications for Amazon EMR to install and configure when launching the cluster.
        - `name` string — Application name
        - `args` string[] — Application arguments
        - `version` string — Application version
      - `configurations` union
        - object[] — EMR cluster configuration in JSON format. You can use `jsonConfiguration` or `file`, but not both. Can be used in `masterGroup`, `coreGroup`, and `taskGroup`.
          - `classification` string — The grouping within a configuration.
          - `properties` object — Within a configuration classification, a set of properties that represent the settings that you want to change in the configuration file. Duplicates not allowed.
          - `configurations` object[] — Array of objects with any keys. This can include additional levels (i.e., nested) of classification, properties, and configurations.
            - `classification` string — The grouping within a configuration.
            - `properties` object — Within a configuration classification, a set of properties that represent the settings that you want to change in the configuration file. Duplicates not allowed.
        - object
          - `file` object, required — Configurations file for the group
            - `bucket` string — S3 bucket name of the configurations file for the instance group
            - `key` string — S3 key name of the configurations file for the instance group
    - `cluster` object — **Allowed only when the `new` strategy is chosen.**
      - `terminationProtected` boolean — Specifies whether the Amazon EC2 instances in the cluster are protected from termination by API calls, user intervention, or in the event of a job-flow error
      - `keepJobFlowAliveWhenNoSteps` boolean — Specifies whether the cluster should remain available after completing all steps
      - `logUri` string — The path to the Amazon S3 location where logs for this cluster are stored.
      - `additionalInfo` string — This is meta information about third-party applications that third-party vendors use for testing purposes.
      - `jobFlowRole` string — The IAM role that was specified when the job flow was launched. The EC2 instances of the job flow assume this role.
      - `serviceRole` string — The IAM role that will be assumed by the Amazon EMR service to access AWS resources on your behalf
      - `securityConfiguration` string — The name of the security configuration applied to the cluster
    - `scheduling` object — Schedule tasks to execute on the Elastigroup.
      - `tasks` object[] — An array of scheduled tasks.
        - `isEnabled` boolean — Enable/Disable the specified scheduling task.
        - `instanceGroupType` 'task' — Select the EMR instance groups to execute the scheduled task on. Valid values: `task`
        - `taskType` 'setCapacity' — The type of task to be scheduled. Valid values: `setCapacity`
        - `cronExpression` string — A valid Cron expression
        - `targetCapacity` integer — Set a new target capacity for the Elastigroup.
        - `minCapacity` integer — Set a new minimum capacity for the Elastigroup.
        - `maxCapacity` integer — Set a new maximum capacity for the Elastigroup.
    - `scaling` object — Set scaling polices.
      - `up` object[] — A scale-up policy
        - `policyName` string — The Scaling policy name
        - `metricName` string — The name of the metric
        - `unit` 'seconds' | 'microseconds' | 'milliseconds' | 'bytes' | 'kilobytes' | 'megabytes' | 'gigabytes' | 'terabytes' | 'bits' | 'kilobits' | 'megabits' | 'gigabits' | 'terabits' | 'percent' | 'count' | 'bytes/second' | 'kilobytes/second' | 'megabytes/second' | 'gigabytes/second' | 'terabytes/second' | 'bits/second' | 'kilobits/second' | 'megabits/second' | 'gigabits/second' | 'terabits/second' | 'count/second' | 'none' — The unit for the alarm's associated metric.
        - `threshold` integer — The value against which the specified statistic is compared.
        - `action` object — The action to take when scale up is needed.
          - `type` 'adjustment' | 'updateCapacity' | 'setMinTarget' — The type of the action to take when scale up is needed. Valid Values: `adjustment` | `updateCapacity` | `setMinTarget`
          - `minTargetCapacity` integer — Required if using `setMinTarget` as action type. A number specifying the target capacity needed.
          - `adjustment` integer — Required if using `adjustment` as action type. The number associated with the specified adjustment type.
          - `target` integer — Required if using `updateCapacity` as action type and neither `minimum` nor `maximum` are defined. The desired number of instances.
          - `minimum` integer — Required if using `updateCapacity` as action type and neither `target` nor `maximum` are defined. The lower limit number of instances that you can scale down to.
          - `maximum` integer — Required if using `updateCapacity` as action type and neither `target` nor `minimum` defined. The upper limit number of instances that you can scale up to.
        - `adjustment` integer — **Cannot be used if using `action` or `minTargetCapacity`**. The number associated with the specified adjustment type.
        - `period` integer — The period in seconds over which the statistic is applied.
        - `evaluationPeriods` integer — The number of periods over which data is compared to the specified threshold
        - `dimensions` object[] — The dimensions for the alarm's associated metric.
          - `name` string — the dimension name
        - `operator` 'gte' | 'lte' | 'lt' | 'gt' — The operator to use in order to determine if the scaling policy is applicable. Valid values: `gt` | `gte` | `lt` | `lte`
        - `statistic` 'average' | 'sum' | 'sampleCount' | 'maximum' | 'minimum' — The metric statistics to return. Valid Values: `average`, `sum`, `sampleCount`, `maximum`, `minimum`
        - `namespace` string — The namespace for the alarm's associated metric.
      - `down` object[] — A scale-down policy
        - `policyName` string — The Scaling policy name
        - `metricName` string — The name of the metric
        - `unit` 'seconds' | 'microseconds' | 'milliseconds' | 'bytes' | 'kilobytes' | 'megabytes' | 'gigabytes' | 'terabytes' | 'bits' | 'kilobits' | 'megabits' | 'gigabits' | 'terabits' | 'percent' | 'count' | 'bytes/second' | 'kilobytes/second' | 'megabytes/second' | 'gigabytes/second' | 'terabytes/second' | 'bits/second' | 'kilobits/second' | 'megabits/second' | 'gigabits/second' | 'terabits/second' | 'count/second' | 'none' — The unit for the alarm's associated metric.
        - `threshold` integer — The value against which the specified statistic is compared.
        - `action` object — The action to take when scale down is needed.
          - `type` 'adjustment' | 'updateCapacity' | 'setMaxTarget' — The type of the action to take when scale down is needed. Valid Values: `adjustment` | `updateCapacity` | `setMaxTarget`
          - `maxTargetCapacity` integer — Required if using `setMaxTarget` as action type. A number specifying the target capacity needed.
          - `adjustment` integer — Required if using `adjustment` as action type. The number associated with the specified adjustment type.
          - `target` integer — Required if using `updateCapacity` as action type and neither `minimum` nor `maximum` are defined. The desired number of instances.
          - `minimum` integer — Required if using `updateCapacity` as action type and neither `target` nor `maximum` are defined. The lower limit number of instances that you can scale down to.
          - `maximum` integer — Required if using `updateCapacity` as action type and neither `target` nor `minimum` defined. The upper limit number of instances that you can scale up to.
        - `adjustment` integer — **Cannot be used if using `action` or `maxTargetCapacity`**. The number associated with the specified adjustment type.
        - `period` integer — The period in seconds over which the statistic is applied.
        - `evaluationPeriods` integer — The number of periods over which data is compared to the specified threshold
        - `dimensions` object[] — The dimensions for the alarm's associated metric.
          - `name` string — the dimension name
        - `operator` 'gte' | 'lte' | 'lt' | 'gt' — The operator to use in order to determine if the scaling policy is applicable. Valid values: `gt` | `gte` | `lt` | `lte`
        - `statistic` 'average' | 'sum' | 'sampleCount' | 'maximum' | 'minimum' — The metric statistics to return. Valid Values: `average`, `sum`, `sampleCount`, `maximum`, `minimum`
        - `namespace` string — The namespace for the alarm's associated metric.
    - `terminationPolicies` object[] — Termination policies for EMR clusters based on CloudWatch Metrics.
      - `statements` object[] — Array of termination statements to execute
        - `namespace` string, required — **Must be `AWS/ElasticMapReduce`"
        - `metricName` string, required — The name of the metric in CloudWatch which the statement will be based on.
        - `statistic` 'average' | 'sum' | 'sampleCount' | 'maximum' | 'minimum' — The aggregation method of the given metric
        - `unit` 'seconds' | 'microseconds' | 'milliseconds' | 'bytes' | 'kilobytes' | 'megabytes' | 'gigabytes' | 'terabytes' | 'bits' | 'kilobits' | 'megabits' | 'gigabits' | 'terabits' | 'percent' | 'count' | 'bytes/second' | 'kilobytes/second' | 'megabytes/second' | 'gigabytes/second' | 'terabytes/second' | 'bits/second' | 'kilobits/second' | 'megabits/second' | 'gigabits/second' | 'terabits/second' | 'count/second' | 'none' — The unit for a given metric.
        - `threshold` number, double, required — The value that the specified statistic is compared to.
        - `period` integer — The period in seconds over which the statistic is applied.
        - `evaluationPeriods` integer — The number of periods over which data is compared to the specified threshold
        - `operator` 'gte' | 'lte' | 'lt' | 'gt' — The operator to use in order to determine if the scaling policy is applicable. Valid values: `gt` | `gte` | `lt` | `lte`

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.net/spot/apis/spot-by-flexera-api.md) · [All operations](https://skmtc.net/spot/apis/spot-by-flexera-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/spot/spot-by-flexera-api/revisions/72813baf8d47/schema)
