Comments (4)
@danifbento It will be helpful to see your serverless.yml file as well as Dockerfile or Docker image.
from aws-utils.
Thanks.
My serverless.yml is the following:
service: tests
provider:
name: aws
stage: dev
region: eu-central-1
runtime: nodejs8.1
profile: default
deploymentBucket: serverless.deploys
plugins:
- serverless-appsync-plugin
- serverless-appsync-offline
- serverless-offline-sns
- serverless-offline
custom:
serverless-offline:
host: 0.0.0.0
serverless-offline-sns:
port: 4002
debug: false
appsync-offline:
port: 62222
dynamodb:
server:
port: 8000
inMemory: false
seed: true
sharedDb: true
region: eu-central-1
clientId: <clientID>
appSync:
name: deploy_test
authenticationType: AMAZON_COGNITO_USER_POOLS
userPoolConfig:
awsRegion: eu-central-1
defaultAction: ALLOW
userPoolId: <poolId>
schema: schema.graphql
mappingTemplatesLocation: ./
mappingTemplates:
- dataSource: get_user
type: Invite
field: inviter
request: resolver/request-mapping-template.json
response: resolver/response-mapping-template.json
dataSources:
- type: AWS_LAMBDA
name: get_user
description: 'Get User'
config:
lambdaFunctionArn: arn:aws:lambda:${self:custom.region}:${self:custom.clientId}:function:fn-py-getuser
functionName: getuser
functions:
getuser:
handler: getuser/handler.getuser
timeout: 10
runtime: python3.6
resources:
Resources:
(...)
And Dockerfile:
FROM ubuntu:18.04
ARG aws_access_key_id
ARG aws_secret_access_key
ENV GOPATH=/py-useraccount-tests
ENV GOBIN=$GOPATH/bin
ENV PATH=/root/.npm_packages/bin:$PATH
ENV NODE_PATH=/root/.npm_packages/lib/node_modules:$NODE_PATH
RUN \
apt-get update && \
apt-get install -y make git curl && \
apt-get install -y python3 python3-pip && \
apt-get install -y golang && \
apt-get install -y npm && \
apt-get install -y openssh-server zip && \
apt-get install -y default-jre
RUN \
pip3 install boto3
RUN \
curl -sL https://deb.nodesource.com/setup_11.x | bash - && \
apt-get install -y nodejs
RUN apt -y autoremove
RUN \
go get -u github.com/aws/aws-lambda-go/lambda && \
go get -u github.com/golang/dep/cmd/dep
COPY package.json /py-tests
RUN pip3 install aws-sam-cli jwt
RUN npm config set prefix /root/.npm_packages
RUN npm install -g try-thread-sleep@latest
RUN npm install -g serverless@latest --ignore-script spawn-sync
RUN npm install -g serverless-appsync-offline@latest --ignore-script spawn-sync
RUN npm install -g serverless-appsync-plugin@latest
RUN npm install -g serverless-offline@latest
RUN npm install -g serverless-offline-sns@latest
RUN npm install -g just-api --unsafe-perm=true --allow-root
RUN npm install -g aws-appsync
RUN npm install -g aws-sdk
RUN cd /root/.npm_packages/lib/node_modules/serverless-appsync-offline/node_modules/graphql-phone-type/ && npm install && npm run prepare
RUN mkdir /root/.npm_packages/lib/node_modules/serverless-appsync-offline/node_modules/\@conduitvc/dynamodb-emulator/emulator && cd /root/.npm_packages/lib/node_modules/serverless-appsync-offline/node_modules/\@conduitvc/dynamodb-emulator/ && npm run install
WORKDIR "/py-tests"
COPY . /py-tests
RUN sls config credentials --provider aws --key "$aws_access_key_id" --secret "$aws_secret_access_key"
EXPOSE 62222 8000
CMD ["sls", "offline", "start"]
from aws-utils.
@danifbento after a quick skim, everything seems to look ok. I'm using this inside Docker as well, however, using docker-compose and have a separate container for DynamoDB. Any reason why that isn't an option for you?
from aws-utils.
Hello @pianomansam
Sorry for the late response. I started using in a separated container with docker-compose and it start to work. But now I have an error starting AppSync emulator saying ERROR on aws_auth
saying that is not defined. The project is in a container, but it works on my PC but not in another ...
from aws-utils.
Related Issues (20)
- Cannot find function config for function : undefined HOT 1
- Failure trying to run tests HOT 3
- ValueMapper: JavaString HOT 2
- Feature request: Aurora (RDS) Serverless support HOT 1
- AppSync Emulator - Support Condition Expressions
- AppSync Emulator - Support $context.stash
- appsync emulator resultItems mapping template example does not work in AWS
- [appsync-emulator-serverless] Does not respect multiple appsSync API's in config HOT 2
- AppSync Emulator - Support RegEx in string split
- Cannot Install on Windows HOT 1
- [appsync-emulator-serverless] Conflicting peer dependencies
- Bug with getting PID by port HOT 9
- Lambda datasource docker HOT 12
- Emulator does not throw error when AppSync does
- AppSync Emulator - AWSEmail and AWSURL HOT 1
- Incorrect string equality in VTL templates HOT 1
- Unable to Invoke lambda function HOT 2
- Mismatch between AWSJSON and AppSync
- Assertions within createSchema method prevent DynamoDB from being null HOT 1
- Incorrect $util.isNullOrEmpty check in appsynce-emulator HOT 3
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 aws-utils.