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

Terraform import block for selectel project misses a lot of information #315

Open
mipo256 opened this issue Nov 23, 2024 · 2 comments
Open

Comments

@mipo256
Copy link

mipo256 commented Nov 23, 2024

Hi there,

No, when the project is imported into state via terraform import, all of its configuration is imported, as it should. The problem is, when using the import blocks, the generated resource contains a very little information about the imported project. The problem is that we've created the project manually initially, and some custom quotas were applied.

When it gets imported into the state, the state contains the custom state info about the imported project A, but the generated resource does not contain the quotas at all. That leads to the fact, that resource HCL declaration of the project A is actually different from the state as the resource declaration relies on the default quotas.

Summary: This can be solved easily by just generating the resource with all available information on the server, so that the definition of the resource in the state file is identical to the definition of the generated HCL resource. Most cloud providers like AWS, GCP do exactly that.

Therefore, if the project that we've created

Terraform Version

Terraform version: v1.8.0
Selectel provider: 5.3.0
Openstack provider: 2.0.0

Affected Resource(s)

Resources: selectel_vpc_project_v2

Terraform Configuration Files

I've created the demo repository to demonstrate the problem

Debug Output

It is not a bug as such, so I do not think the default here is necessary.

Panic Output

If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.

Expected Behavior

The generated project resource should include all information, as it is typically done by an import block in other providers. For instance, the quotas information and etc.

Actual Behavior

The generated project resource looked like this:

resource "selectel_vpc_project_v2" "xrm_project" {
  custom_url = null
  name       = "some-project-name"
  theme      = {}
}

Steps to Reproduce

Checkout to demo repository, fill the variables with the approriate values and run ./import.sh to generate the resource block.

Important Factoids

No

References

No

@shlykov
Copy link

shlykov commented Nov 26, 2024

Hi @mipo256 , thanks for your report. We will take it into consideration for the next version of the project resource. The current version is somewhat outdated. I guess we will need a few months to deliver it.

@mipo256
Copy link
Author

mipo256 commented Nov 26, 2024

Sounds great, thanks @shlykov !)

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

No branches or pull requests

2 participants