-
Notifications
You must be signed in to change notification settings - Fork 55
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
Using import for fusionauth_tenant and fusionauth_application creates errors #214
Comments
@Aaron-Ritter I don't understand the issue. The default tenant and client will always exist. Are you saying you want to import them into Terraform and manage them that way? Are there workarounds? I also see |
If you want to manage the configuration through terraform you have to first import it, and the reproducible way of import would be based on config rather than the cli Correct the If not managed by Terraform you can just use the data source configuration instead (which is working) and again achieve a fully contained configuration with all components. |
When running Based on the fact that the actual configuration has SMS MFA setting disabled my assumption is the issue is in the provider, as it shouldn't even define these attributes or ignore them as SMS MFA is disabled. A workaround is to change the generated configuration manually but that's not really the point of the import function. |
Sorry @Aaron-Ritter , I'm still not sure I understand the issue. Can you rephrase it, please? |
@mooreds I did some further research and hope this will clarify it: The config driven import was only recently introduced as a concept in Terraform. All thought the declarative import is not experimental, only In my additional tests I discovered that if I declare the import and resource section manually in my main.tf file, I wont run in to the error I experienced with the generated version. Because I only define what's necessary (Required). Having said that, the underlying issue of my errors reported earlier is not related to The Tenant MFA SMS example shown in the previous post is a good example to show what's happening: Defining or importing a tenant resource will always define in the terraform state the following:
This shows that despite multi_factor_configuration sms is Which is why, if copy pasted in to your main.tf it is an invalid configuration and therefore producing the errors:
Which ultimately is not much different from what What I am not familiar with and don't know is how to handle is the scenario of "importing and handling only live/used configuration" or "not validating inactive configuration" in the Terraform Provider. |
@Aaron-Ritter can you spend maybe 6 hours taking a look at this and seeing if you can see an easy fix, whether to the golang FusionAuth client or to the terraform provider? Feel free to share any findings, up to and including a PR. If there's no easy fix, well then we have this bug description for the future. FYI, this pattern of data showing when an overriding option is disabled is very common as we like to save configuration once entered. |
I am not able to import neither Default fusionauth_tenant or FusionAuth fusionauth_application with
terraform plan -generate-config-out=generated_resources.tf
as its causing the errors below.To import I created import.tf with the following configuration:
The text was updated successfully, but these errors were encountered: