2015-08-20 19:18:41 +00:00
|
|
|
---
|
|
|
|
layout: "google"
|
|
|
|
page_title: "Google: google_compute_project_metadata"
|
2015-10-23 14:10:41 +00:00
|
|
|
sidebar_current: "docs-google-compute-project-metadata"
|
2015-08-20 19:18:41 +00:00
|
|
|
description: |-
|
|
|
|
Manages common instance metadata
|
|
|
|
---
|
|
|
|
|
|
|
|
# google\_compute\_project\_metadata
|
|
|
|
|
2018-10-10 22:13:25 +00:00
|
|
|
Authoritatively manages metadata common to all instances for a project in GCE. For more information see
|
2017-07-28 18:05:48 +00:00
|
|
|
[the official documentation](https://cloud.google.com/compute/docs/storing-retrieving-metadata)
|
|
|
|
and
|
|
|
|
[API](https://cloud.google.com/compute/docs/reference/latest/projects/setCommonInstanceMetadata).
|
|
|
|
|
2018-10-10 22:13:25 +00:00
|
|
|
~> **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
|
2017-07-28 17:49:02 +00:00
|
|
|
[google_compute_project_metadata_item](compute_project_metadata_item.html).
|
2015-08-20 19:18:41 +00:00
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
2017-04-17 10:17:54 +00:00
|
|
|
```hcl
|
2015-08-20 19:18:41 +00:00
|
|
|
resource "google_compute_project_metadata" "default" {
|
2016-04-10 21:34:15 +00:00
|
|
|
metadata {
|
|
|
|
foo = "bar"
|
|
|
|
fizz = "buzz"
|
2017-02-18 22:48:50 +00:00
|
|
|
"13" = "42"
|
2016-04-10 21:34:15 +00:00
|
|
|
}
|
2015-08-20 19:18:41 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
2018-10-10 22:13:25 +00:00
|
|
|
* `metadata` - (Required) A series of key value pairs.
|
2015-08-20 19:18:41 +00:00
|
|
|
|
2016-04-10 21:34:15 +00:00
|
|
|
- - -
|
2015-08-20 19:18:41 +00:00
|
|
|
|
2018-03-12 20:59:47 +00:00
|
|
|
* `project` - (Optional) The ID of the project in which the resource belongs. If it
|
2016-04-10 21:34:15 +00:00
|
|
|
is not provided, the provider project is used.
|
|
|
|
|
|
|
|
## Attributes Reference
|
2015-08-20 19:18:41 +00:00
|
|
|
|
2016-04-10 21:34:15 +00:00
|
|
|
Only the arguments listed above are exposed as attributes.
|
2018-11-08 00:01:54 +00:00
|
|
|
|
|
|
|
## Import
|
|
|
|
|
|
|
|
This resource can be imported using the project ID:
|
|
|
|
|
|
|
|
`terraform import google_compute_project_metadata.foo my-project-id`
|