BeerMoneyDev / nest-aws-sdk

A thin wrapping layer around the aws-sdk package for clean NestJS dependency injection.
MIT License
92 stars 13 forks source link

Localstack integration #10

Closed nicpolhamus closed 2 years ago

nicpolhamus commented 3 years ago

Hello,

I'm working on a project that uses nestjs and AWS. I'm using a local docker env for testing purposes, and integrated localstack for mock AWS services. I'm trying to test my S3 upload endpoint, but I'm running into this error

{
  "message": "The AWS Access Key Id you provided does not exist in our records.",
  "code": "InvalidAccessKeyId",
  "region": null,
  "time": "2021-03-23T00:39:42.197Z",
  "requestId": "CMT86DJGVXXX7MGQ",
  "extendedRequestId": "jMRAxzV8qtOS4P9K3oPvmRVWlRq/BxfwmV9pqU1ibLamw5Zg0kFFQU0qb7wMPNHLMowAAraDybk=",
  "statusCode": 403,
  "retryable": false,
  "retryDelay": 194.45416846536867
}

I've followed the localstack setup docs to get my localstack setup appropriately, so I'm not sure why my access key is giving me problems. Any suggestions?

Just for posterity, here is my docker-compose.yml

version: "3.8"

services:
  db:
    image: mysql:latest
    env_file: ./env/test.db.env
    expose: 
      - 3306
    ports:
      - "3306:3306"
  localstack:
    image: localstack/localstack:latest
    expose:
      - 4566
    ports:
      - "4563-4599:4563-4599"
    environment: 
      - SERVICES=s3
      - DEBUG=1
      - DATA_DIR=/tmp/localstack/data
    volumes:
     - ./localstack:/tmp/localstack
     - /var/run/docker.sock:/var/run/docker.sock

Much appreciated!

KerryRitter commented 2 years ago

I assume this is no longer a relevant issue :)