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

organization change in the provider configuration is not detected in the resouces #1152

Closed
tmatilai opened this issue Nov 26, 2023 · 1 comment · Fixed by #1163
Closed

organization change in the provider configuration is not detected in the resouces #1152

tmatilai opened this issue Nov 26, 2023 · 1 comment · Fixed by #1163
Labels

Comments

@tmatilai
Copy link
Contributor

Terraform version

Terraform v1.6.3
TFE provider v0.50.0

Terraform Configuration Files

First create a workspace to an organization configured in the provider:

provider "tfe" {
  organization = "example-1"
}

resource "tfe_workspace" "example" {
  name = "foo"
}

Then change the organization in the provider configuration:

provider "tfe" {
  organization = "example-2"
}

resource "tfe_workspace" "example" {
  name = "foo"
}

Terraform Output

$ terraform apply 
tfe_workspace.example: Refreshing state... [id=ws-123456789]

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Expected Behavior

The resource should have been recreated to the other organization.

Actual Behavior

The organization change was not detected.

Additional Context

Probably not very essential in normal operations. But I hit the same issue when started to implement some new resources and data sources using the plugin framework, and realized that it already exists with the SDKv2 resources.

I guess also with the SDK the ConfiguredClient.schemaOrDefaultOrganization() uses the state instead of configuration for verifying if the organization has been set in the resource.

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