最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

spring - Unable to load a yaml file downloaded from S3 into Java because of intrinsic cloudFormation functions - Stack Overflow

programmeradmin1浏览0评论

My Yaml file is downloaded from S3 and the end of file looks like

Resource: 
                  - !Join [ "", ["arn:aws:iam::", !Ref "AWS::AccountId", ":role/Abc*"] ]
                  - !Join [ "", ["arn:aws:iam::", !Ref "AWS::AccountId", ":role/abc*"] ]

When i try to process it in Java using :

Yaml yaml = new Yaml();
template = yaml.load(templateContent);

SnakeYaml ( the parser I am using ) gives the error : org.yaml.snakeyaml.constructor.ConstructorException: Can't construct a java object for !Join; exception=Invalid tag: !Join in 'string', line 106, column 21 : - !Join [ "", ["arn:aws:iam::", !R ...

I know this is because !Join and !Ref are cloudFormation intrinsic functions and snakeYaml doesn't recognise these

Is there a workaround for this? What alternative methods could I use to do this successfully?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论