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

google_compute_project_metadata_item destroys existing (unmanaged) data #340

Closed
ayohrling opened this issue Aug 18, 2017 · 3 comments
Closed
Assignees

Comments

@ayohrling
Copy link

Affected Resource(s)

  • google_compute_project_metadata_item

Terraform Configuration Files

resource "google_compute_project_metadata_item" "ssh_public_key" {
  key = "sshKeys"
  value = "${var.ssh_user}:${file(pathexpand("${path.root}/files/publickey.pub"))}"
}

Expected Behavior

This should add/remove/manage a key for ssh_user in the GCE project metadata

Actual Behavior

This adds the key for the ssh_user to GCE project metadata and destroys all other keys.

@selmanj
Copy link
Contributor

selmanj commented Aug 18, 2017

I believe this is expected behavior, if I'm understanding the issue correctly. To restate, this issue is reporting that the other ssh keys in the metadata value for sshKeys are being overwritten (and NOT that other project metadata keys that are not sshKeys are being overwritten). Please correct me if I'm wrong.

google_compute_project_metadata_item lets you manage a single key/value entry within project metadata without having to manage all the other items. However, the 'sshKeys' item itself manages an entire list of keys. It sounds like you want to manage a single ssh key without having to explicitly list all of them.

Is that summary accurate?

@selmanj
Copy link
Contributor

selmanj commented Sep 1, 2017

(Note that GCP has a whitelist-only API for managing users in a much more direct fashion: https://cloud.google.com/compute/docs/access/user-accounts/ . Once this API is stabilized and at least in beta we can work on exposing it as a resource).

Closing for now. Please reopen if I misinterpreted anything above.

@selmanj selmanj closed this as completed Sep 1, 2017
luis-silva pushed a commit to luis-silva/terraform-provider-google that referenced this issue May 21, 2019
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
@ghost
Copy link

ghost commented Mar 31, 2020

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.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants