subcategory | description |
---|---|
Compute Engine |
Get GCE instance's guest attributes |
Get information about a VM instance resource within GCE. For more information see the official documentation and API.
Get information about VM's guest attrubutes. For more information see the official documentation and API.
data "google_compute_instance_guest_attributes" "appserver_ga" {
name = "primary-application-server"
zone = "us-central1-a"
query_path = "variables/"
}
data "google_compute_instance_guest_attributes" "appserver_ga" {
name = "primary-application-server"
zone = "us-central1-a"
variable_key = "variables/key1"
}
The following arguments are supported:
name
- (Optional) The name or self_link of the instance.
-
project
- (Optional) The ID of the project in which the resource belongs. Ifself_link
is provided, this value is ignored. If neitherself_link
norproject
are provided, the provider project is used. -
zone
- (Optional) The zone of the instance. Ifself_link
is provided, this value is ignored. If neitherself_link
norzone
are provided, the provider zone is used. -
query_path
- (Optional) Path to query for the guest attributes. Consists ofnamespace
name for the attributes followed with a/
. -
variable_key
- (Optional) Key of a variable to get the value of. Consists ofnamespace
name andkey
name for the variable separated by a/
.
-
query_value
- Structure is documented below. -
variable_value
- Value of the queried guest_attribute.
The query_value
block supports:
-
key
- Key of the guest_attribute. -
namespace
- Namespace of the guest_attribute. -
value
- Value of the guest_attribute.