You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## AWS configuration: getting credentials for AWS federated user accounts
281
+
282
+
If you need to run commands that interact with AWS resources e.g. running a terraform plan against a dev environment locally
283
+
then you will need to configure AWS credentials.
284
+
285
+
Once you have been granted access, the `Access Keys` section within the AWS Access Portal will present you with several
286
+
options. It is _recommended_ to use `Option 2: Add a profile to your AWS credentials file`.
287
+
288
+
This is because the way that Python unittests using `moto` have been implemented is brittle and cannot handle other methods
289
+
such as IAM Identity Centre SSO. In future, we should consider following [moto recommendations](https://docs.getmoto.org/en/latest/docs/getting_started.html#how-do-i-avoid-tests-from-mutating-my-real-infrastructure)
290
+
to ensure our tests are authentication type agnostic and are fully robust.
291
+
292
+
If you _are_ using another option, such as SSO, and want to run unit tests then you will need to:
293
+
294
+
- Add dummy values for `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` to the .env file in the Lambda dir you are testing.
295
+
- Ensure those values are set before running the test, i.e. using the standard setup with direnv and a .envrc file
0 commit comments