Skip to content
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

Triggering VM replacement when user_data changes #316

Open
outscale-age opened this issue Feb 24, 2023 · 0 comments
Open

Triggering VM replacement when user_data changes #316

outscale-age opened this issue Feb 24, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@outscale-age
Copy link

Current Terraform Version

Terraform v1.3.5

Use-cases

When using bash scripts inside VM user data, those scripts are usually only run at VM startup, and on a clean system, to make run-time tunings to the OS. When updating the user_data field, today the provider tells the user that an in-place update will take place, and implements this via a stop/update/start cycle.

This has the inconvenient of:

  • Not triggering any change in the existing VMs (unless specific provision is made) - but still having them powered off/on.
  • Not allowing automatic VM replacements when clean-state provisioning scripts are written.

Attempted Solutions

Work-around is manually using terraform apply -replace, and lifecycle ignores.
It seems that TF lifecycle .replace_triggered_by is not applicable to resource own attributes.

Proposal

Provide an optional setting in the resource that would alter the behavior of the user_data triggered change, letting the user choose between in-place updating (stop, start) and VM replacement.

@outscale-age outscale-age added the enhancement New feature or request label Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants