hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.27k stars 1.72k forks source link

Clarify the documentation of google_compute_instance data source regarding attached_disk #15718

Open lorenzofelletti opened 11 months ago

lorenzofelletti commented 11 months ago

Community Note

Description

As per the google_compute_instance documentation, the attached_disks have the source field that corresponds to the "name or self_link of the disk attached to this instance".

First, this is not very clear, as it is not specified in which scenarios you get the name rather than the self_link.

Second, why couldn't we get both? As in some case one may prefer one or the other.

New or Affected Resource(s)

Potential Terraform Configuration

References

b/312432938

rileykarson commented 11 months ago

I think this is always going to be a self link. We can accept a name as input, but the API will always return this so it's what you'll get in the datasource.

melinath commented 9 months ago

Would we potentially want to make this data source link to the resource for the argument reference? Similar to https://registry.terraform.io/providers/hashicorp/google/latest/docs/data-sources/artifact_registry_repository#attributes-reference. That would bring it more in line with our standard documentation practices but would unfortunately directly conflict with clarifying this question.