How can I implement an optional parameter to an AWS Glue Job?
I have a job which has a string parameter an ISO 8601 date string as an input which is used in the ETL job. I like to make this parameter as optional, so the job can use a default value if it is not provided (e.g. using datetime.now and datetime.isoformatin my case). I have tried using
import sys
from awsglue.utils import getResolvedOptions
args = getResolvedOptions(sys.argv, ['ISO_8601_STRING'])
However, when I am not passing an --ISO_8601_STRING job parameter I see the following error:
awsglue.utils.GlueArgumentError: argument --ISO_8601_STRING is required