-
Notifications
You must be signed in to change notification settings - Fork 16
/
aws_cli.aws.txt
309 lines (229 loc) · 15 KB
/
aws_cli.aws.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
AWS CLI
VERSION ==> #2.11.10
#Written in Python
SEE ALSO ==> #Main AWS doc
/=+===============================+=\
/ : : \
)==: INSTALL :==(
\ :_______________________________: /
\=+===============================+=/
INSTALL ==> #Download and run install script
#Does not automatically update
DOCKER IMAGE ==> #Available on Docker Hub or ECS
SERVICES ==> #Most are available, except some within last 6 months
#Some SERVICEs have CLI-only commands
/=+===============================+=\
/ : : \
)==: CONFIG :==(
\ :_______________________________: /
\=+===============================+=/
CONFIG
CREDS
ENVVARs #See AWS config doc
--profile
--region
--ca-bundle #Like CONFIG.*
aws configure ... #Get|set CONFIG|CREDS
aws configure #Create CONFIG|CREDS interactively
aws configure list #
aws configure get
[PROFILE.]VAR #
aws configure set
[PROFILE.]VAR VAL #
aws configure sso #Same but for CONFIG.sso_*
--no-browser #Do not open browser automatically
aws configure sso-session #Same but for SSO_CONFIG.*
aws configure import #Set multiple PROFILEs using a CSV file with columns: 'PROFILE', ACCESS_KEY_ID, SECRET_ACCESS_KEY
#That CSV file can be downloaded from UI
--csv #'PATH'
--profile-prefix #STR to prepend to all 'PROFILE'
--skip-invalid #BOOL (def: false). Do not fail if invalid
aws configure list-profiles #Print all PROFILEs
aws-vault ##CLI tool to encrypt CREDS using an encrypted file, OS-specific keychain, pass, Yubikey
##Login through temporary created ROLEs
##Can also manage multiple profiles, or rotate CREDS
##Not documented yet
/=+===============================+=\
/ : : \
)==: AUTH :==(
\ :_______________________________: /
\=+===============================+=/
aws configure
export-credentials #Print current CREDENTIALS_OBJ
--format #Can be:
# - 'process' (def): JSON
# - 'env': `export AWS_...=...`
# - 'env-no-export': `AWS_...=...`
# - 'powershell': `$Env:AWS_...="..."`
# - 'windows-cmd': `set AWS_...=...`
--no-sign-request #Do not add authorization parameters
~/.aws/cli/cache #Cache for authentication
/=+===============================+=\
/ : : \
)==: REQUEST :==(
\ :_______________________________: /
\=+===============================+=/
aws SERVICE ACTION #Performs an action
#ACTION|REQ_VAR: lowercase dasherized
aws SERVICE WAIT-complete
aws SERVICE wait WAIT #Wait until WAIT complete
--REQ_VAR #Underlying COMMAND parameters and HTTP headers
#If x-amz-HEADER, stripped to just --HEADER
#Sometimes the name is slightly different from the API
#When request is raw, usually OBJ.Body, with OBJ.* being the headers
--REQ_VAR VAL #
--[no-]REQ_BOOL #
--REQ_DATE STR #'YYYY-MM-DD[THH:MM:SS.sssZ]' or DATE_NUM
--REQ_ARR VAL VAL2 ... #
--REQ_OBJ
KEY=VAL,KEY2=VAL2,... #
--REQ_ARR_OBJ
KEY=VAL,...,KEY2=VAL2,... #
--REQ_OBJ_ARR
KEY=VAL,... KEY2=VAL2,... #
NESTED VAL ==> #Can be {VAR=VAL,...}
--REQ_VAR file://PATH.json #Use JSON file content ("blob")
#PATH can be relative
--REQ_VAR fileb://PATH #Use raw binary file content
--REQ_VAR file://PATH #Use binary file content, depending on --cli-binary-format:
--cli-binary-format # - 'base64' (def)
# - 'raw-in-base64-out': raw
#Binary values are always base64 in output
--REQ_VAR PATH #Use OBJ_ARR file content ("streaming blob")
#Only for specific ACTIONs
--cli-input-json
file://PATH.json #Specifies all --REQ_VAR as JSON
--cli-input-yaml
file://PATH.yml #Specifies all --REQ_VAR as YAML
--generate-cli-skeleton #Generate sample '[yaml-]input' (def) or 'output'
/=+===============================+=\
/ : : \
)==: AUTOCOMPLETE :==(
\ :_______________________________: /
\=+===============================+=/
complete -C aws_completer aws #Adds autocompletion
#Binary installed alongside `aws`
CONFIG.cli_auto_prompt #Can be:
ENVVAR AWS_CLI_AUTO_PROMPT # - 'on'
# - 'on-partial':
# - only on incomplete|erroneous commands
# - e.g. when only `aws` entered
# - 'off' (def)
#Interactive TUI with:
# - autocomplete
# - makes API calls to guess values too
# - output preview
# - show description and full docs
# - docs
# - history (CTRL-R)
#Previously named aws-shell and was a separate binary, now deprecated
--[no-]cli-auto-prompt #BOOL (def: false)
saws ##Project adding autocompletion and syntax highlighting, but not maintained
aws SERVICE wizard ACTION #Like AWS SERVICE ACTION but interactively with a TUI
#Only for specific ACTIONs, and name is often different
/=+===============================+=\
/ : : \
)==: ALIAS :==(
\ :_______________________________: /
\=+===============================+=/
~/.aws/cli/alias #Like shell aliases, but AWS CLI specific
#INI file
#Top-level key: [toplevel] or [command SERVICE]
#Nested key: 'ALIAS'
#Value:
# - '[SERVICE] ACTION [--FLAG...]'
# - '!SHELL_COMMAND'
# - can use $1, etc.
/=+===============================+=\
/ : : \
)==: HISTORY :==(
\ :_______________________________: /
\=+===============================+=/
CONFIG.cli_history #"disabled" (def) or "enabled"
aws history list #Show previous commands, including ids, date, args, return code
aws history show ID #Show previous command in full
--include|exclude #'EVENT,...'
--format #Always "detailed"
/=+===============================+=\
/ : : \
)==: PAGINATION :==(
\ :_______________________________: /
\=+===============================+=/
--no-paginate #BOOL. If false (def), automatically paginates, returning whole ARR
--page-size #NUM from 'MaxItems' pagination when paginating automatically
#Def: SERVICE-specific
--starting-token #STR from 'NextToken' pagination
--max-items #Only print first NUM ARR items in output
#Regardless of whether received through pagination
#Def: none
/=+===============================+=\
/ : : \
)==: FILTER :==(
\ :_______________________________: /
\=+===============================+=/
--query #Filter with FILTER
#If --output is text|table, applied on each pagination response, instead of on whole ARR
JMESPATH ==> #Format of FILTER.
#Partial documentation:
# - OBJ.VAR
# - ARR[NUM]
# - ARR[*]: all ARR members
# - ARR[[NUM]:[NUM2]:[STEP]]:
# - slice
# - def: start, end, 1
# - can be negative NUM (from end)
# - ARR[*].ARR[]: like ARR[*].ARR[*], but flattened
# - OBJ_ARR[?VAR==VAL]
# - filter
# - == can also be != <= < > >=
# - VAL is `...` (STR) or `NUM`
# - OBJ[_ARR].{NEW:OLD,...}:
# - like OBJ.OLD, but rename to OBJ.NEW
# - OLD can be FILTER
# - OBJ[_ARR].[VAR,...]:
# - each OBJ.VAR, as ARR
# - VAR can be FILTER
# - FILTER | FILTER2: pipe
# - built-in FUNCs:
# - abs|ceil|floor(NUM)->NUM
# - avg|sum|min|max(NUM_ARR)->NUM
# - contains(ARR|STR, STR2)->BOOL
# - starts|ends_with(STR, STR2)->BOOL
# - join(STR, ARR)->STR2
# - keys(OBJ)->STR_ARR
# - values(OBJ)->ARR
# - length(OBJ|ARR|STR)->NUM
# - reverse(ARR)->ARR2
# - sort(ARR)->ARR2
# - sort_by(ARR, FILTER)->ARR2
/=+===============================+=\
/ : : \
)==: OUTPUT :==(
\ :_______________________________: /
\=+===============================+=/
CONFIG.output
--output
ENVVAR AWS_DEFAULT_OUTPUT #'json' (def), 'yaml[-stream]', 'text' (TSV), 'table'
CONFIG.cli_timestamp_format #How timestamp are output:
# - 'iso8601' (def)
# - 'wire': as received from the API
--color #'auto' (def) or 'on|off'
CONFIG.cli_pager
--no-cli-pager #BOOL (def: true). Whether to use `less`
ENVVAR AWS_PAGER #'PROGRAM [--FLAG...]'
--debug #BOOL (def: false). Debug logging
ENVVAR LC_ALL #Used
ENVVAR AWS_CLI_FILE_ENCODING #Def: 'UTF-8'
/=+===============================+=\
/ : : \
)==: NETWORK :==(
\ :_______________________________: /
\=+===============================+=/
--endpoint-url #'SERVICE_FULL_DOMAIN' (def: guessed)
--cli-connect-timeout #NUM (secs, def: 60). Timeout for connection
--cli-read-timeout #NUM (secs, def: 60). Timeout, excluding connection
--no-verify-ssl #BOOL (def: false)
ENVVAR HTTP[S]_PROXY
ENVVAR NO_PROXY #Can be used