Skip to content

Conversation

@thomaseizinger
Copy link
Member

The custom-data script runs very early in the boot process of cloud-init. It is possible that at that time, networking has not yet been set up correctly. Additionally, failure of launching this script is not communicated to terraform.

Instead of running a custom-data script, we can use an "extension" which runs after the VM has been fully provisioned.

@thomaseizinger
Copy link
Member Author

The downside of this is that terraform has to "poll" the API to wait for the VM to actually be provisioned. That seems better though than just "succeeding" without the VM to actually work.

@thomaseizinger thomaseizinger requested a review from jamilbk October 9, 2025 05:18
@thomaseizinger thomaseizinger force-pushed the feat/use-extension-for-install branch from e25e6f4 to 7ec6f01 Compare October 9, 2025 05:34
@thomaseizinger thomaseizinger force-pushed the feat/use-extension-for-install branch from 2ce26d0 to b2af4fa Compare October 9, 2025 05:51
@thomaseizinger thomaseizinger marked this pull request as ready for review October 9, 2025 05:51
@thomaseizinger
Copy link
Member Author

Tested as part of https://github.com/firezone/infra/pull/169

@thomaseizinger
Copy link
Member Author

The downside of this is that terraform has to "poll" the API to wait for the VM to actually be provisioned. That seems better though than just "succeeding" without the VM to actually work.

This is actually surprisingly quick. The VMs seem to provision roughly within 1 minute.

@thomaseizinger thomaseizinger merged commit e2f58bf into main Oct 9, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants