从AWS CLI中的本地文件加载参数
我正在尝试从AWS CLI创建胶水工作。当我在中使用实际的胶合作业名称 - 名称
字段时,它可以
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 ***
工作- Default-arguments
/- 命令
我知道后两个选项是结构/地图类型,-name是字符串类型。我已经通过 glue文档
也通过 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]*
I am trying to create a glue job from AWS CLI. It works when I use the actual Glue Job name in the --name
field
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 ***
But I want the value attached in the --name
parameter to be loaded from a file just like --default-arguments
/ --command
I understand the latter two options are structure/map type and --name is of string type. I have gone through the glue documentation
Also went through the cli documentation to load parameters from a file. They only mention json use-cases.
I tried loading the value from a local txt file I created and put the job-name inside that txt file.
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 ***
Error being displayed is:
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]*
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
CLI将以
file> file://gluejobname.txt
接受标量参数。使用未引用的文字,没有新线!或者,使用
-cli-Input-json
flag传递所有参数作为单个JSON文件。例如:The cli will accept a scalar parameter from a file as
file://gluejobname.txt
. Use unquoted text, no newlines!Alternatively, pass all params as a single JSON file using the
--cli-input-json
flag. For example: