刺身タンポポ職人なう

文系女子大生がエンジニアとして就職してその後

aws cli profile

profileしてアクセスする先を分類する

$ aws —profile ${好きな名前} configure
AWS Access Key ID [None]: xxxxxxxxxx
AWS Secret Access Key [None]: xxxxxxxxxx
Default region name [None]: ap-northeast-1
Default output format [None]: 

Access Key、Secret Access KeyはAWSアカウントのアクセスキーの設定 (IAMでユーザー作成してもらう際に生成される)

中の見方

$ aws —profile ${好きな名前} s3 ls hedgehog

awsの設定ファイルの場所

$ ~/.aws/cledentials

S3のログファイルからgrepして5xxエラーを抽出するみたいなコマンド

$ aws —profile ${好きな名前} s3 ls s3://hoge | grep '20151021T04' | awk '{print $4}' | xargs -I {} aws s3 cp s3://hoge{} - | egrep ' 50[0-9] '