LoginSignup
2
0

More than 5 years have passed since last update.

AWS Systems Manager パラメータストアで設定したパラメータをawscliで取得する

Posted at
$ aws ssm get-parameters --names foo bar
{
    "InvalidParameters": [], 
    "Parameters": [
        {
            "Name": "foo", 
            "LastModifiedDate": 1543198303.726, 
            "Value": "fuga", 
            "Version": 1, 
            "Type": "String", 
            "ARN": "arn:aws:ssm:ap-northeast-1:11111111:parameter/foo"
        }, 
        {
            "Name": "bar", 
            "LastModifiedDate": 1543197464.381, 
            "Value": "hoge", 
            "Version": 1, 
            "Type": "String", 
            "ARN": "arn:aws:ssm:ap-northeast-1:11111111:parameter/bar"
        }
    ]
}

これで、fooとbarが取れる。
SecureStringの時は--with-decryptionのオプションを渡すと人間でも読めるようにしてくれます。
--qeuryjqを使っていい感じに使いやすいように整形するといいでしょう。

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