Terraform_remote_state Windows credential error

I’m very new to Terraform so bear with me. I’m running Terraform v0.12.24 with AWS Provider v2.56.0 on Windows 10 primarily using Visual Studio Code and PowerShell 7 to build and execute Terraform commands. Anytime I add the data “terraform_remote_state” object to a configuration file terraform plan/apply errors out with:

Error: No valid credential sources found for AWS Provider.
Please see https://terraform.io/docs/providers/aws/index.html for more information on
providing credentials for the AWS Provider

Removing the object from the script results in a successful plan and apply.

This happens in PowerShell 5.1/7 and CMD.

ATM I’m storing my credentials in the shared credentials file. The backend and remote state use the same bucket so id assume that my provider credentials would work as described below.

Example configuration:

terraform {
backend “s3” {
bucket = “terraform-state”
key = /terraform.tfstate"
region = “us-east-1”
dynamodb_table = “terraform-locks”
encrypt = true
profile = “terraform”
}
}

provider “aws” {
region = “us-east-1”
profile = “terraform”
}

data “terraform_remote_state” “accounts” {
backend = “s3”
config = {
bucket = “terraform-state”
key = “/terraform.tfstate”
region = “us-east-1”
}
}

data “aws_iam_policy_document” “terraformAssumeRole” {
statement {
effect = “Allow”
actions = [ “sts:AssumeRole” ]
resources = [
for accountName, accountNumber in data.terraform_remote_state.accounts.outputs.accounts:
“arn:aws:iam::${accountNumber}:role/”
]
}
}