Import does not actually import the data
Opened this issue · 3 comments
Hi,
since I am still new to terraform, I am not 100% certain if this is actually how its intended to work. So just close the issue if all works as designed.
When I do a
terraform import iosxe_system.hostname "Cisco-IOS-XE-native:native"
iosxe_system.hostname: Importing from ID "Cisco-IOS-XE-native:native"...
iosxe_system.hostname: Import prepared!
Prepared iosxe_system for import
iosxe_system.hostname: Refreshing state... [id=Cisco-IOS-XE-native:native]
Import successful!
The resources that were imported are shown above. These resources are now in
your Terraform state and will henceforth be managed by Terraform.
All seems to have worked fine, but when I now want to see the state it just shows the id
:
terraform state show iosxe_system.hostname
# iosxe_system.hostname:
resource "iosxe_system" "hostname" {
id = "Cisco-IOS-XE-native:native"
}
From other provides I know that usually there should be the current data which is configured in the imported device.
You can also see this as a feature request, if this is just not implemented yet :)
KR
Peter
How did the resource config look like or did you not have a corresponding resource in your config and were using the -generate-config-out
cli flag?
resource looked like
resource "iosxe_system" "hostname" {
hostname = "hostname"
}
the -generate-config-out flag does not seem to do anything either.
Terraform v1.7.4
on linux_amd64
+ provider registry.terraform.io/ciscodevnet/iosxe v0.5.5
I mean it does import the resource in general, I just does not have the actual values from the device in them and wants to update them although nothing changed.
Pretty sure this isn't refreshing the state of the device either (IE not reading actuals the device). Making manual configuration drift (IE changing an interface description on the switch) results in no terraform changes of an existing resource.
Terraform v1.9.3
on darwin_arm64
- provider registry.terraform.io/ciscodevnet/iosxe v0.5.6
Oddly, data blocks work, but Imports/configuration drift just has null data in a terraform state pull.