Comments (4)
@ivanbarlog What is the command you are running when you hit this error?
from serverless-resources-env.
@ivanbarlog Also, just noticed you are using webpack. Might be this issue here?
#10
Seems a directory changes during pre-build and post-build.
from serverless-resources-env.
Hi @rurri I am running into this problem after sls deploy
. I've tried to sls remove
it before running sls deploy
but the result was the same.
Finally I've resolved my issue by using another way of "importing" CloudFormation data into my ENV variables which is described in the link above. Before I was trying to use it with no luck because I was exporting the Output with its name and within ${cf: ... }
I was calling the exported name not the actual name of my resource like this:
service:
name: ${opt:name, 'sample'}
publish: false
plugins:
- serverless-appsync-plugin
- serverless-webpack
provider:
name: aws
runtime: nodejs8.10
region: eu-west-1
stage: ${opt:stage, 'dev'}
profile: ${opt:aws-profile, 'default-profile'}
environment:
# this here didn't worked
MY_VAR: ${cf:${self:service}-${self:provider.stage}.UserPoolId-${self:service}-${self:provider.stage}}
functions:
someFunction:
handler: handler.someHandler
resources:
CognitoUserPoolUserPool:
Type: AWS::Cognito::UserPool
Properties:
- someProperties
# ...
Outputs:
UserPoolId:
Value:
Ref: CognitoUserPoolUserPool
Export:
# in above ${cf: ... } I was using this name as identifier instead of Output identifier
Name: "UserPoolId-${self:service}-${self:provider.stage}"
So in this case I have resolved it by avoiding serverless-resources-env
plugin altogether using following as ${cf: ... }
identifier:
# ...
provider:
environment:
# this here didn't worked
MY_VAR: ${cf:${self:service}-${self:provider.stage}.UserPoolId}
# ...
The usage haven't really be clear for me after 100 times of reading the documentation and reading through GitHub issues whole day. Hopefully this issue helps someone in the future.
Also I don't think that this has anything to do with serverless-webpack
since I haven't been running invoke local
but I was trying to deploy the infrastructure.
Thanks for help anyway ;-)
from serverless-resources-env.
Well now I am confused.
I've removed my stack by sls remove
and after no changes whatsoever (yesterday it worked as charm) now I am getting Stack with id sample-dev does not exist
again. Well, I understand, that when I remove the stack it does not exist but how can I add the Cloud Formation ID to my ENV variables?
Do I need to comment that line of code, deploy my stack and then redeploy it after un-commenting that line?
That fortunately worked but I don't think that it is very practical. Any suggestions?
from serverless-resources-env.
Related Issues (12)
- Too many resources HOT 5
- invoke local doesn't see CF-variables when serverless-webpack plugin is used HOT 2
- Functions missing environment variables because they are not found in cloud Formation HOT 3
- Interpolation not evaluated from serverless.yaml
- Warning: Invalid configuration encountered (unrecognized property 'custom')
- After adding the serverless-resources-env plugin, I get an error about "missing region in config" HOT 3
- Invalid Client Token Id HOT 3
- Error deploying when environment is defined at function level HOT 1
- Get variables from CF output HOT 1
- Fetching CF Resources only fetches the first 100 resources HOT 1
- NPM release HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serverless-resources-env.