LoginSignup
0
0

More than 5 years have passed since last update.

AWS CLIのインストールから始める色々

Last updated at Posted at 2017-11-21

まずはインストール

基本的には上記なのだが、root権限じゃなくても可能。

$curl -O https://bootstrap.pypa.io/get-pip.py
$python get-pip.py --user
$pip --version
pip 9.0.1 from /home/appluser/.local/lib/python2.7/site-packages (python 2.7)
$export PATH=~/.local/bin:$PATH
$source ~/.bash_profile
$pip install awscli --upgrade --user
$aws --version
aws-cli/1.11.189 Python/2.7.5 Linux/3.10.0-514.26.2.el7.x86_64 botocore/1.7.47

でインストール

コンフィグ設定

$ aws configure
AWS Access Key ID [None]:
AWS Secret Access Key [None]:
Default region name [ap-northeast-1]:
Default output format [text]:

IAMを正しく設定できていない場合は、KeyIDとAccessKeyの設定が必要
東京リージョンの場合はap-northeast-1

設定確認

$ cd ~/.aws
$ cat config
[default]
output = text
region = ap-northeast-1

DynamoDBへの投稿

$ aws dynamodb put-item --table-name xxxxxxx \
--item     '{"id": {"N": "2"}, "count": {"S": "1000"}}' ;

ここで、複雑なJSONを構築しようとすると、JSONのスキーマチェックがないとやってられないことにきづく。
続く。

0
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
0
0