我有一个在 cloudformation 中定义的 AWS::Glue::Crawler
资源,如下所示:
# ...
Parameters:
pS3Targets:
Type: List<AWS::Glue::Crawler::S3Target> # <-- I want this. This does not appear to be supported
Resources:
# ...
rCrawler:
Type: AWS::Glue::Crawler
Properties:
Name: "my_crawler"
DatabaseName: "my_db"
Role: !GetAtt myRole.Arn
Schedule:
ScheduleExpression: !Ref pCrawlerSchedule
Targets:
# TODO: parameterize the List of S3Targets
S3Targets:
- Path: !Sub "s3://my-bucket/table1/"
- Path: !Sub "s3://my-bucket/table2/"
- Path: !Sub "s3://my-bucket/table3/"
- Path: !Sub "s3://my-bucket/tableN/"
我希望能够将可变数量的 S3 路径(S3Target 类型)传递到 cloudformation 模板。这可能吗?
最佳答案
我知道这并不完美,但这是我发现接近您目标的唯一方法:
Parameters:
pS3Targets:
Type: String
Default: "s3://path1,s3://path2"
Resources:
rCrawler:
...
Targets:
S3Targets:
- Path: !Select [0, !Split [",", !Ref pS3Targets]]
- Path: !Select [1, !Split [",", !Ref pS3Targets]]
关于amazon-web-services - 是否可以将 List<S3Target> 作为输入传递给 Cloud Formation?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59535728/