pulumi_wasm_providers_gcp_mini::compute

Module project_metadata

source
Expand description

Authoritatively manages metadata common to all instances for a project in GCE. For more information see the official documentation and API.

Note: This resource manages all project-level metadata including project-level ssh keys. Keys unset in config but set on the server will be removed. If you want to manage only single key/value pairs within the project metadata rather than the entire set, then use google_compute_project_metadata_item.

§Example Usage

resources:
  default:
    type: gcp:compute:ProjectMetadata
    properties:
      metadata:
        foo: bar
        fizz: buzz
        '13': '42'

§Adding An SSH Key

resources:
  # /*
  # A key set in project metadata is propagated to every instance in the project.
  # This resource configuration is prone to causing frequent diffs as Google adds SSH Keys when the SSH Button is pressed in the console.
  # It is better to use OS Login instead.
  # */
  mySshKey:
    type: gcp:compute:ProjectMetadata
    name: my_ssh_key
    properties:
      metadata:
        ssh-keys: |2
                dev:ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILg6UtHDNyMNAh0GjaytsJdrUxjtLy3APXqZfNZhvCeT dev
                foo:ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILg6UtHDNyMNAh0GjaytsJdrUxjtLy3APXqZfNZhvCeT bar

§Import

Project metadata can be imported using the project ID:

  • {{project_id}}

When using the pulumi import command, project metadata can be imported using one of the formats above. For example:

$ pulumi import gcp:compute/projectMetadata:ProjectMetadata default {{project_id}}

Structs§

Functions§

  • Registers a new resource with the given unique name and arguments