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

bigip_ssl_certificate and bigip_ssl_key import not supported properly #428

Closed
rossbeehler opened this issue Feb 16, 2021 · 2 comments
Closed
Labels
Milestone

Comments

@rossbeehler
Copy link

Environment

  • Bigip Version: 12x
  • Terraform Version: 0.14.6
  • Terraform bigip provider Version: 1.6.0

Summary

The bigip_ssl_certificate and bigip_ssl_key resources attempt to support importing, but do not properly include partition in the name/id of the resource, but demands it in the data of the request, which doesn't make sense for import commands, nor follows conventions of other resources.

Steps To Reproduce

terraform import bigip_ssl_certificate.c1 "/Common/c1.crt"

bigip_ssl_certificate.c1: Importing from ID "/Common/c1.crt"...
bigip_ssl_certificate.c1: Import prepared!
  Prepared bigip_ssl_certificate for import
bigip_ssl_certificate.c1: Refreshing state... [id=/Common/c1.crt]

Error: Cannot import non-existent remote object

While attempting to import an existing object to
bigip_ssl_certificate.c1, the provider detected that no object
exists with the given id. Only pre-existing objects can be imported; check
that the id is correct and that it is associated with the provider's
configured region or endpoint, or use "terraform apply" to create a new remote
object for this resource.

Expected Behavior

Should import the resource

Actual Behavior

Errors as shown above

Note that the issue is in func resourceBigipSslCertificateExists of /bigip/resource_bigip_ssl_certificate.go (and corresponding func/file for bigip_ssl_key). It demands a partition field in the resource data and always combines it with the id instead of assuming the id has partition already baked in, which is the normal convention for bigip resources. Of course, changing that would present a problem since partition is actually a resource field, so fixing this simply for import may break plan/apply.

@nmenant
Copy link

nmenant commented Feb 22, 2021

Thanks for the feedback, tracking this internally with INFRAANO-219

@wojtek0806 wojtek0806 mentioned this issue Mar 15, 2021
@RavinderReddyF5 RavinderReddyF5 added this to the v1.8.0 milestone Apr 1, 2021
@RavinderReddyF5
Copy link
Collaborator

@rossbeehler Issue fixed in v1.8.0, can you please verify it with v1.8.0

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

No branches or pull requests

3 participants