0

當創建經由API/CLI創建一個EmrCluster一個數據流水線,我可以指定使用陣列結構中的多個步驟:是否可以通過Cloudformation在AWS datapipeline中創建數組管道對象?

{ "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" } 
        ] 
       } 
      ] 
     } 
    } 
} 

利用上述模板,stepStringValue,等同於:

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

,而不是象所希望的配置的陣列。

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-datapipeline-pipeline-pipelineobjects-fields.html只顯示StringValueRefValue是有效的鍵 - 是否有可能通過CloudFormation創建一個步驟數組?

在此先感謝。

回答

0

啊,我不知道我在哪裏看到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" } 
       ] 
      } 
     } 
相關問題