Skip to content

Commit 058b6a3

Browse files
authored
Merge pull request #14 from lamhaison/develop
Develop
2 parents d07f3e7 + 0ddc5e7 commit 058b6a3

File tree

7 files changed

+67
-0
lines changed

7 files changed

+67
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,15 @@ You can search list function and after that you can run which `funtion_name` to
131131
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.
132132
```
133133

134+
### When you want to build a aws commandline
135+
```
136+
Hotkey (US keyboard layout): Option + ac
137+
```
138+
![image](./images/aws_get_command/step_1.png)
139+
![image](./images/aws_get_command/step_2.png)
140+
![image](./images/aws_get_command/step_3.png)
141+
![image](./images/aws_get_command/step_4.png)
142+
134143

135144
### Other
136145
```

images/aws_get_command/step_1.png

62.4 KB
Loading

images/aws_get_command/step_2.png

123 KB
Loading

images/aws_get_command/step_3.png

70 KB
Loading

images/aws_get_command/step_4.png

108 KB
Loading

services/medibaconvert.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
3+
###################################################################
4+
# # @version 1.0
5+
# # @script medibaconvert.sh
6+
# # @author lamhaison
7+
8+
# # @description List functions for working with mediaconvert aws service
9+
# # @bash_version None
10+
# # @notes None
11+
# # @usage Only use function in the script instead of bash medibaconvert.sh
12+
# # @date 20230326
13+
###################################################################
14+
15+
aws_mediaconvert_list_endpoints() {
16+
17+
aws_run_commandline "\
18+
aws mediaconvert describe-endpoints
19+
"
20+
21+
}
22+
23+
private_aws_mediaconvert_get_endpoint() {
24+
aws mediaconvert describe-endpoints --query '*[] | [0].Url' --output text
25+
}
26+
27+
aws_mediaconvert_list_jobs() {
28+
29+
local mediaconvert_endpoint=$(private_aws_mediaconvert_get_endpoint)
30+
31+
aws_run_commandline "\
32+
aws mediaconvert list-jobs \
33+
--endpoint-url ${mediaconvert_endpoint} \
34+
--query '*[].{Id:Id,CreatedAt:CreatedAt,Status:Status}' \
35+
--output table
36+
"
37+
38+
}

services/s3.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,26 @@ aws_s3_rm_instruction() {
8888
aws_s3_ls
8989
]
9090
"
91+
92+
# https://stackoverflow.com/questions/29809105/how-do-i-delete-a-versioned-bucket-in-aws-s3-using-the-cli
93+
# TODO Later (Verify later)
94+
cat <<-__EOF__
95+
96+
# Delete all object versioning enabled
97+
aws s3api put-bucket-lifecycle-configuration \
98+
--lifecycle-configuration '{"Rules":[{
99+
"ID":"empty-bucket",
100+
"Status":"Enabled",
101+
"Prefix":"",
102+
"Expiration":{"Days":1},
103+
"NoncurrentVersionExpiration":{"NoncurrentDays":1}
104+
}]}' \
105+
--bucket ${aws_s3_bucket_name}
106+
107+
# Then you just have to wait 1 day and the bucket can be deleted with
108+
aws s3api delete-bucket --bucket ${aws_s3_bucket_name}
109+
110+
__EOF__
91111
}
92112

93113
aws_s3_rm_with_hint() {

0 commit comments

Comments
 (0)