-
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
Import of google_compute_instance with metadata.startup-script set #4388
Import of google_compute_instance with metadata.startup-script set #4388
Comments
This is the expected behaviour, for better or for worse, based on #1081. I'll document that, and then mark this issue as an enhancement to improve the behaviour for users who want the |
I think the direction we want to go with here is getting rid of the top-level |
This is extremely dangerous default behaviour and completely opposite to how the Edited: We now have a use case for manually editing the state file. |
…rp#4388) * Trim "deleted:" prefix from bigquery IAM member parsing * Ignore deleted members Signed-off-by: Modular Magician <[email protected]>
…8231) * Trim "deleted:" prefix from bigquery IAM member parsing * Ignore deleted members Signed-off-by: Modular Magician <[email protected]>
In case someone is looking for a workaround I recently ran into this exact issue and was able to get around by doing the following:
|
@samiwel I am also facing the same issue. I am tying to import a existing compute instance resource into terraform. Terraform plan was success full but plan shows destroy and recreate.
|
@amitlaspal I was able to avoid destroying and re-creating the resource by defining a |
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
Terraform Version
terraform 0.12.6
provider google 2.13.0
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
terrafrom import will write startup-script of instance to metadata.startup-script field of resource in terraform state. Changes in startup-script WILL NOT force instance to be replaced.
Actual Behavior
terraform import writes startup-script to metadata_starup_script field. terraform plan after import shows instance replacement - it tryes to move startup-script value from metadata_startup_script to metadata.startup-script and change to metadata_startup_script forces instance to be replaced.
Steps to Reproduce
terraform import google_compute_instance.instance instance-with-startup-script
terraform plan
The text was updated successfully, but these errors were encountered: