Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terraform state location not working #63

Open
goseinthemachine opened this issue Apr 11, 2023 · 2 comments
Open

terraform state location not working #63

goseinthemachine opened this issue Apr 11, 2023 · 2 comments

Comments

@goseinthemachine
Copy link

The Problem

First I made sure I was logged in properly.

  1. Ran aws configure sso --profile BWTC-Developer
  2. 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
@goseinthemachine
Copy link
Author

@BWTCDevops

@michaelachrisco
Copy link

So looks like develop is still using the following branch:

source = "[email protected]:Shift3/terraform-modules.git//modules/eb-s3-postgres"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants