Skip to content

Commit 4ccf6f6

Browse files
authored
Merge pull request #12 from lamhaison/develop
Upgrade document and add the fnction aws_events_enable_rule
2 parents f62d1c5 + 39094e0 commit 4ccf6f6

File tree

4 files changed

+43
-7
lines changed

4 files changed

+43
-7
lines changed

README.md

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ echo "random_string" > ~/.password_assume_role_encrypted
4949
## Settings when open terminal (I am using iterm)
5050
```
5151
mkdir -p /opt/lamhaison-tools && cd /opt/lamhaison-tools
52+
53+
# Install helpful-commandlines
54+
git clone [email protected]:lamhaison/helpful-commandlines.git
55+
echo "source /opt/lamhaison-tools/helpful-commandlines/main.sh" >> ~/.bashrc
56+
57+
# Install aws-cli-utils commandlines
5258
git clone https://github.com/lamhaison/helpful-commandlines.git
5359
echo "source /opt/lamhaison-tools/aws-cli-utils/main.sh" >> ~/.bashrc
5460
```
@@ -101,19 +107,35 @@ aws_secret_access_key=yyyyxxxxyyyy
101107
## How to use
102108
### AssumeRole
103109
```
104-
Hotkey: Ctrl + @ and press enter and choose the assume role that you want to use.
105-
Enter functionname: aws_assume_role_set_name_with_hint
106-
110+
Hotkey (US keyboard layout) : Ctrl + @ (number 2) and press enter and choose the assume role that you want to use.
111+
Typing function_name: aws_assume_role_set_name_with_hint
107112
```
108113
### List all functions
109114
```
110-
aws_help
115+
Hotkey (US keyboard layout): Ctrl + h and you can search the funtion and enter to chose which commandline you want to run or edit before running.
116+
Typing function_name: aws_help (You only search the name function, can not select or edit funtion directly on console).
111117
```
112118
You can search list function and after that you can run which `funtion_name` to get the detail of bashshell code.
113119

120+
* You can search by a keyword
121+
![image](./images/aws_help_search_menu.png)
122+
123+
* You can search by multi keywords with space seperately. Thank for Peco feature. It is pretty helplful.
124+
![image](./images/aws_help_search_menu_keyword_seperated.png)
125+
126+
127+
128+
129+
### List history and select the commandline that you want to re-run
130+
```
131+
Hotkey (US keyboard layout): Ctrl + r and you can search the history commandlines and enter to chose which commandline you want to run or edit before running.
132+
```
133+
134+
114135
### Other
115136
```
116-
admin@MacBook-Pro-cua-Admin ~ % aws_assume_role_set_name PROFILE_NAME-dev
137+
source ~/.bashrc
138+
aws_assume_role_set_name PROFILE_NAME-dev
117139
You set the assume role name PROFILE_NAME-dev
118140
Running assume-role PROFILE_NAME-dev
119141
MFA code: 165933
@@ -133,8 +155,8 @@ admin@MacBook-Pro-cua-Admin aws_cli_results % aws_ec2_list
133155
+---------------------+---------------------------------+---------------+----------------+-----------+
134156
| InstanceId | Name | PrivateIp | PublicIp | State |
135157
+---------------------+---------------------------------+---------------+----------------+-----------+
136-
| i-0512340c9dc5fb531| demo-dev-jenkins-master | x.x.x.x | 1.123.123.123 | running |
137-
| i-0712343f1a9565397| demo-dev-mongodb-master | y.y.y.y | 1.123.123.123 | running |
158+
| i-0512340c9dc5fb123| demo-dev-jenkins-master | x.x.x.x | 1.123.123.123 | running |
159+
| i-0712343f1a9565456| demo-dev-mongodb-master | y.y.y.y | 1.123.123.123 | running |
138160
+---------------------+---------------------------------+---------------+----------------+-----------+
139161
```
140162

images/aws_help_search_menu.png

131 KB
Loading
38 KB
Loading

services/aws_events.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,17 @@ aws_events_disable_rule() {
3030
aws events describe-rule --name $1
3131

3232
}
33+
34+
aws_events_enable_rule() {
35+
36+
set -e
37+
set -x
38+
rule_name=$1
39+
40+
aws_account_info
41+
echo "Disable rule ${rule_name}"
42+
aws events describe-rule --name $1
43+
aws events enable-rule --name $1
44+
aws events describe-rule --name $1
45+
46+
}

0 commit comments

Comments
 (0)