Skip to content

Adding SSH Keys to the VM within the module #3

@SylvainMartel

Description

@SylvainMartel

Find a way to add SSH keys through the module. Problem with the count repetition right now.

Presently, we can add a block like this outside before, or after, calling the module

resource "google_compute_project_metadata" "default" {
  for_each = toset(["username:${file("./files/sshpubkey.pem.pub")}"])
  project  = data.google_project.gpc_indy_node.number
  metadata = {
    ssh-keys = each.value
  }
}

but I'd like to find way to put it inside the module itself. The reason it's not there yet is that if we use a "count" of 2 or higher when calling the module, to deploy more than one node, the SSH keys can only be added once to the project and will give an error when trying to apply a second time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions