{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-emr/json-schema/amazon-emr-emr-serverless-start-job-run-request-schema.json",
  "title": "EmrServerlessStartJobRunRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-emr-jobruns-api-openapi.yml#/components/schemas/EmrServerlessStartJobRunRequest",
  "type": "object",
  "properties": {
    "applicationId": {
      "type": "string",
      "description": "The ID of the application on which to run the job."
    },
    "clientToken": {
      "type": "string",
      "description": "The client idempotency token of the job run to start. Its value must be unique for each request."
    },
    "executionRoleArn": {
      "type": "string",
      "description": "The execution role ARN for the job run."
    },
    "executionIamPolicy": {
      "$ref": "#/$defs/JobRunExecutionIamPolicy"
    },
    "jobDriver": {
      "$ref": "#/$defs/EmrServerlessJobDriver"
    },
    "configurationOverrides": {
      "$ref": "#/$defs/EmrServerlessConfigurationOverrides"
    },
    "tags": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "The tags assigned to the job run."
    },
    "executionTimeoutMinutes": {
      "type": "integer",
      "description": "The maximum duration, in minutes, for the job run. If the job run exceeds this duration, Amazon EMR Serverless cancels it automatically. For BATCH mode job runs, the maximum value is 10080 minutes (7 days) starting with Amazon EMR release 7.11. Setting a value of 0 to disable the timeout is no longer supported for BATCH mode job runs."
    },
    "name": {
      "type": "string",
      "description": "The optional job run name. This doesn't have to be unique."
    },
    "mode": {
      "type": "string",
      "description": "The mode of the job run when it starts."
    },
    "retryPolicy": {
      "$ref": "#/$defs/RetryPolicy"
    }
  },
  "required": [
    "applicationId",
    "clientToken",
    "executionRoleArn"
  ],
  "$defs": {
    "CloudWatchLoggingConfiguration": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "Enables CloudWatch logging."
        },
        "logGroupName": {
          "type": "string",
          "description": "The name of the log group in Amazon CloudWatch Logs where you want to publish your logs."
        },
        "logStreamNamePrefix": {
          "type": "string",
          "description": "Prefix for the CloudWatch log stream name."
        },
        "encryptionKeyArn": {
          "type": "string",
          "description": "The Key Management Service (KMS) key ARN to encrypt the logs that you store in CloudWatch Logs."
        },
        "logTypes": {
          "type": "object",
          "additionalProperties": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "description": "The types of logs that you want to publish to CloudWatch. If you don't specify any log types, driver STDOUT and STDERR logs will be published to CloudWatch Logs by default. For more information including the supported worker types for Hive and Spark, see Logging for EMR Serverless with CloudWatch. Key Valid Values: SPARK_DRIVER, SPARK_EXECUTOR, HIVE_DRIVER, TEZ_TASK Array Members Valid Values: STDOUT, STDERR, HIVE_LOG, TEZ_AM, SYSTEM_LOGS"
        }
      },
      "required": [
        "enabled"
      ]
    },
    "DiskEncryptionConfiguration": {
      "type": "object",
      "properties": {
        "encryptionContext": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Specifies the optional encryption context that will be used when encrypting the data. An encryption context is a collection of non-secret key-value pairs that represent additional authenticated data."
        },
        "encryptionKeyArn": {
          "type": "string",
          "description": "The KMS key ARN to encrypt local disks."
        }
      }
    },
    "EmrServerlessConfiguration": {
      "type": "object",
      "properties": {
        "classification": {
          "type": "string",
          "description": "The classification within a configuration."
        },
        "properties": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "A set of properties specified within a configuration classification."
        },
        "configurations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EmrServerlessConfiguration"
          },
          "description": "A list of additional configurations to apply within a configuration object."
        }
      },
      "required": [
        "classification"
      ]
    },
    "EmrServerlessConfigurationOverrides": {
      "type": "object",
      "properties": {
        "applicationConfiguration": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EmrServerlessConfiguration"
          },
          "description": "The override configurations for the application."
        },
        "monitoringConfiguration": {
          "$ref": "#/$defs/EmrServerlessMonitoringConfiguration"
        },
        "diskEncryptionConfiguration": {
          "$ref": "#/$defs/DiskEncryptionConfiguration"
        }
      }
    },
    "EmrServerlessJobDriver": {
      "type": "object",
      "properties": {
        "sparkSubmit": {
          "$ref": "#/$defs/SparkSubmit"
        },
        "hive": {
          "$ref": "#/$defs/Hive"
        }
      },
      "description": "Exactly one member is set."
    },
    "EmrServerlessMonitoringConfiguration": {
      "type": "object",
      "properties": {
        "s3MonitoringConfiguration": {
          "$ref": "#/$defs/EmrServerlessS3MonitoringConfiguration"
        },
        "managedPersistenceMonitoringConfiguration": {
          "$ref": "#/$defs/ManagedPersistenceMonitoringConfiguration"
        },
        "cloudWatchLoggingConfiguration": {
          "$ref": "#/$defs/CloudWatchLoggingConfiguration"
        },
        "prometheusMonitoringConfiguration": {
          "$ref": "#/$defs/PrometheusMonitoringConfiguration"
        }
      }
    },
    "EmrServerlessS3MonitoringConfiguration": {
      "type": "object",
      "properties": {
        "logUri": {
          "type": "string",
          "description": "The Amazon S3 destination URI for log publishing."
        },
        "encryptionKeyArn": {
          "type": "string",
          "description": "The KMS key ARN to encrypt the logs published to the given Amazon S3 destination."
        }
      }
    },
    "Hive": {
      "type": "object",
      "properties": {
        "query": {
          "type": "string",
          "description": "The query for the Hive job run."
        },
        "initQueryFile": {
          "type": "string",
          "description": "The query file for the Hive job run."
        },
        "parameters": {
          "type": "string",
          "description": "The parameters for the Hive job run."
        }
      },
      "required": [
        "query"
      ]
    },
    "JobRunExecutionIamPolicy": {
      "type": "object",
      "properties": {
        "policy": {
          "type": "string",
          "description": "An IAM inline policy to use as an execution IAM policy."
        },
        "policyArns": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A list of Amazon Resource Names (ARNs) to use as an execution IAM policy."
        }
      }
    },
    "ManagedPersistenceMonitoringConfiguration": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "Enables managed logging and defaults to true. If set to false, managed logging will be turned off."
        },
        "encryptionKeyArn": {
          "type": "string",
          "description": "The KMS key ARN to encrypt the logs stored in managed log persistence."
        }
      }
    },
    "PrometheusMonitoringConfiguration": {
      "type": "object",
      "properties": {
        "remoteWriteUrl": {
          "type": "string",
          "description": "The remote write URL in the Amazon Managed Service for Prometheus workspace to send metrics to."
        }
      }
    },
    "RetryPolicy": {
      "type": "object",
      "properties": {
        "maxAttempts": {
          "type": "integer",
          "description": "Maximum number of attempts for the job run. This parameter is only applicable for BATCH mode."
        },
        "maxFailedAttemptsPerHour": {
          "type": "integer",
          "description": "Maximum number of failed attempts per hour. This [arameter is only applicable for STREAMING mode."
        }
      }
    },
    "SparkSubmit": {
      "type": "object",
      "properties": {
        "entryPoint": {
          "type": "string",
          "description": "The entry point for the Spark submit job run."
        },
        "entryPointArguments": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The arguments for the Spark submit job run."
        },
        "sparkSubmitParameters": {
          "type": "string",
          "description": "The parameters for the Spark submit job run."
        }
      },
      "required": [
        "entryPoint"
      ]
    }
  }
}