Creating ressources with aws using IaC (infrastructure as code) often requires to use an access key for the the host to be able to connect to AWS.
For that , you need to login into the AWS console and search for the service IAM
On the IAM dashboard you have on the left My security credentials
on the page that opens , choose the access key section an click on Create access
the menu shows you the diiferent use cases of access key , and check the ones for your needs. For packer and terraform we ll only need the CLI .
you check, then accept the conditions(I understand) and click on next
the following section is optional, just adding additional information
This is the most important section. this page will on be visible once, you have to copy the keys here and store them somewhere, and/or download the .csv file (can be opened with VS CODE) then click on Done
Your access key is created, you can now install and configure your AWS CLI on your host (linux , windows or mac os)
the step for the others operating systems are just as easy, once installed, you can just type aws configure and paste the details
As you can see above it works just as well on windows. When done, you can test by typing aws configure list
If you have this output, you re good to go.