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

Importing project environment shows diff #90

Closed
EvertonSA opened this issue Oct 23, 2023 · 6 comments · Fixed by #92
Closed

Importing project environment shows diff #90

EvertonSA opened this issue Oct 23, 2023 · 6 comments · Fixed by #92
Assignees
Labels
bug Something isn't working

Comments

@EvertonSA
Copy link

When create environment resource, everything goes well. When importing an existing project environment, some weird behavior happens:

Prerequirement to replicate:

  • have a manually created environment named "platform-dta"

Then follows the process:
add the following to your terraform

resource "project_environment" "platform-dta" {
  name        = "platform-dta"
  project_key = "team01"
}

Run import command:
terraform import project_environment.platform-dta team01:platform-dta

Run terraform plan:

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place


Terraform will perform the following actions:

 

  # project_environment.platform-dta will be updated in-place
  ~ resource "project_environment" "platform-dta" {
        id          = "adat-common-prd"
      ~ name        = "common-prd" -> "platform-dta"
        # (1 unchanged attribute hidden)
    }

common-prd is an environment that already exists, and it is not intented to be managed by terraform now (it will be in the future).

what my colleague observed is that the import is using the "last" available environment.

@EvertonSA EvertonSA added the bug Something isn't working label Oct 23, 2023
@mikeycmccarthy
Copy link

We're actually seeing the same issue on an earlier version (1.2.1). We're not doing an import, we create one custom project environment, and then after it is created when we create a second custom environment for the project, Terraform tells us it wants to change the first one.

We've confirmed it is the same in the newest version as well (1.3.3)

@Sarcasm0naut
Copy link

I'm experiencing precisely the same thing @mikeycmccarthy described.

@alexhung
Copy link
Member

@EvertonSA @mikeycmccarthy @Sarcasm0naut Thanks for the report. I was out on vacation last week, hence the radio silence.

alexhung added a commit that referenced this issue Oct 30, 2023
Ensure the correct env pointer is used after matching
@mikeycmccarthy
Copy link

Amazing, thank you @alexhung !

@Sarcasm0naut
Copy link

Thank you @alexhung, highly appreciated.

@EvertonSA
Copy link
Author

my internal user also confirms it works now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants