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 doc fix for google_cloudiot_device #9920

Closed
wants to merge 1 commit into from

Conversation

n-oden
Copy link

@n-oden n-oden commented Aug 26, 2021

The full path to the resource including project and location must
be specified; otherwise the device lookup fails with a 404 error
and the import fails.

The full path to the resource including project and location must
be specified; otherwise the device lookup fails with a 404 error
and the import fails.
@n-oden
Copy link
Author

n-oden commented Aug 26, 2021

Following the docs as-is produces a 404 error:

---[ REQUEST ]---------------------------------------
GET /v1/testregistry/devices/device.e34e2dc4-11df-45c0-a34c-3bbad4898e59?alt=json HTTP/1.1
Host: cloudiot.googleapis.com
User-Agent: Terraform/1.0.0 (+https://www.terraform.io) Terraform-Plugin-SDK/2.5.0 terraform-provider-google/3.76.0
Content-Type: application/json
Accept-Encoding: gzip


-----------------------------------------------------: timestamp=2021-08-26T11:30:53.784-0400
2021-08-26T11:30:54.028-0400 [INFO]  provider.terraform-provider-google_v3.76.0_x5: 2021/08/26 11:30:54 [DEBUG] Google API Response Details:
---[ RESPONSE ]--------------------------------------
HTTP/2.0 404 Not Found
Content-Length: 1639
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Content-Type: text/html; charset=UTF-8
Date: Thu, 26 Aug 2021 15:30:54 GMT
Server: ESF
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0

<!DOCTYPE html>
<html lang=en>
  <meta charset=utf-8>
  <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
  <title>Error 404 (Not Found)!!1</title>

@megan07 megan07 requested a review from melinath August 27, 2021 14:36
Copy link
Collaborator

@melinath melinath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM; there's a chance this is a bug in the provider; I'll ask during the upstream review.

Copy link
Collaborator

@melinath melinath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After looking into this more, the docs are correct. The {{registry}} field on this resource is expected to contain a full id (including project and location), so they don't need to be specified separately.

I agree this is not entirely clear from the docs, so I'm open to suggestions, but this document is also autogenerated, so there will be limitations as to what kinds of changes we can accept.

@n-oden
Copy link
Author

n-oden commented Aug 27, 2021

@melinath Which sections of the document are not autogenerated, and/or where is the template source? I'm happy to try to put together some useful verbiage; just need to know where to put it. :)

@melinath
Copy link
Collaborator

The template is here: https://github.com/GoogleCloudPlatform/magic-modules/blob/master/mmv1/templates/terraform/resource.html.markdown.erb

The resource information is here:

For now I'm going to close this PR, since it sounds like you might look into opening a PR against Magic Modules directly. I'm not sure whether it's going to be possible to improve this without significant changes to mmv1. The other option would be to convert this to a handwritten doc but we probably wouldn't accept that as an option, since handwritten docs are very difficult for us to maintain.

@melinath melinath closed this Aug 27, 2021
@n-oden n-oden deleted the fix-iot-import-doc branch September 10, 2021 22:03
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants