Skip to content

Commit 45dce23

Browse files
committed
[Add] - add function aws_resource_list to list all resources on aws
1 parent b3e70c5 commit 45dce23

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

services/other.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,22 @@ aws_datapipeline_check_using() {
1313
aws_autoscaling_lauching_configuration_list() {
1414
aws autoscaling describe-launch-configurations --query "*[].LaunchConfigurationName"
1515
}
16+
17+
aws_resource_list() {
18+
19+
aws_run_commandline "\
20+
aws resourcegroupstaggingapi get-resources
21+
"
22+
}
23+
24+
#
25+
# TODO aws_resource_list_by_tag_name to list all resource that have tag Name is
26+
# @param TODO The first parameter is the tag_name value
27+
# @return List resources that match the tag name which you pass to the function.
28+
#
29+
aws_resource_list_by_tag_name() {
30+
aws_run_commandline "\
31+
aws resourcegroupstaggingapi get-resources \
32+
--tag-filters 'Key=Name,Values=${1:?lhs_aws_resource_tag_name is unset or empty}'
33+
"
34+
}

0 commit comments

Comments
 (0)