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

Declaration error for all declared variable. #4013

Closed
gandhi-jay opened this issue Jul 30, 2017 · 3 comments
Closed

Declaration error for all declared variable. #4013

gandhi-jay opened this issue Jul 30, 2017 · 3 comments

Comments

@gandhi-jay
Copy link

Description

For bug reports:

  • What went wrong?
    Getting error valid service attribute to satisfy declaration could not be found for all declaration. I don't know whether it's bug or mistake from my side.

  • What was the config you used?
    demo of my config file.

service: MyService
details:
  deploymentBucket: s3_my_bucket

provider:
  name:aws
  deploymentBucket: ${self:details.deploymentBucket}
  stage: dev
  • What stacktrace or error message from your provider did you see?
    A valid service attribute to satisfy the declaration 'self:details.deploymentBucket' could not be found.

Additional Data

  • Serverless Framework Version you're using: 1.18.1
  • Operating System: Ubuntu 16.04
@horike37
Copy link
Member

horike37 commented Jul 30, 2017

@gandhi-jay

details section can not be defined on the top level. You can use custom section to do what you want. Here is the document for this and example as follow.
https://serverless.com/framework/docs/providers/aws/guide/variables/

service: MyService
custom:
  deploymentBucket: s3_my_bucket

provider:
  name: aws
  deploymentBucket: ${self:custom.deploymentBucket}
  stage: dev

Could you try again?

@gandhi-jay
Copy link
Author

@horike37 Works fine. Thank you.

@pmuens
Copy link
Contributor

pmuens commented Jul 30, 2017

Thanks for lending a helping hand here @horike37 🙌

Glad to hear that this resolves your problem @gandhi-jay 👍

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

No branches or pull requests

3 participants