AWS Tools for Windows PowerShell
Command Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Synopsis

Calls the AWS Glue CreateJob API operation.

Syntax

New-GLUEJob
-Command <JobCommand>
-SourceControlDetails_AuthStrategy <SourceControlAuthStrategy>
-SourceControlDetails_AuthToken <String>
-SourceControlDetails_Branch <String>
-CodeGenConfigurationNode <Hashtable>
-Connections_Connection <String[]>
-DefaultArgument <Hashtable>
-Description <String>
-ExecutionClass <ExecutionClass>
-SourceControlDetails_Folder <String>
-GlueVersion <String>
-SourceControlDetails_LastCommitId <String>
-LogUri <String>
-MaxCapacity <Double>
-ExecutionProperty_MaxConcurrentRun <Int32>
-MaxRetry <Int32>
-Name <String>
-NonOverridableArgument <Hashtable>
-NotificationProperty_NotifyDelayAfter <Int32>
-NumberOfWorker <Int32>
-SourceControlDetails_Owner <String>
-SourceControlDetails_Provider <SourceControlProvider>
-SourceControlDetails_Repository <String>
-Role <String>
-SecurityConfiguration <String>
-Tag <Hashtable>
-Timeout <Int32>
-WorkerType <WorkerType>
-AllocatedCapacity <Int32>
-Select <String>
-PassThru <SwitchParameter>
-Force <SwitchParameter>
-ClientConfig <AmazonGlueConfig>

Description

Creates a new job definition.

Parameters

-AllocatedCapacity <Int32>
This parameter is deprecated. Use MaxCapacity instead.The number of Glue data processing units (DPUs) to allocate to this Job. You can allocate a minimum of 2 DPUs; the default is 10. A DPU is a relative measure of processing power that consists of 4 vCPUs of compute capacity and 16 GB of memory. For more information, see the Glue pricing page.This parameter is deprecated.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-ClientConfig <AmazonGlueConfig>
Amazon.PowerShell.Cmdlets.GLUE.AmazonGlueClientCmdlet.ClientConfig
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-CodeGenConfigurationNode <Hashtable>
The representation of a directed acyclic graph on which both the Glue Studio visual component and Glue Studio code generation is based.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesCodeGenConfigurationNodes
-Command <JobCommand>
The JobCommand that runs this job.
Required?True
Position?1
Accept pipeline input?True (ByValue, ByPropertyName)
-Connections_Connection <String[]>
A list of connections used by the job.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesConnections_Connections
-DefaultArgument <Hashtable>
The default arguments for every run of this job, specified as name-value pairs.You can specify arguments here that your own job-execution script consumes, as well as arguments that Glue itself consumes.Job arguments may be logged. Do not pass plaintext secrets as arguments. Retrieve secrets from a Glue Connection, Secrets Manager or other secret management mechanism if you intend to keep them within the Job. For information about how to specify and consume your own Job arguments, see the Calling Glue APIs in Python topic in the developer guide.For information about the arguments you can provide to this field when configuring Spark jobs, see the Special Parameters Used by Glue topic in the developer guide.For information about the arguments you can provide to this field when configuring Ray jobs, see Using job parameters in Ray jobs in the developer guide.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesDefaultArguments
-Description <String>
Description of the job being defined.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-ExecutionClass <ExecutionClass>
Indicates whether the job is run with a standard or flexible execution class. The standard execution-class is ideal for time-sensitive workloads that require fast job startup and dedicated resources.The flexible execution class is appropriate for time-insensitive jobs whose start and completion times may vary. Only jobs with Glue version 3.0 and above and command type glueetl will be allowed to set ExecutionClass to FLEX. The flexible execution class is available for Spark jobs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-ExecutionProperty_MaxConcurrentRun <Int32>
The maximum number of concurrent runs allowed for the job. The default is 1. An error is returned when this threshold is reached. The maximum value you can specify is controlled by a service limit.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesExecutionProperty_MaxConcurrentRuns
This parameter overrides confirmation prompts to force the cmdlet to continue its operation. This parameter should always be used with caution.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-GlueVersion <String>
In Spark jobs, GlueVersion determines the versions of Apache Spark and Python that Glue available in a job. The Python version indicates the version supported for jobs of type Spark. Ray jobs should set GlueVersion to 4.0 or greater. However, the versions of Ray, Python and additional libraries available in your Ray job are determined by the Runtime parameter of the Job command.For more information about the available Glue versions and corresponding Spark and Python versions, see Glue version in the developer guide.Jobs that are created without specifying a Glue version default to Glue 0.9.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-LogUri <String>
This field is reserved for future use.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-MaxCapacity <Double>
For Glue version 1.0 or earlier jobs, using the standard worker type, the number of Glue data processing units (DPUs) that can be allocated when this job runs. A DPU is a relative measure of processing power that consists of 4 vCPUs of compute capacity and 16 GB of memory. For more information, see the Glue pricing page.For Glue version 2.0+ jobs, you cannot specify a Maximum capacity. Instead, you should specify a Worker type and the Number of workers.Do not set MaxCapacity if using WorkerType and NumberOfWorkers.The value that can be allocated for MaxCapacity depends on whether you are running a Python shell job, an Apache Spark ETL job, or an Apache Spark streaming ETL job:
  • When you specify a Python shell job (JobCommand.Name="pythonshell"), you can allocate either 0.0625 or 1 DPU. The default is 0.0625 DPU.
  • When you specify an Apache Spark ETL job (JobCommand.Name="glueetl") or Apache Spark streaming ETL job (JobCommand.Name="gluestreaming"), you can allocate from 2 to 100 DPUs. The default is 10 DPUs. This job type cannot have a fractional DPU allocation.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-MaxRetry <Int32>
