rails-lambda / lamby-cookiecutter

🐑🛤 AWS SAM Cookiecutter to Quick Start Rails & Lambda
https://lamby.cloud/docs/quick_start
37 stars 18 forks source link

Fix Deploys for Mac Users #13

Closed metaskills closed 3 years ago

metaskills commented 3 years ago

For this Lamby starter we support deploys from the host machine by leveraging AWS_PROFILE and passing that thru the dev container. Based on work done previously #11 we did some work to ensure a lamby user was in place for Linux which matched the hosts UID/GID. For Mac we set these to zero so that the root user could still be used. Since we share the ~/.aws directory for the dev/build container, this caused a problem on Mac only because $HOME was still /root since the first user matching the lamby user set in the compose file was that user. In order to keep all these plates spinning, local dev with Mac, Linux, project deploys from both, and CD which is typically linux the simplest way to fix Mac was to be explicit about the $HOME directory so when the AWS CLI and AWS SAM CLI are used it works correctly.