amazon-web-services - 是否可以将 List<S3Target> 作为输入传递给 Cloud Formation?

标签 amazon-web-services amazon-s3 aws-cloudformation aws-glue

我有一个在 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/

相关文章:

amazon-web-services - 在 CloudFormation 中获取 AWS::MSK::Configuration 的最新版本

node.js - 远程调试托管在 AWS 上的 Node 应用程序

ssh - 权限被拒绝(公钥)。连接 AWS 服务器时

angularjs - Streaming-s3 无法在实时 -Nodejs 上运行

amazon-s3 - Windows Azure 和 Amazon Elastic Compute Cloud 有什么区别?

amazon-web-services - AWS CodePipeline 不将构件上传到 AWS S3

amazon-web-services - 在 CloudFormation 中使用 Join 函数不断出现错误

amazon-web-services - AWS Cloudformation 在创建之前删除资源

bash - 在同一台计算机上管理多个 AWS 账户

amazon-web-services - 如何在 terraform 资源中的 zipmap 和列表上创建嵌套 for 循环