title: AWS BATCH - SubmitJob operation: Job Queue is attached to Compute Environment that can not run Jobs with capability EC2
body: <p>I am trying to deploy an AWS Batch with Fargate type but when I try to submit a job to this batch I got the following error</p>
  <p>An error occurred (ClientException) when calling the SubmitJob operation: Job Queue is attached to Compute Environment that can not run Jobs with capability EC2</p>
  <hr />
  <p>This is the configuration that I'm using to create my resources with serverless-framework</p>
  <pre class="lang-yaml prettyprint-override"><code>resources:
    Resources:
      SlsComputeEnv:
          Type: AWS::Batch::ComputeEnvironment
          Properties:
            Type: MANAGED
            ServiceRole: !GetAtt BatchServiceRole.Arn
            ComputeEnvironmentName: ${self:custom.batch.compute_env}
            ComputeResources:
              MaxvCpus: 32
              SecurityGroupIds: 
                - security
              Subnets:
                - subnet
              Type: FARGATE
            State: ENABLED
        SlsJobQueue:
          Type: AWS::Batch::JobQueue
          Properties:
            JobQueueName: ${self:custom.batch.job_queue}
            ComputeEnvironmentOrder:
              - Order: 1
                ComputeEnvironment: !Ref SlsComputeEnv
            State: ENABLED
            Priority: 1
        SlsJobDefinition:
          Type: AWS::Batch::JobDefinition
          Properties:
            Type: container
            JobDefinitionName: ${self:custom.batch.job_definition}
            ContainerProperties:
              ExecutionRoleArn: !GetAtt FargateExecutionRole.Arn
              ResourceRequirements:
                - Type: MEMORY
                  Value: 8
                - Type: VCPU
                  Value: 4
              Image: ecr-path
  </code></pre>
  <p>python code to submit a job</p>
  <pre class="lang-py prettyprint-override"><code>import boto3
  client = boto3.client(&quot;batch&quot;)
  client.submit_job(
          jobName=f&quot;test-fargate-dev&quot;,
          jobQueue=BATCH_JOB_QUEUE_ARN,
          jobDefinition=BATCH_JOB_DEFINITION,
          containerOverrides={
              &quot;command&quot;: [&quot;python3&quot;, &quot;script.py&quot;],
              &quot;environment&quot;: [
                  {&quot;name&quot;: &quot;AWS_DEFAULT_REGION&quot;, &quot;value&quot;: &quot;us-east-1&quot;},
                  {&quot;name&quot;: &quot;stage&quot;, &quot;value&quot;: &quot;dev&quot;},
              ],
          },
      )
  </code></pre>