The maximum number of times to retry this job if it fails.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesMaxRetries
-Name <String>
The name you assign to this job definition. It must be unique in your account.
Required?True
Position?Named
Accept pipeline input?True (ByPropertyName)
-NonOverridableArgument <Hashtable>
Arguments for this job that are not overridden when providing job arguments in a job run, specified as name-value pairs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesNonOverridableArguments
-NotificationProperty_NotifyDelayAfter <Int32>
After a job run starts, the number of minutes to wait before sending a job run delay notification.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-NumberOfWorker <Int32>
The number of workers of a defined workerType that are allocated when a job runs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesNumberOfWorkers
-PassThru <SwitchParameter>
Changes the cmdlet behavior to return the value passed to the Command parameter. The -PassThru parameter is deprecated, use -Select '^Command' instead. This parameter will be removed in a future version.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Role <String>
The name or Amazon Resource Name (ARN) of the IAM role associated with this job.
Required?True
Position?Named
Accept pipeline input?True (ByPropertyName)
-SecurityConfiguration <String>
The name of the SecurityConfiguration structure to be used with this job.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Select <String>
Use the -Select parameter to control the cmdlet output. The default value is 'Name'. Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.Glue.Model.CreateJobResponse). Specifying the name of a property of type Amazon.Glue.Model.CreateJobResponse will result in that property being returned. Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-SourceControlDetails_AuthStrategy <SourceControlAuthStrategy>
The type of authentication, which can be an authentication token stored in Amazon Web Services Secrets Manager, or a personal access token.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-SourceControlDetails_AuthToken <String>
The value of an authorization token.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-SourceControlDetails_Branch <String>
An optional branch in the remote repository.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-SourceControlDetails_Folder <String>
An optional folder in the remote repository.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-SourceControlDetails_LastCommitId <String>
The last commit ID for a commit in the remote repository.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-SourceControlDetails_Owner <String>
The owner of the remote repository that contains the job artifacts.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-SourceControlDetails_Provider <SourceControlProvider>
The provider for the remote repository.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-SourceControlDetails_Repository <String>
The name of the remote repository that contains the job artifacts.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Tag <Hashtable>
The tags to use with this job. You may use tags to limit access to the job. For more information about tags in Glue, see Amazon Web Services Tags in Glue in the developer guide.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesTags
-Timeout <Int32>
The job timeout in minutes. This is the maximum time that a job run can consume resources before it is terminated and enters TIMEOUT status. The default is 2,880 minutes (48 hours).
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-WorkerType <WorkerType>
The type of predefined worker that is allocated when a job runs. Accepts a value of G.1X, G.2X, G.4X, G.8X or G.025X for Spark jobs. Accepts the value Z.2X for Ray jobs.
  • For the G.1X worker type, each worker maps to 1 DPU (4 vCPUs, 16 GB of memory) with 84GB disk (approximately 34GB free), and provides 1 executor per worker. We recommend this worker type for workloads such as data transforms, joins, and queries, to offers a scalable and cost effective way to run most jobs.
  • For the G.2X worker type, each worker maps to 2 DPU (8 vCPUs, 32 GB of memory) with 128GB disk (approximately 77GB free), and provides 1 executor per worker. We recommend this worker type for workloads such as data transforms, joins, and queries, to offers a scalable and cost effective way to run most jobs.
  • For the G.4X worker type, each worker maps to 4 DPU (16 vCPUs, 64 GB of memory) with 256GB disk (approximately 235GB free), and provides 1 executor per worker. We recommend this worker type for jobs whose workloads contain your most demanding transforms, aggregations, joins, and queries. This worker type is available only for Glue version 3.0 or later Spark ETL jobs in the following Amazon Web Services Regions: US East (Ohio), US East (N. Virginia), US West (Oregon), Asia Pacific (Singapore), Asia Pacific (Sydney), Asia Pacific (Tokyo), Canada (Central), Europe (Frankfurt), Europe (Ireland), and Europe (Stockholm).
  • For the G.8X worker type, each worker maps to 8 DPU (32 vCPUs, 128 GB of memory) with 512GB disk (approximately 487GB free), and provides 1 executor per worker. We recommend this worker type for jobs whose workloads contain your most demanding transforms, aggregations, joins, and queries. This worker type is available only for Glue version 3.0 or later Spark ETL jobs, in the same Amazon Web Services Regions as supported for the G.4X worker type.
  • For the G.025X worker type, each worker maps to 0.25 DPU (2 vCPUs, 4 GB of memory) with 84GB disk (approximately 34GB free), and provides 1 executor per worker. We recommend this worker type for low volume streaming jobs. This worker type is only available for Glue version 3.0 streaming jobs.
  • For the Z.2X worker type, each worker maps to 2 M-DPU (8vCPUs, 64 GB of memory) with 128 GB disk (approximately 120GB free), and provides up to 8 Ray workers based on the autoscaler.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)

