Update Cloud-Init user data on your Vultr VX1™ Cloud Compute instance using the Customer Portal or API to automate configuration.
Cloud-Init enables the automatic initialization and configuration of instances during the initial boot phase. It runs user data scripts to customize an instance, install applications, and configure specific packages or services.
Follow this guide to update Cloud-Init user data on a Vultr VX1™ Cloud Compute instance using the Vultr Customer Portal, or API.
Send a GET request to the List Instances endpoint and note your target instance's ID.
$ curl "https://api.vultr.com/v2/instances" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Send a PATCH request to the Update Instance endpoint to update the instance's Cloud-Init user data.
$ curl "https://api.vultr.com/v2/instances/{instance-id}" \
-X PATCH \
-H "Authorization: Bearer ${VULTR_API_KEY}" \
-H "Content-Type: application/json" \
--data '{
"user_data" : "<cloud-init-data>"
}'
If successful, you receive a 200 status code response.