The Problem
First I made sure I was logged in properly.
- Ran aws configure sso --profile BWTC-Developer
- ran aws sso login --profile BWTC-Developer
Then I tried to run terraform init and was not able to as I was getting this error.
Error refreshing state: AccessDenied: Access Denied
status code: 403, request id: N7XHKNMYFE4YSDJ2, host id: OCFqyTMQgBoAS4I9CYEcnNiekCyV0LHxOtyFzCPjq39MK+yP3Qn4/8w1PIAMPo3bHjoh88MJISk=
terraform {
backend "s3" {
bucket = "shift3-terraform-state" //Does not exist in BWTC-Client-Sandbox and BWTC-Developer-Sandbox
key = "stemtaught-test-server/terraform.tfstate"
region = "us-west-2"
profile = "BWTC-Developer" //Would have to use profile pointing to the old original account for this too work
}
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0"
}
}
}
Solutions
- Add shift3-terraform-state bucket to each account.
- Specify that two different accounts are needed
The Problem
First I made sure I was logged in properly.
Then I tried to run
terraform initand was not able to as I was getting this error.Solutions