Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy wallet service serverless functions in AWS throws - Error: Cannot resolve serverless.yml #1775

Open
ssmtariq opened this issue Jul 10, 2023 · 0 comments

Comments

@ssmtariq
Copy link

I was trying to deploy serverless functions of the wallet service in AWS but ended up with the following exceptions.

The command used: sls deploy
The error produced

Environment: linux, node 14.21.3, framework 3.33.0, plugin 6.2.3, SDK 4.3.2
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

Error:
Cannot resolve serverless.yml: Variables resolution errored with:
  - Cannot resolve variable at "provider.region": Value not found at "file" source,
  - Cannot resolve variable at "functions.wallets.role": Value not found at "file" source,
  - Cannot resolve variable at "functions.wallets.tags.Environment": Value not found at "file" source,
  - Cannot resolve variable at "functions.wallets.tags.Team": Value not found at "file" source,
  - Cannot resolve variable at "functions.wallets.tags.Owner": Value not found at "file" source,
  - Cannot resolve variable at "functions.wallets.vpc.securityGroupIds.0": Value not found at "file" source,
  - Cannot resolve variable at "functions.wallets.vpc.securityGroupIds.1": Value not found at "file" source,
  - Cannot resolve variable at "functions.wallets.vpc.subnetIds.0": Value not found at "file" source,
  - Cannot resolve variable at "functions.wallets.vpc.subnetIds.1": Value not found at "file" source

It seems to be the config*.json file accessed as ${file(./config.. from the serverless.yml doesn't exist in the system. The serverless.yml file is provided below

plugins:
  - serverless-offline
  - serverless-python-requirements
  - serverless-plugin-tracing
  - serverless-prune-plugin
  - serverless-aws-documentation

service: wallets
custom:
  pythonRequirements:
    fileName: wallets/requirements.txt
    dockerizePip: true
    useDownloadCache: true
    useStaticCache: true
    cacheLocation: '/var/cache/serverless'
  prune:
    automatic: true
    includeLayers: true
    number: 2
provider:
  name: aws
  runtime: python3.7
  description: Dapp user service# optional, Description to publish to AWS
  memorySize: 128
  timeout: 30
  region: ${file(./config.${self:provider.stage}.json):REGION}
  stage: ${opt:stage,'dev'}
  deploymentBucket:
    name: snet-serverless-artifacts # Deployment bucket name. Default is generated by the framework
    serverSideEncryption: AES256 # when using server-side encryption
    tags: # Tags that will be added to each of the deployment resources
      key1: wallets
  deploymentPrefix: serverless
  versionFunctions

I cannot find any such file ./config*.json here. Can anyone please suggest how to fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant