Hi all,
After not having heard of Terraform since late last year I've been fairly successful building up various modules, etc. for internal use of provisioning AWS infrastructure.
As part of this we're considering using workspaces to help ensure our non-production and production infrastructure are the same (since the backend specification doesn't support interpolation). We're using the same S3 bucket for all of our deployments, with permissions granted based upon object path to the relevant AWS accounts.
The problem occurs however when I try to create a new workspace. From a freshly cloned copy of our code:
```
$ terraform workspace new production
Backend reinitialization required. Please run "terraform init".
Reason: Initial configuration of the requested backend "s3"
The "backend" is the interface that Terraform uses to store state,
perform operations, etc. If this message is showing up, it means that the
Terraform configuration you're using is using a custom configuration for
the Terraform backend.
Changes to backend configurations require reinitialization. This allows
Terraform to setup the new configuration, copy existing state, etc. This is
only done during "terraform init". Please run that command now then try again.
If the change reason above is incorrect, please verify your configuration
hasn't changed and try again. At this point, no changes to your existing
configuration or state have been made.
Failed to load backend: Initialization required. Please see the error message above.
```
Why do I need to initialize my backend first?
Even if I try, it ends up failing because I haven't yet specified the AWS_PROFILE to use so it can't even access the specified S3 backend. So if I try to init:
```
$ terraform init
Initializing modules...
[snip]
Initializing the backend...
Successfully configured the backend "s3"! Terraform will automatically
use this backend unless the backend configuration changes.
Error loading state: AccessDenied: Access Denied
status code: 403, request id: A3F06079A689A596, host id: WXDkldryB5sOXB6CJbK12yRqtRrILxYhsAnaRvTvQQEBaOn+9xl3Mxd18evapVzkBzxP+zfQgvs=
```