我正在尝试从AWS创建一个胶水作业。当我在--name字段中使用实际的Glue作业名称时,它可以工作。
aws glue create-job \
--name my-first-glue-job-cli \
--role arn:aws:iam::***:role/GlueRole \
--command file://command.json \
--region us-east-2 \
--output json \
--default-arguments file://arguments.json \
--glue-version 3.0 \
--profile ***但是我希望附加在--name参数中的值从像--default-arguments / --command那样的文件中加载
我理解后两个选项是structure/map类型和-name是字符串类型。我已经通过了胶水文件
还通过cli文档从文件中加载参数。他们只提到json用例。
我尝试从我创建的本地txt文件中加载值,并将作业名放入该txt文件中。
aws glue create-job \
--name file://gluejobname.txt \
--role arn:aws:iam::***:role/GlueRole \
--command file://command.json \
--region us-east-2 \
--output json \
--default-arguments file://arguments.json \
--glue-version 3.0 \
--profile ***显示的错误是:
An error occurred (ValidationException) when calling the CreateJob operation: 1 validation error detected: Value 'my-first-glue-job-cli
' at 'name' failed to satisfy constraint: Member must satisfy regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*发布于 2022-05-01 07:30:39
cli将接受文件中的标量参数为file://gluejobname.txt。使用未引用的文本,没有换行符!
或者,使用--cli-input-json标志将所有参数作为一个JSON文件传递。例如:
# Generate a template (optional):
aws glue get-job --generate-cli-skeleton > params.json// params.json
{ "JobName": "" }# pass all params in one file
aws glue get-job --cli-input-json file://params.jsonhttps://stackoverflow.com/questions/72066455
复制相似问题