This is a sample repo to demonstrate TF's interaction with an AWS SSO profile.
Steps (default profile):
- Clone repo and run
terraform init
- Run
aws configure sso
and when prompted forCLI profile name
enterdefault
(thus making this configuration the default profile for AWS SSO in the CLI also) - Run
aws sso login
(without specifying--profile xxxx
) - Run
terraform plan
- Output should be visible, without TF errors for credentials etc.
For a named profile (i.e. aws sso login --profile foobar
):
- Replace
profile
inside the AWS provider (main.tf) from"default"
to"foobar"
- Run
aws configure sso
and setCLI profile name
tofoobar
when prompted - Run
aws sso login --profile foobar
- Run
terraform plan
- Output should be visible, without TF errors for credentials etc.