Closed ralphpi closed 3 years ago
Take a look at Terraform workspaces. Your previous apply used the default
workspace, so it created default.tfstate
. The env_name
field corresponds to the workspace name, so the resource created development.tfstate
since you set env_name: development
. If you want to use the existing statefile then set env_name: default
.
Makes sense, I ended copying the existing default since we are just going to continue with how it uses workspaces.
My tf creates a set of subnets and binds permission to them. The tf repo used to be ran locally using backend.tf to define the same bucket information in the resource below. So ive sinced removed the
backend.tf
from repo to utilize the bucket setup in this resource. When I run a plan only- put
its not using the existing state filedefault.tfstate
to determine whether or not resources need to be create\updated\deleted. It seems to create its own to based on what it seems like theenv_name
. Is this intended to use only in new tf configs?pre-existing bucket
backend.tf