Common Credential and Region Parameters

-AccessKey <String>
The AWS access key for the user account. This can be a temporary access key if the corresponding session token is supplied to the -SessionToken parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAK
-Credential <AWSCredentials>
An AWSCredentials object instance containing access and secret key information, and optionally a token for session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByValue, ByPropertyName)
-EndpointUrl <String>
The endpoint to make the call against.Note: This parameter is primarily for internal AWS use and is not required/should not be specified for normal usage. The cmdlets normally determine which endpoint to call based on the region specified to the -Region parameter or set as default in the shell (via Set-DefaultAWSRegion). Only specify this parameter if you must direct the call to a specific custom endpoint.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-NetworkCredential <PSCredential>
Used with SAML-based authentication when ProfileName references a SAML role profile. Contains the network credentials to be supplied during authentication with the configured identity provider's endpoint. This parameter is not required if the user's default network identity can or should be used during authentication.
Required?False
Position?Named
Accept pipeline input?True (ByValue, ByPropertyName)
-ProfileLocation <String>
Used to specify the name and location of the ini-format credential file (shared with the AWS CLI and other AWS SDKs)If this optional parameter is omitted this cmdlet will search the encrypted credential file used by the AWS SDK for .NET and AWS Toolkit for Visual Studio first. If the profile is not found then the cmdlet will search in the ini-format credential file at the default location: (user's home directory)\.aws\credentials.If this parameter is specified then this cmdlet will only search the ini-format credential file at the location given.As the current folder can vary in a shell or during script execution it is advised that you use specify a fully qualified path instead of a relative path.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesAWSProfilesLocation, ProfilesLocation
-ProfileName <String>
The user-defined name of an AWS credentials or SAML-based role profile containing credential information. The profile is expected to be found in the secure credential file shared with the AWS SDK for .NET and AWS Toolkit for Visual Studio. You can also specify the name of a profile stored in the .ini-format credential file used with the AWS CLI and other AWS SDKs.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesStoredCredentials, AWSProfileName
-Region <Object>
The system name of an AWS region or an AWSRegion instance. This governs the endpoint that will be used when calling service operations. Note that the AWS resources referenced in a call are usually region-specific.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesRegionToCall
-SecretKey <String>
The AWS secret key for the user account. This can be a temporary secret key if the corresponding session token is supplied to the -SessionToken parameter.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesSK, SecretAccessKey
-SessionToken <String>
The session token if the access and secret keys are temporary session-based credentials.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
AliasesST

Outputs

This cmdlet returns a System.String object. The service call response (type Amazon.Glue.Model.CreateJobResponse) can also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack.

Examples

Example 1

$Command = New-Object Amazon.Glue.Model.JobCommand
$Command.Name = 'glueetl'
$Command.ScriptLocation = 's3://aws-glue-scripts-000000000000-us-west-2/admin/MyTestGlueJob.py'
$Command

$Source = "source_test_table"
$Target = "target_test_table"
$Connections = $Source, $Target

$DefArgs = @{
'--TempDir' = 's3://aws-glue-temporary-000000000000-us-west-2/admin'
'--job-bookmark-option' = 'job-bookmark-disable'
'--job-language' = 'python'
}
$DefArgs

$ExecutionProp = New-Object Amazon.Glue.Model.ExecutionProperty
$ExecutionProp.MaxConcurrentRuns = 1
$ExecutionProp

$JobParams = @{
"AllocatedCapacity" = "5"
"Command" = $Command
"Connections_Connection" = $Connections
"DefaultArguments" = $DefArgs
"Description" = "This is a test"
"ExecutionProperty" = $ExecutionProp
"MaxRetries" = "1"
"Name" = "MyOregonTestGlueJob"
"Role" = "Amazon-GlueServiceRoleForSSM"
"Timeout" = "20"
}

New-GlueJob @JobParams
This example creates a new job in AWS Glue. The command name value is always glueetl. AWS Glue supports running job scripts written in Python or Scala. In this example, the job script (MyTestGlueJob.py) is written in Python. Python parameters are specified in the $DefArgs variable, and then passed to the PowerShell command in the DefaultArguments parameter, which accepts a hashtable. The parameters in the $JobParams variable come from the CreateJob API, documented in the Jobs (https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-jobs-job.html) topic of the AWS Glue API reference.

Supported Version

AWS Tools for PowerShell: 2.x.y.z