【问题标题】:Is it possible to create an array pipeline object in AWS datapipeline via Cloudformation?是否可以通过 Cloudformation 在 AWS 数据管道中创建数组管道对象?
【发布时间】:2017-08-17 04:58:00
【问题描述】:

通过创建 EmrCluster 的 API/CLI 创建数据管道时,我可以使用数组结构指定多个步骤:

{ "objects" : [
  { "id" : "myEmrCluster",
  "terminateAfter" : "1 hours",
  "schedule" : {"ref":"theSchedule"}
  "step" : ["some.jar,-param1,val1", "someOther.jar,-foo,bar"] },
  { "id" : "theSchedule", "period":"1 days" }
] }

我可以调用put-pipeline-definition 引用上面的文件为 EMR 集群创建多个步骤。

现在,如果我想使用 CloudFormation 创建管道,我可以使用 AWS::DataPipeline::Pipeline 资源类型中的 PipelineObjects 属性来配置管道。但是,管道对象只能是StringValueRefValue 类型。如何创建数组管道对象字段?

这是一个对应的cloudformation模板:

"Resources" : {
    "MyEMRCluster" : {
        "Type" : "AWS::DataPipeline::Pipeline",
        "Properties" : {
            "Name" : "MyETLJobs",
            "Activate" : "true",
            "PipelineObjects" : [
                {

                    "Id" : "myEmrCluster",
                    "Fields" : [
                        { "Key" : "terminateAfter","StringValue":"1 hours" },
                        { "Key" : "schedule","RefValue" : "theSchedule" },
                        { "Key" : "step","StringValue" : "some.jar,-param1,val1" }
                    ]
                },
                {
                    "Id" : "theSchedule",
                    "Fields" : [
                        { "Key" : "period","StringValue":"1 days" }
                    ]
                }
             ]
         }
    }
}

使用上面的模板,step 是一个StringValue,相当于:

"step" : "some.jar,-param1,val1"

而不是像所需配置那样的数组。

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datapipeline-pipeline-pipelineobjects-fields.html 仅显示 StringValueRefValue 是有效键 - 是否可以通过 CloudFormation 创建步骤数组??

提前致谢。

【问题讨论】:

    标签: amazon-web-services amazon-cloudformation amazon-data-pipeline


    【解决方案1】:

    啊,我不确定我在哪里看到 steps 可以配置为一个数组 - 文档没有提及 - 相反,它指定有多个步骤,应该使用多个 step 条目.

                {
    
                    "Id" : "myEmrCluster",
                    "Fields" : [
                        { "Key" : "terminateAfter","StringValue":"1 hours" },
                        { "Key" : "schedule","RefValue" : "theSchedule" },
                        { "Key" : "step","StringValue" : "some.jar,-param1,val1" },
                        { "Key" : "step","StringValue" : "someOther.jar,-foo,bar" }
                    ]
                }
           }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-09-18
      • 2021-07-03
      • 1970-01-01
      • 2014-08-17
      • 1970-01-01
      • 2017-05-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多