Coder Social home page Coder Social logo

Comments (8)

DyfanJones avatar DyfanJones commented on September 18, 2024

Hi @rabalasubramani3 I am not familiar with local stack. Do you have an example for how another sdk works with it (if possible boto3)? I can then use that as a template to address the issue 😁

from paws.

DyfanJones avatar DyfanJones commented on September 18, 2024

It looks like you only need to change the endpoint (correct me if I am wrong). So it should work similar to how we can connect to minio s3.

from paws.

DyfanJones avatar DyfanJones commented on September 18, 2024

I will see if I can get it spun up on my local computer and update the ticket accordingly :)

from paws.

rabalasubramani3 avatar rabalasubramani3 commented on September 18, 2024

I tried various versions of these.. i.e tryied different endpoint

s3 <- paws::s3(
config = list(
credentials = list(
creds = list(
access_key_id = "foo",
secret_access_key = "bar"
)
),
endpoint='http://s3.localhost.localstack.cloud:4566',
region='us-east-1'

Here is my localstack docker-compose.yml

localstack:
image: localstack/localstack:2.0.0
container_name: sagpro_localstack
environment:
- AWS_DEFAULT_REGION=us-east-1
- DOCKER_HOST=unix:///var/run/docker.sock
- AWS_ACCESS_KEY_ID=foo
- AWS_SECRET_ACCESS_KEY=bar
ports:
- "127.0.0.1:4566:4566" # LocalStack Gateway
- "127.0.0.1:4510-4559:4510-4559" # external services port range
volumes:
- sagpro_localstack_volume:/var/lib/localstack
- /var/run/docker.sock:/var/run/docker.sock
networks:
- sagpro-net

from paws.

rabalasubramani3 avatar rabalasubramani3 commented on September 18, 2024

Hi @rabalasubramani3 I am not familiar with local stack. Do you have an example for how another sdk works with it (if possible boto3)? I can then use that as a template to address the issue 😁

localstack allows you to mimic AWS setup locally.

https://www.localstack.cloud/

boto3
AWS_LOCALSTACK_ENDPOINT_URL = 'http://localhost:4566'
AWS_ACCESS_KEY_ID ='foo'
AWS_SECRET_ACCESS_KEY = 'bar'
AWS_DEFAULT_REGION = 'us-east-1'

def get_local_storage_client():
client = boto3.client('s3',
endpoint_url=AWS_LOCALSTACK_ENDPOINT_URL,
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
region_name=AWS_DEFAULT_REGION,
config=Config(s3={'addressing_style': 'path'})
)

from paws.

rabalasubramani3 avatar rabalasubramani3 commented on September 18, 2024

Got it working now.

s3 <- paws::s3(
config = list(
credentials = list(
creds = list(
access_key_id = "foo",
secret_access_key = "bar"
)
),
endpoint='http://localstack:4566',
region='us-east-1'
)
)

within "localstack" R-studio and localstack all sitting in same network.

from paws.

DyfanJones avatar DyfanJones commented on September 18, 2024

For completeness you can set all your login details in the aws configs. So for example:

.aws/credentials

[localstack]
aws_access_key_id=youraccesskey
aws_secret_access_key=yoursecretkey

.aws/config

[profile localstack]
region=us-east-1
output=json
services = localstack

[services localstack]
s3 = 
 endpoint_url = http://localstack:4566/
library(paws)

client <- s3(config(credentials(profile ="localstack")))

from paws.

DyfanJones avatar DyfanJones commented on September 18, 2024

Closing this ticket

from paws.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.