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

How do I use LocalStack for .NET Core? #370

Closed
whummer opened this issue Oct 3, 2017 · 2 comments
Closed

How do I use LocalStack for .NET Core? #370

whummer opened this issue Oct 3, 2017 · 2 comments
Labels
type: feature New feature, or improvement to an existing feature type: question Please ask questions on discuss.localstack.cloud

Comments

@whummer
Copy link
Member

whummer commented Oct 3, 2017

Note: Copied over from https://bitbucket.org/atlassian/localstack/issues/59/how-do-i-use-localstack-for-net-core


NOT A BUG

I'm new to localstack and I did not know where to ask questions like this as I could not find any forum for localstack.

I'm facing difficulties in deploying my application developed in [.Net Core] using Visual Studio on localstack.

I'm trying to execute the samples provided with Visual Studio(Blogs and Hello) for learning.
Could you guys please provide me with the steps to execute my application on localstack?
Following are the details : 1). Runtime : dotnetcore1.0 2). OS : Windows 3). Application uses API Gateway which invokes lambda function developed in C# using .Net Core 1.0.

@whummer whummer added enhancement type: question Please ask questions on discuss.localstack.cloud labels Oct 3, 2017
@edenzz
Copy link

edenzz commented Sep 21, 2018

Can you please give some feedback here?


After some testing I was able to do it.
Steps were,

  1. I've ran localstack with docker using the following docker-compose:

version: '2.1'
services:
localstack:
image: localstack/localstack:latest
container_name: localstack
hostname: localstack
ports:
- "4567-4583:4567-4583"
- "${PORT_WEB_UI-8080}:${PORT_WEB_UI-8080}"
environment:
- SERVICES=${SERVICES- }
- DEBUG=${DEBUG- }
- DATA_DIR=${DATA_DIR- }
- PORT_WEB_UI=${PORT_WEB_UI- }
- LAMBDA_EXECUTOR=docker
- KINESIS_ERROR_PROBABILITY=${KINESIS_ERROR_PROBABILITY- }
- y=unix:///var/run/docker.sock
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /tmp/localstack:/tmp/localstack

  1. Then I've used the zip file in https://github.com/localstack/localstack/blob/master/tests/integration/lambdas/dotnetcore2/dotnetcore2.zip (which is in the local stack repo)

  2. After docker spins up I've run the following commands:

aws --endpoint-url=http://192.168.3.100:4574 lambda create-function --function-name=f1 --runtime=dotnetcore2.0 --role=r1 --handler=DotNetCore2::DotNetCore2.Lambda.Function::SimpleFunctionHandler --zip-file fileb://dotnetcore2.zip

aws lambda --endpoint-url=http://192.168.3.100:4574 invoke --function-name f1 result.log

Notes: My docker image was running under 192.168.3.100 ip (which is an Unix VM with docker, that's why the endpoint-url parameter value)


And it worked.

@whummer
Copy link
Member Author

whummer commented Mar 17, 2019

Closing this for housekeeping reasons. This should be resolved in the meantime. Please comment here if the problem persists. Thanks

@whummer whummer closed this as completed Mar 17, 2019
@alexrashed alexrashed added type: feature New feature, or improvement to an existing feature and removed type: enhancement labels Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature New feature, or improvement to an existing feature type: question Please ask questions on discuss.localstack.cloud
Projects
None yet
Development

No branches or pull requests

3 participants