AWS Cloud9은 브라우저만으로 코드를 작성, 실행 및 디버깅할 수 있는 클라우드 기반 IDE(통합 개발 환경)입니다. 코드 편집기, 디버거 및 터미널이 포함되어 있습니다. 본 워크샵에서는 편집 및 터미널 사용을 위해 AWS Cloud9 을 사용합니다.
AWS -> Cloud9 -> Name 입력.
Configure -> OS 선택 및 VPC 설정 ( 이 글은 Amazon Linux 를 사용 )
zsh & oh-my-zsh 설치 : 보다 편한 Terminal 사용을 위해 zsh 과 oh my zsh 을 설치.
### Cloud9 환경에서 su 명령을 이용해 bash 로 변경. 유저는 선택사항입니다.ec2-user:~/environment $ sudo-i[root@ip-172-31-8-195]~# su - ec2-user[ec2-user@ip-172-31-8-195]~% ### zsh 설치[ec2-user@ip-172-31-8-195]~% sudo yum install zsh Complete!### ec2-user password 설정.[ec2-user@ip-172-31-8-195]~% sudo -i[root@ip-172-31-8-195 ~]# passwd ec2-user ...passwd:allauthenticationtokensupdatedsuccessfully.### bash 에서 zsh 로 shell 변경[root@ip-172-31-8-195 ~]# exitlogout[ec2-user@ip-172-31-8-195]~% $ which zsh/bin/zsh[ec2-user@ip-172-31-8-195]~% $ chsh -s /bin/zshChangingshellforec2-user.Password:Shellchanged.[ec2-user@ip-172-31-8-195]~% echo $SHELL ### shell 변경 확인./bin/zsh### Oh my zsh 설치[ec2-user@ip-172-31-8-195]~% curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
%Total%Received%XferdAverageSpeedTimeTimeTimeCurrentDloadUploadTotalSpentLeftSpeed00000000--:--:----:--:----:--:--01008445100844500127760--:--:----:--:----:--:--37202.....________//_____________________//_/__ \/ __ \ /__`__ \/ ////_//___/__ \/ /_////////////_////_(__ ) ///\____/_//_//_//_//_/\__,//___/____/_//_//____/....isnowinstalled!Pleaselookoverthe~/.zshrcfiletoselectplugins,themes,andoptions.p.s.Followusonhttps://twitter.com/ohmyzshp.p.s.Getstickers,shirts,andcoffeemugsathttps://shop.planetargon.com/collections/oh-my-zshRunzshtotryitout.
oh my zsh 의 테마 는 개인 선호도에 따라 선택하면 되지만,
적절한 컬러, Git branch, commit 확인이 되는 테마를 고르는게 좋습니다. 저는 ys 를 선호합니다.
[ec2-user@ip-172-31-8-195]~% sudo vim ~/.zshrc### in ~/.zshrcZSH_THEME="ys"## THEME 변경 후 터미널 재실행# ec2-user @ ip-172-31-8-195 in ~ [19:43:14] $### 터미널 재실행### ~/.oh-my-zsh/lib/key-bindings.zsh 에서 echoti smkx 주석처리### 해당 부분을 주석처리 하지 아니하면, 스크롤이 오동작하는 버그가 있습니다.
Node 설정 구성, 몇가지 툴 설치를 위해 노드환경을 구성합니다. c9 설치를 위함이고, c9 은 c9 open "filename" 을 통해 Cloud9 기존 editor 인 ace 의 CLI 도구입니다.
# ec2-user @ ip-172-31-8-195 in ~ [19:43:14] $curl-o-https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh|bash# ec2-user @ ip-172-31-8-195 in ~ [19:50:03] $.~/.nvm/nvm.sh# ec2-user @ ip-172-31-8-195 in ~ [19:50:26] $npminstall-gc9/home/ec2-user/.nvm/versions/node/v10.20.1/bin/c9 -> /home/ec2-user/.nvm/versions/node/v10.20.1/lib/node_modules/c9/bin/c9
+c9@3.1.3534added1packagefrom2contributorsin2.878s### c9 명령어의 symlink를 추천드립니다.sudoln-s/home/ec2-user/.nvm/versions/node/v10.20.1/bin/c9/usr/bin/c9
aws credential 설정 ( Disable managed temporary credential )
AWS managed temporary credentilas 를 선택하면, iam role 을 사용하고 Disable 하면 직접 입력.
git config 설정 , core editor 은 생략! ( credential , coreeditor 변경 )