Skip to content

Commit 757dbe8

Browse files
[update] ssm - get value parameter store with hint
1 parent bb76311 commit 757dbe8

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

common/peco.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,14 @@ peco_aws_ec2_list() {
192192
commandline="aws ec2 describe-instances --filters Name=instance-state-name,Values=running --query 'Reservations[].Instances[].{Name: Tags[?Key==\`Name\`].Value | [0],InstanceId:InstanceId}' --output text | tr -s '\t' '_'"
193193
peco_commandline_input ${commandline} 'true'
194194
}
195+
196+
peco_aws_ssm_list_parameters() {
197+
commandline=" \
198+
aws ssm get-parameters-by-path \
199+
--path "/" \
200+
--recursive \
201+
--query 'Parameters[*].Name' \
202+
| jq -r '.[]'
203+
"
204+
peco_commandline_input ${commandline} 'true'
205+
}

services/ssm.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ aws_ssm_list_parameters() {
1111
"
1212
}
1313

14+
aws_ssm_get_value_parameter_with_hint() {
15+
parameter_name=$(peco_create_menu 'peco_aws_ssm_list_parameters' '--prompt "Choose Parameter Name >"')
16+
aws_run_commandline "aws ssm get-parameter --name $parameter_name --with-decryption --query 'Parameter.Value' --output text"
17+
}
18+
1419
aws_ssm_connection_ec2() {
1520
aws_ec2_instance_id=$1
1621
aws_commandline_logging "\

0 commit comments

Comments
 (0)