but where would it save the Access/Secret key? In the state file? Is it possible to save this elsewhere (I don’t want it to print to stdout as we run this in a pipeline).
Fairly new to terraform so help will be appreciated
One of the options for the aws_iam_access_key resource allows you to supply a PGP key. The access key is then returned as an encrypted string.
Alternatively you could store the values in Vault by using the Vault Terraform provider.
Note that if you are using the unencrypted secret key (i.e. are not passing in a PGP key to use) you must treat the state file with care as it will now contain all the cleartext keys - ensure access to your remote state is correctly restricted as well as handling of your local state cache.