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

Import does not actually import the data #134

Open
peterbaumert opened this issue Mar 11, 2024 · 3 comments
Open

Import does not actually import the data #134

peterbaumert opened this issue Mar 11, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@peterbaumert
Copy link

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

@danischm
Copy link
Member

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?

@peterbaumert
Copy link
Author

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.

@danischm danischm added the bug Something isn't working label Apr 10, 2024
@NWA2000
Copy link

NWA2000 commented Jul 27, 2024

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.

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

No branches or pull requests

3 participants