I ran into this error while running the AWS Lambda CLI for the first time:
aws lambda create-function \
--region us-east-1 \
--zip-file fileb://ProcessDynamoDBStream.js.zip \
--handler ProcessDynamoDBStream.lambda_handler \
--runtime nodejs \
A client error (AccessDeniedException) occurred when calling the CreateFunction operation: User: arn:aws:iam::<XXX>:user/<YYY> is not authorized to perform: iam:PassRole on resource: arn:aws:iam::<XXX>:role/<YYY>
When you run the
create-function script, your machine creates resources that the PowerUser IAM role does not supply. To fix this, create a new policy and attach it to your machine’s IAM user.
Run the script again and you should be fine.
If you follow the NodeJS Docker tutorial, you’ll probably end up seeing this error if you don’t know exactly what you’re doing:
curl: (7) Failed to connect to localhost port 49160: Connection refused
The error occurs because OS X Docker runs a VM layer, which in turn contains the Docker containers. Any references you see to
localhost when running
docker commands is relative to the VM layer, not your OS X machine.
So to fix this, instead of navigating to
localhost:<port>, you need to navigate to the IP that points to your Docker VM.
The URL for your default machine (if you’re following along with the tutorial) should look like:
So to access your container, you combine the two to end up with a URL like:
Navigate to that in your browser, or use curl:
curl -i http://192.168.99.2376:49160
and you should see your result, and be able to continue on with the tutorial.
docker rmi <image name> will fail if the image is currently running inside one of your active Docker containers. The command will fail on the first container it sees, so if you’ve managed to start up a handful of them it can be a tedious process to
docker stop <containerID> and
docker rm <containerID> each one, re-running to find the next failing container.
This command will stop and remove all Docker containers (not scoped to a single image name though).
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
Step 1: Back up your existing HDD to an external HDD using the OS X Time Machine utility.
Step 2: Buy a new SSD. The Samsung 250GB SSD is a great choice for the price.
Step 3: Install the SSD
Step 4: Use Time Machine to install the HDD backup to your SSD
Step 5: Go fast!