如何在CloudFromation模板中传递大shell命令

时间:2018-07-23 10:33:45

标签: shell amazon-web-services amazon-cloudformation

我正在shell命令活动下运行,以创建和运行我的shell脚本。 问题是我要执行很大的命令。无论如何,有没有将其放在CloudFromation templet中可以正常工作的方式。 这是我要运行的命令。

jsonDumpFL()
{
  cat <<EOF
{
   "QUEUEURL":"",
   "BUCKETREGION":"us-east-1",
   "FLAGFILE":"",
   "FTPUSERID":"pcfp-test-parameter",
   "FTPPATH":"/PCFP/Incr1",
   "FTPPASSWORD":"test-test-parameter",
   "PARAMETERSTOREREGION":"us-east-1",
   "ISFTP2S3":"false",
   "FTPSERVER":"11.11.11.11",
   "BUCKETNAME":"205147-trf-fr-nonprdo-us-east-1-trfsdioptmization/FinancialLineItem/MAIN",
   "QUEUEREGION":"",
   "ISSFTPENABLED":"false",
   "LOCALPATH":"path"
}
EOF
}

aws apigateway test-invoke-method --rest-api-id  1vfr --resource-id  6546 --http-method POST --body "$(jsonDumpFL)"

jsonDumpSEG()
{
  cat <<EOF
{
   "QUEUEURL":"",
   "BUCKETREGION":"us-east-1",
   "FLAGFILE":"",
   "FTPUSERID":"pcfp-test-parameter",
   "FTPPATH":"/PCFP/Incr1",
   "FTPPASSWORD":"test-test-parameter",
   "PARAMETERSTOREREGION":"us-east-1",
   "ISFTP2S3":"false",
   "FTPSERVER":"11.11.11.11",
   "BUCKETNAME":"205147-trf-fr-nonprdo-us-east-1-trfsdioptmization/Segments/MAIN",
   "QUEUEREGION":"",
   "ISSFTPENABLED":"false",
   "LOCALPATH":"path"
}
EOF
}

aws apigateway test-invoke-method --rest-api-id  1vfr --resource-id  6546 --http-method POST --body "$(jsonDumpSEG)"

我想在StringValue: "echo Tis is command "字段中的shell命令下方活动中传递shell命令上方

Id: "FinancialLineItemS3TOFTPShellCommandActivity"
        Name: "FinancialLineItemS3TOFTPShellCommandActivity"
        Fields: 
          - 
            Key: "type"
            StringValue: "ShellCommandActivity"
          - 
            Key: "runsOn"
            RefValue: "FinancialLineItemEmrCluster"
          - 
            Key: "dependsOn"
            RefValue: "FinancialLineItemActivity"
          - 
            Key: "command"
            StringValue: "echo Tis is command "
          - 
            Key: "onSuccess"
            RefValue: "FinancialLineItemCopyActivity_Success"
          - 
            Key: "onFail"
            RefValue: "FinancialLineItemCopyActivity_Failed"

0 个答案:

没有答案