Skip to content

googleComputeProjectMetadataItem

Manages a single key/value pair on metadata common to all instances for a project in GCE. Using googleComputeProjectMetadataItem lets you manage a single key/value setting in Terraform rather than the entire project metadata map.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as google from "./.gen/providers/google";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: google.
For a more precise conversion please use the --provider flag in convert.*/
new google.computeProjectMetadataItem.ComputeProjectMetadataItem(
  this,
  "default",
  {
    key: "my_metadata",
    value: "my_value",
  }
);

Argument Reference

The following arguments are supported:

  • key - (Required) The metadata key to set.

  • value - (Required) The value to set for the given metadata key.


  • project - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

  • id - an identifier for the resource with format `{{key}}``

Import

Project metadata items can be imported using the key, e.g.

$ terraform import google_compute_project_metadata_item.default my_metadata

Timeouts

This resource provides the following Timeouts configuration options: configuration options:

  • create - Default is 5 minutes.
  • update - Default is 5 minutes.
  • delete - Default is 5 minutes.