title: Optional job parameter in AWS Glue?
body: <p>How can I implement an optional parameter to an AWS Glue Job?</p>
  
  <p>I have created a job that currently have a string parameter (an ISO 8601 date string) as an input that is used in the ETL job. I would like to make this parameter optional, so that the job use a default value if it is not provided (e.g. using <a href="https://docs.python.org/2/library/datetime.html?highlight=datetime#datetime.datetime.now" rel="noreferrer">datetime.now</a> and <a href="https://docs.python.org/2/library/datetime.html?highlight=datetime#datetime.datetime.isoformat" rel="noreferrer">datetime.isoformat</a>in my case). I have tried using <a href="https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-crawler-pyspark-extensions-get-resolved-options.html" rel="noreferrer">getResolvedOptions</a>:</p>
  
  <pre><code>import sys
  from awsglue.utils import getResolvedOptions
  
  args = getResolvedOptions(sys.argv, ['ISO_8601_STRING'])
  </code></pre>
  
  <p>However, when I am not passing an <code>--ISO_8601_STRING</code> job parameter I see the following error:</p>
  
  <blockquote>
    <p>awsglue.utils.GlueArgumentError: argument --ISO_8601_STRING is required</p>
  </blockquote>