2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[初歩ミス]AWSのデータ作成時にはリージョンに気をつけよう

Last updated at Posted at 2019-04-02

概要

作成時のリージョンには気をつけようという戒め(?)です。
AWSにおいてGUIで作成したデータが、CUI(AWS CLI)で確認するとデータが無くて焦りました。
すごい初歩的なミスですがつまづいたので忘備録として。

解決策

それぞれのリージョンを確認してください。
リージョン…地域や用途に紐付いたAWSのデータセンターの集合。

GUIのリージョン

右上のバーに表示されているリージョンを確認する。
適切でなければプルダウンリストから選択する。
スクリーンショット 2019-04-02 22.55.15.png

CUIのリージョン

$ aws configure

のコマンドを入力して、Default region nameがGUIのリージョンと一致しているか確認する。
なっていなければ設定する。
東京はap-northeast-1です。
参考:AWS のリージョンとエンドポイント

スクリーンショット 2019-04-02 22.46.24.png

以上です。

試行錯誤歴

ここから先はあんまり読む価値ないです。笑
これをやっててつまづきました。
AWS Kinesis Data Streamでストリームを作成後、AWS cliに移動してリスト表示してみる。

$ aws kinesis list-streams
{
    "StreamNames": []
}

(あれー、なぜ何も無い?とりあえずput-recordしてみよう。。)

$ aws kinesis put-record --stream-name test-stream  --partition-key 123 --data testdata
An error occurred (ResourceNotFoundException) when calling the PutRecord operation: Stream test-stream under account 204418998910 not found.

(怒られた。。)

しばらくググって色々探してみると・・・リージョン怪しい?
でもCLIの設定ちゃんとしたしなぁ。。。ん?

スクリーンショット 2019-04-02 23.14.45.png

**バージニア北部??**どこやねんこれ

再作成するのも面倒なので、AWS CLIのコマンドオプション--reasionでバージニア北部を指定して実行。

$ aws --region us-east-1 kinesis list-streams
{
    "StreamNames": [
        "test-stream"
    ]
}

無事表示されました。

おしまい。

最後に

全然関係ないけどコマンドラインのキーバインド調べてたらこういうの見つけて便利でした。
テキスト入力が死ぬほどはかどるMacショートカットキー15個
メモ帳とかでも使える・・・知らなかった。

記事に間違いや不明点があれば遠慮なくご指摘ください。

2
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?