Open skymoraa opened 3 years ago
@skymoraa if you want to bring a resource created in google console to a terraform managed resource, you need to use terraform import
command. Hope that helps.
Yes I agree, but without the import the plan shouldn't show me the resource to add, because it is not present in the state? As it happens for other resources
Because terraform plan doesn't show it and if I run terraform apply the resource is still added to the state even if the plan did not say so.
Can you add debug output of your tf plan command, just want to check the calls we are making there.
Debug Output Log: terraform_log_debug.log
Rule with priority=100 and default create with terraform. Rule priority=101 create manualy and then add configuration on tf. Terraform plan make a rest call and find resource. But doesn't it make a difference with the state?
State: stete.txt
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
I expect that running a
terraform plan
, if a resource exists but it is not present in the state on bucket, the command want to add the resource until i import it in state. For examples: rule with priority=101 created by gcp console, then add configuration into .tf file and run a plan.Actual Behavior
Instead,
terraform plan
shows "No changes. Infrastructure is up-to-date.". Moreover then doing aterraform apply
puts it on the state. But the plan before didn't show it.Steps to Reproduce
terraform plan
with the same resources (nothing is displayed)terraform apply
on "No changes. Infrastructure is up-to-date" and the state will be refreshedReferences
b/305279834