title: Terraform attempts to create the S3 backend again when switching to a new workspace
body: <p>I am following <a href="https://blog.gruntwork.io/a-comprehensive-guide-to-terraform-b3d32832baca" rel="nofollow noreferrer">this</a> excellent guide to terraform. I am currently on the 3rd post exploring the state. Specifically at the <a href="https://blog.gruntwork.io/how-to-manage-terraform-state-28f5697e68fa" rel="nofollow noreferrer">point</a> where terraform workspaces are demonstrated. 
  So, I have the following <code>main.tf</code>:</p>
  
  <pre><code>provider "aws" {
    region = "us-east-2"
  }
  
  resource "aws_s3_bucket" "terraform_state" {
    bucket = "mark-kharitonov-terraform-up-and-running-state"
  
    # Enable versioning so we can see the full revision history of our
    # state files
    versioning {
      enabled = true
    }
  
    # Enable server-side encryption by default
    server_side_encryption_configuration {
      rule {
        apply_server_side_encryption_by_default {
          sse_algorithm = "AES256"
        }
      }
    }
  }
  
  resource "aws_dynamodb_table" "terraform_locks" {
    name         = "terraform-up-and-running-locks"
    billing_mode = "PAY_PER_REQUEST"
    hash_key     = "LockID"
  
    attribute {
      name = "LockID"
      type = "S"
    }
  }
  
  terraform {
    backend "s3" {
      # Replace this with your bucket name!
      bucket = "mark-kharitonov-terraform-up-and-running-state"
      key    = "workspaces-example/terraform.tfstate"
      region = "us-east-2"
      # Replace this with your DynamoDB table name!
      dynamodb_table = "terraform-up-and-running-locks"
      encrypt        = true
    }
  }
  
  output "s3_bucket_arn" {
    value       = aws_s3_bucket.terraform_state.arn
    description = "The ARN of the S3 bucket"
  }
  
  output "dynamodb_table_name" {
    value       = aws_dynamodb_table.terraform_locks.name
    description = "The name of the DynamoDB table"
  }
  
  resource "aws_instance" "example" {
    ami           = "ami-0c55b159cbfafe1f0"
    instance_type = "t2.micro"
  }
  </code></pre>
  
  <p>And it is all great:</p>
  
  <pre><code>C:\work\terraform [master ≡]&gt; terraform workspace show
  default
  C:\work\terraform [master ≡]&gt; terraform apply
  Acquiring state lock. This may take a few moments...
  aws_dynamodb_table.terraform_locks: Refreshing state... [id=terraform-up-and-running-locks]
  aws_instance.example: Refreshing state... [id=i-01120238707b3ba8e]
  aws_s3_bucket.terraform_state: Refreshing state... [id=mark-kharitonov-terraform-up-and-running-state]
  
  Apply complete! Resources: 0 added, 0 changed, 0 destroyed.
  Releasing state lock. This may take a few moments...
  
  Outputs:
  
  dynamodb_table_name = terraform-up-and-running-locks
  s3_bucket_arn = arn:aws:s3:::mark-kharitonov-terraform-up-and-running-state
  C:\work\terraform [master ≡]&gt;
  </code></pre>
  
  <p>Now I am trying to follow the guide - create a new workspace and apply the code there:</p>
  
  <pre><code>C:\work\terraform [master ≡]&gt; terraform workspace new example1
  Created and switched to workspace "example1"!
  
  You're now on a new, empty workspace. Workspaces isolate their state,
  so if you run "terraform plan" Terraform will not see any existing state
  for this configuration.
  C:\work\terraform [master ≡]&gt; terraform plan
  Acquiring state lock. This may take a few moments...
  Refreshing Terraform state in-memory prior to plan...
  The refreshed state will be used to calculate this plan, but will not be
  persisted to local or remote state storage.
  
  
  ------------------------------------------------------------------------
  
  An execution plan has been generated and is shown below.
  Resource actions are indicated with the following symbols:
    + create
  
  Terraform will perform the following actions:
  
    # aws_dynamodb_table.terraform_locks will be created
    + resource "aws_dynamodb_table" "terraform_locks" {
  ...
        + name             = "terraform-up-and-running-locks"
  ...
      }
  
    # aws_instance.example will be created
    + resource "aws_instance" "example" {
        + ami                          = "ami-0c55b159cbfafe1f0"
  ...
      }
  
    # aws_s3_bucket.terraform_state will be created
    + resource "aws_s3_bucket" "terraform_state" {
  ...
        + bucket                      = "mark-kharitonov-terraform-up-and-running-state"
  ...
      }
  
  Plan: 3 to add, 0 to change, 0 to destroy.
  
  ------------------------------------------------------------------------
  
  Note: You didn't specify an "-out" parameter to save this plan, so Terraform
  can't guarantee that exactly these actions will be performed if
  "terraform apply" is subsequently run.
  
  Releasing state lock. This may take a few moments...
  C:\work\terraform [master ≡]&gt;
  </code></pre>
  
  <p>And here the problems start. In the guide, the <code>terraform plan</code> command reports that only one resource is going to be created - an EC2 instance. This implies that terraform is going to reuse the same S3 bucket for the backend and the same DynamoDB table for the lock. But in my case, terraform informs me that it would want to create all the 3 resources, including the S3 bucket. Which would definitely fail (already tried).</p>
  
  <p>So, what am I doing wrong? What is missing?</p>