AWS SSO: Error: error reading SSO Instances: AccessDeniedException

Hi:

I just turned on AWS SSO and was playing with terraform to create permission set resources. I copy and pasted the sample code from here: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ssoadmin_instances

When I create the plan, I end up with an exception:
│ Error: error reading SSO Instances: AccessDeniedException:

│ with data.aws_ssoadmin_instances.example,
│ on main.tf line 15, in data “aws_ssoadmin_instances” “example”:
│ 15: data “aws_ssoadmin_instances” “example” {}

I’m using an IAM user with FullAdmin privileges. It seems to work fine through the AWS console. I am using the API Key/Secret of the same IAM user.

Does anyone have any ideas why Terraform would behave differently in this case?

Kind Regards,
Pete

Hi,

I was able to resolve my issue. It was environmental after all. My AWS SSO instance was created in different region than what I had set as the region in Terraform. Silly mistake. Hope this saves someone a couple of hours of head banging.

Kind Regards,
Pete