Comments (28)
I had this problem today, too.
export AWS_ACCESS_KEY_ID=id_key
export AWS_SECRET_ACCESS_KEY=access_key
solved it on my OSX and Ubuntu 16.04 machines.
from serverless-graphql.
same issue here, I've checked that the relevant profile is mentioned in ~/.aws/config and ~/.aws/credentials
serverless-starter works, maybe theres something out of date here.
from serverless-graphql.
@ismarslomic yes, I had the aws cli installed beforehand and I probably used similar instructions when I configured the credentials. I have exactly same versions of python, serverless and os x installed.
from serverless-graphql.
I had the same problem.
I think 1 thing that helped was downloading a ZIP of the master
branch of this project and copying over all of the files -- it appears that the installation did not use the latest code -- and then I changed name
field in s-project.json
to your applicable project name. I now have it working. I also tried installing DynamoDB Local manually vs using docker-compose up
, however now they both work.
I spent a long time trying things to get this to work so at this point I am not even confident which 1 or so things ended up fixing it. However I think updating to the latest code definitely helped, if not being the actual solution.
Hope that helps!
I remember what fixed it! See #31 (comment)
So yes, the fix is to download and merge in a copy of the latest code on the master
branch which includes that fixes within Pull request #31.
from serverless-graphql.
Hey @Glavin001 ,
I tried the master branch but that didn't work out any better. I also checked out the pull request, doesn't seem that relevant. Thanks for the hint tho, I haven't followed the progress of this repository that much but It's evolving quite nicely.
I'm more concerned about backend-git/back/api/lib/dynamodb.js
which has the actual mentions on how to drive locally this is where the "credentials" are missing. as the sessionToken doesn't get validated by the local instance.
But as none other project's are currently using local dynamodb with sls offline capabilities I don't think theres an easy way to peek for the answer other than debugging :E, I guess it's off to using sls offline with a live table Β―_(γ)_/Β― until this gets resolved.
from serverless-graphql.
Hmm I'll try to figure out what I did to fix that issue. It was a long day last week, I remember that much.
from serverless-graphql.
@jesucarr @Glavin001 @Aciid How did you install the boilerplate? With sls project install serverless-graphql
or cloning the repo and running sls project init
? I haven't touched the admin.env
and it has my personal profile settings mapped for both stages that I've created, dev
when installing the project and tests
later with sls stage create
AWS_DEV_PROFILE=laardee
AWS_TESTS_PROFILE=laardee
(I have my AWS work profile as [default] and [laardee] for personal stuff)
from serverless-graphql.
@TomBarta this worked :3 thanks!
@laardee AWS_TESTS_PROFILE had no effect and I didn't have this after init ( wasn't asked for this in the config ) weird is this used for the offline then tho?
from serverless-graphql.
I had same issue as well. Exporting the two env variables as suggested by @TomBarta resolved the issue. I guess this is just an workaround, as credentials shall be retrieved from ~/.aws/credentials? If i is not an workaround, then documentation shall be updated
from serverless-graphql.
@Aciid, that "AWS_TESTS_PROFILE" profile is for "tests" stage that I used. If you haven't created a stage tests
there should not be such a profile. When you create a new stage with sls stage create
it appends new profile mapping to the admin.env
, so I don't think you need to manually change that file at all if you use serverless framework to create/init project.
from serverless-graphql.
I just can't reproduce this issue. I created new stage that uses different credentials and everything works ok. I haven't exported either work or personal credentials with
export AWS_ACCESS_KEY_ID=id_key
export AWS_SECRET_ACCESS_KEY=access_key
I logged credentials in setup db and it prints out correct ones for each stage.
Which OS / Serverless version / AWS CLI version are you using?
from serverless-graphql.
@laardee do you have aws cli installed and have you done profile configuration as described here http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html before installing serverless and creating new project? I have currently not installed aws cli, so that might be the issue?
from serverless-graphql.
Just to add another observation here: after exporting these two variables, admin.env doesnΒ΄t seem to be in use anymore. I opene admin.env and added an invalid value to AWS_DEV_PROFILE, but i still managed to run the function locally.
from serverless-graphql.
@laardee so if you run
echo $AWS_ACCESS_KEY_ID
you get blank? Sorry for being so straight, but I'm just trying verify that you are not using the credentials from "AWS-CLI" standpoint (which we have verified now working)
My serverless-graphql version is "version": "0.0.4",
AWS-CLI aws-cli/1.7.0 Python/2.7.10 Darwin/15.4.0
And yes os x.
from serverless-graphql.
I'm away from the keyboard for couple hours, I'll get back to this issue later today.
from serverless-graphql.
Making no commentary about this specific issue.
Given the credential loading questions here, you can review how that happens in this thread:
serverless/serverless#740
Note that in specifying a profile you can declare a general AWS_PROFILE for use in all stages or a stage specific AWS_[STAGE]_PROFILE.
A later PR added support for ~/.aws/config:
serverless/serverless#917
from serverless-graphql.
I have following setup:
- Python 2.7.10
- Serverless 0.5.5
- OS X El Capitan (10.11.5)
I do not have installed AWS CLI.
from serverless-graphql.
Ok, so then I guess installing AWS CLI shall be prerequisite for this project in order to run functions with local database? By the way, how did you install AWS CLI on Mac? by use of pip or bundle, or?
from serverless-graphql.
@ismarslomic with pip
from serverless-graphql.
@Aciid echo $AWS_ACCESS_KEY_ID
prints out empty line. I have little bit newer aws-cli installed aws-cli/1.10.24 Python/2.7.10 Darwin/15.5.0 botocore/1.4.15
, I just updated it about a week ago, but it worked with older version as well. I don't remember which was the version I had previously, but it was installed maybe a 6 months ago.
from serverless-graphql.
@laardee: I have now installed AWS CLI (aws-cli/1.10.28 Python/2.7.10 Darwin/15.5.0 botocore/1.4.19), but only installing AWS CLI didnt help on this credential issue. Only after running aws configure
I managed to run functions with local db successfully. However, executing echo $AWS_ACCESS_KEY_ID
still prints empty line.
from serverless-graphql.
@ismarslomic Everything works ok locally if credentials are set with aws configure
?
from serverless-graphql.
@laardee yes. Im though not sure how selection/creation of aws profile as part of serverless project create
impacts or interacts together with AWS CLI profile configuration. As mentioned previously, if I change AWS_DEV_PROFILE=222
(invalid profile name) in admin.env
, Im still able to successfully run the function locally.
from serverless-graphql.
There is some magic π© π. I can also successfully run the project if I have correct AWS_[STAGE]_PROFILE but with invalid value.
from serverless-graphql.
But, if you try to deploy your function with invalid value in admin.env
serverless will complain about unknown profile. So I guess that the aws profile mentioned in admin.env
is used mainly in AWS and not locally. Would be great to have someone from the serverless team to confirm our assumptions here and also update README so it is more clear.
from serverless-graphql.
@laardee I installed the boilerplate with sls project install serverless-graphql
. I have not installed the AWS CLI.
from serverless-graphql.
Was having issues reading AWS credentials on OSX after initiating a project, checked the admin.env variable and found that the AWS_DEV_PROFILE was in quotes while on my ubuntu machine it was not. Removed the quotes and suddenly credential reading worked like a charm.
from serverless-graphql.
There's an ongoing issue with aws-sdk-js here: aws/aws-sdk-js#692
from serverless-graphql.
Related Issues (20)
- An error occurred: GraphiqlLambdaFunction - Value of property Variables must be an object with String (or simple type) properties. HOT 1
- Use AppSync with Amazon RDS HOT 10
- Add aws Amplify Client HOT 1
- Unable to connect client to appsync api. HOT 3
- Fix missing query arg in apollo-client
- AppSync & RDS HOT 4
- Region AppSync <> DynamoDB HOT 1
- How does @aws_subscribe work in a Apollo + Lambda work?
- Error: only one instance of babel-polyfill is allowed HOT 8
- Appsync OPENID_CONNECT support? HOT 3
- Configuration for app-backend/appsync/dynamo? HOT 1
- Error: DynamoRole already exists HOT 1
- Migrate app-backend/rest-api to Apollo Server 2.0 HOT 4
- Bump babel/jest/webpack dependencies
- Playground is and graphiql loading with error HOT 1
- Request AppSync DataSource HTTP type
- Got error when run yarn install HOT 3
- Yarn start in `app-backend/dynamodb` does not start dynamodb on port 8000 HOT 1
- multiple @connection to same child table possible? HOT 1
- Batch mutations seem to create separate AWS Lambda invocations
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-graphql.