Installing AWS Command Line Interface clients on OS X

‘Installing the AWS CLI, AWS Elastic Beanstalk, and AWS Cloud Development Kit clients’

AWS command line interface clients are available for use on OS X. This post describes using Homebrew on macOS Catalina version 10.15.1 to install:

AWS Command Line Interface (AWS CLI)

brew install awscli  

AWS Elastic Beanstalk Command Line Interface (EB CLI)

brew install awsebcli  

AWS Cloud Development Kit Command Line Interface

brew install aws-cdk  

Resolving CDK Runtime Error with Node v13.2.0

If CDK is installed with Node v13.2.0 an error occurs when running CDK.

(.env) √ ~/workspace/hello-cdk % cdk ls                                                     (master)hello-cdk  
internal/fs/utils.js:220  
    throw err;  
    ^  

Error: EAGAIN: resource temporarily unavailable, read
    at Object.readSync (fs.js:516:3)  
    at SyncStdio.readLine (/Users/gareth/workspace/hello-cdk/.env/lib/python3.7/site-packages/jsii/_embedded/jsii/jsii-runtime.js:13322:25)  

... [output truncated]  

More details on the issue can be found on GitHub aws/aws-aws here.

To resolve the issue, roll back Node to an earlier version. In my case Homebrew installs Node as dependency of the AWS CDK CLI so I use Homebrew to roll back to an earlier major version of Node. (Homebrew does not allow rollback of minor versions for Node.)

# search for Node packages with...  
brew search node  
# install earlier version, in my case v12  
brew install node@12  
# unlink references to node@13  
brew unlink node  
# link to node@12  (which in my case require --force and --overwrite)
brew link --force --overwrite node@12  
# check Node version is rolled back  
node --version  

More details in AskDifferent How do I downgrade node or install a specific previous version using homebrew?

Postscript: Moving to zsh

If you are wondering about:

(.env) √ ~/workspace/hello-cdk % cdk ls                                                     (master)hello-cdk  

I’m running macOS Catalina version 10.15.1, and running zsh as my shell. Armin Briegel has an excellent set of posts on Moving to zsh on his #! Scripting OS X blog. I used the Moving to zsh, part 6 – Customizing the zsh Prompt guide to enable features within my zsh, including:

  • Git Integration
  • Right Sided Prompt
  • Dynamic Prompt

The Git Integration and Right Sided Prompt result in (master)hello-cdk being display on the righthand side of the prompt showing the directory that I’m in, hello-cdk, and the git branch that I’m on, master.

Avatar
Gareth Digby
Curriculum Developer

A blog by a Mac User.

Related