2
0

本記事で実現できること

CloudShell初期設定を行う

CloudShell事前確認

事前確認

リージョン選択で作業対象のリージョンが選択されていることを確認する
※別リージョンを選択していると、別リージョンにCloudFormationスタックが作成される
※CloudFormationスタックが正常に作成された際、
 リソースが想定の場所に作成されているか必ず確認する
【AWS-IAM】アカウント棚卸時に、新規参画者のアカウントを作成したい (1).png

CloudShell日本語化

日本語パックのインストール

title: 日本語パックインストール
sudo yum install glibc-langpack-ja

CloudShellはhomeディレクトリ以外は永続化されないので、
後述するbash_profileに記載が良さそう

bash_profile記載例

title: bash_profile記載例
Count=$(sudo yum list installed | grep -c glibc-langpack-ja)
if [ $Count -eq 0 ] ; then
        sudo yum install glibc-langpack-ja -y
fi

アカウント環境の設定

bash_profile編集

末尾に以下を追加

title: bash_profile編集
$ vi ~/.bash_profile
export LANG="ja_JP.utf8"
export LANGUAGE="ja_JP:ja"
export LC_ALL="ja_JP.utf8"
 
export TZ="Asia/Tokyo"

vim設定

末尾に以下を追加

title: vim設定
vi ~/.vimrc
:set encoding=utf-8
:set fileencodings=iso-2022-jp,euc-jp,sjis,utf-8

gitの日本語文字化け対応

リポジトリ内で以下のコマンドを実行

title: git設定
cd ~/<Gitリポジトリ名>
git config --local core.quotepath false

gitの初期設定

初期設定

title:一般的な設定
$ git config --global user.email "xxxxxxx@scsk.jp"
$ git config --global user.name "xxxxxxxx.yyyyyy"
$ git config --global push.default simple

CodeCommitのgitアカウント設定

CodeCommitのgitアカウント設定

title:アカウント設定
$ vi ~/.netrc
machine git-codecommit.ap-northeast-1.amazonaws.com
login w99999-at-nnnnnnnnnnn
password XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

gitのクローン

gitのクローン

title:gitのクローン
git clone https://git-codecommit.ap-northeast-1.amazonaws.com/v1/repos/<Gitリポジトリ名>

gitの最新取得

gitの最新取得

title:gitの最新取得
git pull --progress -v --no-rebase "origin"

まとめ

本稿が、CloudShell/Git 初期設定を行いたい方の参考になれば嬉しいです。

ITエンジニア向け、AWS資格取得を目指す方向けに個人ブログで記事も投稿していますので、
合わせて読んでもらえると嬉しいです。
ことなの学校(個人ブログ)

更によりレベル感の高そうなAWS関連の発信はZennの方で行います。
こちらももしよければフォロー、ご確認いただけると嬉しいです。
Zenn個人アカウント

Twitterでも役立つ情報を発信しますのでフォローしてもらえると嬉しいです
@tomo_ITBizBlog

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0