I get and error on old SLS (v2.69) project, I push...
# seed
g
I get and error on old SLS (v2.69) project, I pushed only a minor change (no infrastructure change), my app seems configured correctly and I didn’t make changes on configuration.
Copy code
$ SLS_DEBUG=* serverless package --stage dev --package sls-package-output --region eu-central-1
1.57 s
Serverless: Deprecation warning: Variables resolver reports following resolution errors:
              - Variable syntax error at "resources.Resources.UserStoragePolicy.Properties.PolicyDocument.Statement.0.Resource.1.Fn::Join.1.2": Missing variable closing bracket in /protected/${<http://cognito-identity.amazonaws.com:sub|cognito-identity.amazonaws.com:sub>,
              - Variable syntax error at "resources.Resources.UserStoragePolicy.Properties.PolicyDocument.Statement.0.Resource.2.Fn::Join.1.2": Missing variable closing bracket in /private/${<http://cognito-identity.amazonaws.com:sub|cognito-identity.amazonaws.com:sub>,
              - Variable syntax error at "resources.Resources.UserStoragePolicy.Properties.PolicyDocument.Statement.3.Condition.StringLike.s3:prefix.4.Fn::Join.1.1": Missing variable closing bracket in ${<http://cognito-identity.amazonaws.com:sub|cognito-identity.amazonaws.com:sub>,
              - Variable syntax error at "resources.Resources.UserStoragePolicy.Properties.PolicyDocument.Statement.3.Condition.StringLike.s3:prefix.5.Fn::Join.1.1": Missing variable closing bracket in ${<http://cognito-identity.amazonaws.com:sub|cognito-identity.amazonaws.com:sub>
            From a next major this will be communicated with a thrown error.
            Set "variablesResolutionMode: 20210326" in your service config, to adapt to new behavior now
            More Info: <https://www.serverless.com/framework/docs/deprecations/#NEW_VARIABLES_RESOLVER>
Serverless: Running "serverless" installed locally (in service node_modules)
 
 Serverless Error ----------------------------------------
 
  ServerlessError: Cannot run local installation of the Serverless Framework by the outdated global version.
  Please upgrade via:
  
  npm install -g serverless
  Note: Latest release can run any version of the locally installed Serverless Framework.
  
  Alternatively run locally installed version directly via:
  
  npx serverless <command> <options>
      at new Serverless (/tmp/seed/source/services/auth/node_modules/serverless/lib/serverless.js:38:13)
      at Serverless.eventuallyFallbackToLocal (/usr/local/lib/node_modules/serverless/lib/Serverless.js:254:29)
      at Serverless.init (/usr/local/lib/node_modules/serverless/lib/Serverless.js:201:16)
      at /usr/local/lib/node_modules/serverless/scripts/serverless.js:585:24
It always worked, I never made changes (last deploy was on 14 december). This is UserStoragePolicy:
Copy code
UserStoragePolicy:
      Type: AWS::IAM::ManagedPolicy
      Properties:
        Description: "Policy for creating a test database"
        PolicyDocument:
          Version: '2012-10-17'
          Statement:
            - Action:
                - s3:GetObject
                - s3:PutObject
                - s3:DeleteObject
              Resource:
                - arn:aws:s3:::${self:custom.userStorageBucketName}/public/*
                - !Join
                  - ''
                  - - 'arn:aws:s3:::'
                    - ${self:custom.userStorageBucketName}
                    - '/protected/${<http://cognito-identity.amazonaws.com:sub|cognito-identity.amazonaws.com:sub>'
                    - '}/*'
                - !Join
                  - ''
                  - - 'arn:aws:s3:::'
                    - ${self:custom.userStorageBucketName}
                    - '/private/${<http://cognito-identity.amazonaws.com:sub|cognito-identity.amazonaws.com:sub>'
                    - '}/*'
j
Experiment with the resource strings. They do look a little convoluted. Maybe "!Sub" with the long string would be equivalent?
g
Yes now I try but it I would understand what seetting changed, because It always works.
solved: before_build: - npm install -g serverless@latest