Commit 0ce744f
authored
fix: Cache AWS Creds instead of getting a Session on every invoke (aws#1494)
Addresses Issue aws#1375.
Due to Boto3.session.Session objects not being thread safe, we
create a Session object on every invoke to get credentials to
mount into the container. This works well except for customers
using MFA. When using MFA, this dehavior requires customers to
provide MFA code/pin on every invoke. This creates much longer
debug sessions for customers and pauses invokes until the MFA
code/pin is provided. This PR changes that behavior to one we
had between version v0.8.0 and v0.16.0, which is caching the
creds/session to be reused on other invokes until the credentials
expire. Once the credentials expire, customers will need to restart
the command (which was the same behavior on version 0.8.0 to 0.16.0.1 parent 4f2c345 commit 0ce744f
File tree
2 files changed
+25
-16
lines changed- samcli/commands/local/lib
- tests/unit/commands/local/lib
2 files changed
+25
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
205 | 207 | | |
206 | 208 | | |
207 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
208 | 226 | | |
209 | 227 | | |
210 | 228 | | |
| |||
215 | 233 | | |
216 | 234 | | |
217 | 235 | | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | 236 | | |
228 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
229 | 242 | | |
230 | 243 | | |
231 | | - | |
| 244 | + | |
232 | 245 | | |
233 | 246 | | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | 247 | | |
239 | 248 | | |
240 | 249 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| |||
0 commit comments