만약에, AWS가 아닌 GCP나 Azure라면 해당 CLI을 설치해주시면 좋습니다.
Homebrew를 이용해서 설치하면 좋습니다. 우선이 되야 하는 것은 Homebrew를 먼저 설치하세요
$ brew install terraform
여러 버전을 동시에 쓰는 경우는 다음과 같이 쓰시면 편합니다.
# ~/.zshrc or ~/.bashrc
alias tf12="/usr/local/bin/terraform"
alias tf11="/usr/local/bin/terraform11"
먼저 IAM 에서 사용자를 추가합니다.
기존 정책 직접 연결에서 AdministratorAcess로 연결합니다.
CSV를 다운로드 받습니다.
다음과 같은 명령어를 사용하여 Acess Key ID, Secret Access Key를 셋팅 합니다.
aws configure
$ cat ~/.aws/credentials
[default]
aws_access_key_id = ABCDEFXXXXXXX
aws_secret_access_key = KSdifi...
aws sts get-caller-identity
{
"UserId": "XXXXX",
"Account": "xxxxxxxxxxx",
"Arn": "arn:aws:iam::xxxxxxx:user/terraform-101"
} ## 해당 명령어를 통해서 현재 사용자를 확인할수 있습니다.