-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Query instance Guest Attributes #11756
Query instance Guest Attributes #11756
Comments
After investigation, this sounds like a request of a new |
any chance this will be prioritised? |
[upstream:83477176498f2488a4804e713a9ef7a14795798e] Signed-off-by: Modular Magician <[email protected]>
[upstream:83477176498f2488a4804e713a9ef7a14795798e] Signed-off-by: Modular Magician <[email protected]>
Working on the new |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Description
Instances have a specific type of custom metadata called Guest attributes. Unlike normal metadata, the applications on the instance can write to guest attributes while the VM is running.
The Terraform provider does not contain a resource or attribute to query these guest attributes.
The Compute Engine API contains a
getGuestAttributes
method.New or Affected Resource(s)
And likely others that where a VM is the backing resource.
Potential Terraform Configuration
Create a VM with the current
google_compute_instance
resource and guest attributes enabled:Set a guest attribute on the VM:
The requested enhancement to the data source where it contains the attribute
guest_attributes
:Workaround
I have implemented this with an External Data Source.
guest-attributes.sh
:It works, but my problem with this approach is the non-portable dependency of
google-cloud-sdk
andjq
.My specific use-case
I install
salt-minion
on the VMs to hand over the management to asalt-master
.salt-minion
generates a key-pair. The public key is added to Guest Attributes. Terraform picks it up from Guest Attributes and add it to the configuration of thesalt-master
.This is vaguely similar to the problem of having an instance send a signal to terraform described in hashicorp/terraform#4668 (comment).
b/308756204
The text was updated successfully, but these errors were encountered: