'Can't deploy AWS Glue Job resource on Serverless
I have a Serverless project in which one of the resource is a Glue Job. I'm trying to set one default argument and use it with getResolvedOptions, but when I deploy I always get the following error.
An error occurred: MyGlue - Property validation failure: [Value of property {/DefaultArguments/--POINTED_BUCKET} does not match type {String}].
This is the code of serverless.yml:
# CUSTOM VARIABLES
monitoredBucket:
dev:
- my-bucket-dev
prod:
- my-bucket
# GLUE RESOURCE
MyGlue:
Type: AWS::Glue::Job
Properties:
Name: MyGlue
Role: !GetAtt GlueRole.Arn
GlueVersion: '1.0'
MaxRetries: 0
MaxCapacity: 1
Timeout: 60
ExecutionProperty:
MaxConcurrentRuns: 1
DefaultArguments:
'--extra-py-files': "s3://${self:custom.dependenciesGlueBucket.${opt:stage, 'dev'}}/some/pip/library/to-install.egg"
'--POINTED_BUCKET': "${self:custom.monitoredBucket.${opt:stage, 'dev'}}" # Fails when add this.
#'--POINTED_BUCKET': "my-bucket-dev" # This works.
Command:
Name: pythonshell
PythonVersion: '3'
ScriptLocation: "s3://${self:custom.deploymentGlueBucket.${opt:stage, 'dev'}}/the-location/to-my-glue-script.py"
Connections:
Connections: ${self:custom.glue_connections.${opt:stage, 'dev'}}
I used "${self:custom.monitoredBucket.${opt:stage, 'dev'}}" in some other resources as lambda functions and works well, but for this case I'm unable to deploy.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
