eddmann / serverless-fargate

Maintain long-running Fargate ECS tasks within your Serverless project
52 stars 22 forks source link

Error unrecognized property 'cloudFormationResource' #29

Closed sivchand closed 2 years ago

sivchand commented 2 years ago

Issue description

When using cloudFormationResource, received this warning.

Running "serverless" from node_modules
Environment: darwin, node 18.9.0, framework 3.22.0 (local) 3.22.0v (global), plugin 6.2.2, SDK 4.3.2
Credentials: Local, "default" profile
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

Error:
Configuration error at 'fargate.tasks.mytask': unrecognized property 'cloudFormationResource'

Learn more about configuration validation here: http://slss.io/configuration-validation

When I turn off config validation the templates are generated correctly and able to deploy. As part of our workflow we keep configValidationMode: error

Service configuration

service: myfargate
configValidationMode: error
..snip...
fargate:
  containerInsights: true
  architecture: X86_64
  logGroupName: /aws/ecs/${self:service}-${sls:stage}
  logRetentionInDays: ${self:provider.logRetentionInDays}
  vpc:
    assignPublicIp: false
    subnetIds:
      - ${cf:${param:vpc_cf_stack}.PublicSubnet1}
      - ${cf:${param:vpc_cf_stack}.PublicSubnet2}
      - ${cf:${param:vpc_cf_stack}.PublicSubnet3}

  tasks:
    mytask:
      image: myimage
      cpu: ${param:cpus}
      memory: ${param:memory}

      service:
        desiredCount: 0
        maximumPercent: 200
        minimumHealthyPercent: 100
        spot: false

      command:
        - --loglevel
        - INFO
      cloudFormationResource:
        task:
          Volumes:
            - Name: downloads
        container:
          MountPoints:
            - SouceVolume: downloads
              ContainerPath: /downloads
... snip ...

Command used

serverless package

Environment Information

$ serverless -v

Running "serverless" from node_modules
Framework Core: 3.22.0 (local) 3.22.0 (global)
Plugin: 6.2.2
SDK: 4.3.2

$ npm list
workdir@ /Users/sivchand/Documents/workdir
├── serverless-fargate@0.0.10
└── serverless-prune-plugin@2.0.1
gilad-bridgement commented 2 years ago

When I turn off config validation the templates are generated correctly and able to deploy....

I can confirm this is what I am facing too. The warnings do not prevent deploy but prevents us from running validations.


PR #31 fixes this validation error