SSM文档schemaVersion 2.2中使用AllowedPattern报错求助
解决SSM文档
AllowedPattern属性报错问题 问题出在属性名的大小写上:在schemaVersion 2.2的SSM文档中,参数的正则验证属性是小写开头的allowedPattern,而非你写的大写开头的AllowedPattern。YAML对属性名大小写敏感,系统无法识别不符合规范的大写开头属性,因此抛出InvalidDocumentContent错误。
修正后的文档内容如下:
schemaVersion: '2.2' description: Cat file from temp parameters: path: type: String description: path to file allowedPattern: ^\/tmp\/ssm-...$ mainSteps: - action: aws:runShellScript name: runShellScript inputs: timeoutSeconds: '30' runCommand: - if [ -f {{ path }} ]; then cat {{ path }}; else echo None; fi
补充说明:部分旧版本的SSM文档schema(如1.0)可能使用大写开头的属性命名,但2.2版本已统一为驼峰小写开头的规范,和官方文档的最新定义保持一致。
内容的提问来源于stack exchange,提问作者Filip Stefanov
相关产品推荐
相关产品推荐

