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: Terraform Registry

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

3 Likes

Well unfortunately I spent an hour or so banging my head before I even decided to search for it, but thanks for this — quick, easy fix once I did.

Thanks @codelkirby, It solves my issue. was debugging from last one hour :smile: