Skip to content

Latest commit

 

History

History
79 lines (59 loc) · 1.34 KB

README.md

File metadata and controls

79 lines (59 loc) · 1.34 KB

Terraform | AWS - Preparatory steps

In order for Terraform to run operations on your behalf, you must install and configure the AWS CLI tool.

Example

macOS installation and setup for all users

curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
sudo installer -pkg AWSCLIV2.pkg -target /

Verify installation

$ which aws
/usr/local/bin/aws
$ aws --version
aws-cli/2.13.33 Python/3.11.6 Darwin/23.1.0 exe/x86_64 prompt/off

Setup credentials and configuration

Option 1 - AWS CLI
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
export AWS_DEFAULT_REGION=
export AWS_DEFAULT_OUTPUT=text
Option 2 - Manually creating credential files
mkdir ~/.aws
cd ~/.aws
cat > credentials << EOL
[default]
aws_access_key_id = <YOUR_ACCESS_KEY>
aws_secret_access_key = <YOUR_SECRET_ACCESS_KEY>
EOL
cat > config << EOL
[default]
region = <REGION>
output = text
EOL
Option 3 - IAM Identity Center credentials
aws configure sso
export AWS_PROFILE=<YOUR_CONFIG_PROFILE>
Verify credentials
aws sts get-caller-identity