Skip to content

Commit df7ba87

Browse files
authored
VED-000 (NOJIRA) Add guidance on setting up AWS credentials (#1214)
1 parent 1acee0b commit df7ba87

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,3 +276,20 @@ run a different set of tests. To do this:
276276
Please note that this project requires that all commits are verified using a GPG key.
277277
To set up a GPG key please follow the instructions specified here:
278278
https://docs.github.com/en/authentication/managing-commit-signature-verification
279+
280+
## 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

Comments
 (0)