in terraform, for gcp compute instances, when will the metadata\startup\script actually…
Rate quality
Private research annotation
Sign in to add a private research label or note.
- User
in terraform, for gcp compute instances, when will the
metadata\_startup\_scriptactually be run? - Assistant
In Terraform, the
metadata_startup_scriptattribute is used to specify the startup script to be executed on a Google Cloud Platform (GCP) Compute Engine instance.The startup script is executed on the instance when it is first created or when it is restarted. Specifically, the startup script is run after the instance finishes booting up and before any user-defined startup scripts.
Note that if you make changes to the startup script after the instance has already been created, those changes will not be applied until the next time the instance is restarted.
Additionally, it's important to keep in mind that the
metadata_startup_scriptattribute is only applicable to instances created with thegoogle_compute_instanceresource. It is not applicable to instances created with other resources such asgoogle_container_node_pool.