1

我正在使用以下模板使用 cloudformation 创建作业定义。当我上传这个模板时,我收到了错误:

“模板验证错误:无效的模板属性或属性 [JobDefinition]”

我错过了模板中的某些内容吗?

{
  "JobDefinition": {
    "Type": "AWS::Batch::JobDefinition",
    "Properties": {
      "Type": "container",
      "JobDefinitionName" : "filedownload",
      "ContainerProperties": {
        "Image": "abc",
        "Vcpus": 4,
        "Memory": 2000,
        "JobRoleArn": "arn:aws:iam::********:role/batchjobRole",
        "ReadonlyRootFilesystem": true,
        "Privileged": true
    },   
    "RetryStrategy" : {"attempts": 1}    
    }
  }
}
4

1 回答 1

3

你需要放在"JobDefinition"里面"Resources"。例如:

{
  "Resources": {
    "JobDefinition": {
      "Type": "AWS::Batch::JobDefinition",
      "Properties": {
        "Type": "container",
        "JobDefinitionName" : "filedownload",
        "ContainerProperties": {
          "Image": "abc",
          "Vcpus": 4,
          "Memory": 2000,
          "JobRoleArn": "arn:aws:iam::********:role/batchjobRole",
          "ReadonlyRootFilesystem": true,
          "Privileged": true
      },   
      "RetryStrategy" : {"attempts": 1}    
      }
    }
  }
}
于 2017-11-03T22:20:44.233 回答