ipfs / infra

Tools and systems for the IPFS community

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Host npm-on-ipfs EC2 instance & S3 bucket in the same AWS region

achingbrain opened this issue · comments

The EC2 instance being used by npm-on-ipfs is hosted in eu-west-2 but the S3 bucket it's using is in us-west-1. Because it's using datastore-s3 to persist it's IPFS repo, this causes increased latency making everything slower.

These need to be hosted in the same region.

I'm seeing the instance and the bucket in eu-west-2 region

$ aws ec2 --region eu-west-2 describe-instances | jq '.Reservations[].Instances[].Tags[] | select(.Key == "Name") | .Value'
"npm-on-ipfs"
$ aws s3api get-bucket-location --bucket npm-on-ipfs | jq .LocationConstraint
"eu-west-2"

I've made a new private repo to track the infra resources for this & gave the instance a role that has access to the S3 bucket. You will have to update anywhere you manually set a key id and secret to allow for the sdk to go get credentials on the instance role automagically.

@achingbrain I noticed that your using the VM's IP to configure the service but it's not assigned a static IP. I made an issue here for that work and hope to get to it this coming week.

Closing this now but reopen or make another ticket if you continue to see issues