blob: 0ad6016d28f469a73ea9d0db5ffdc28287269e95 [file] [log] [blame]
---
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in
# .github/CONTRIBUTING.md.
#
# ----------------------------------------------------------------------------
subcategory: "Compute Engine"
description: |-
Represents an Instance Settings resource.
---
# google\_compute\_instance\_settings
Represents an Instance Settings resource. Instance settings are centralized configuration parameters that allow users to configure the default values for specific VM parameters that are normally set using GCE instance API methods.
~> **Warning:** This resource is in beta, and should be used with the terraform-provider-google-beta provider.
See [Provider Versions](https://terraform.io/docs/providers/google/guides/provider_versions.html) for more details on beta resources.
To get more information about InstanceSettings, see:
* [API documentation](https://cloud.google.com/compute/docs/reference/rest/beta/instanceSettings)
* How-to Guides
* [Update Instance Settings](https://cloud.google.com/compute/docs/metadata/setting-custom-metadata#set-custom-project-zonal-metadata)
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=instance_settings_basic&cloudshell_image=gcr.io%2Fcloudshell-images%2Fcloudshell%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank">
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
</a>
</div>
## Example Usage - Instance Settings Basic
```hcl
resource "google_compute_instance_settings" "gce_instance_settings" {
provider = google-beta
zone = "us-east7-b"
metadata {
items = {
foo = "baz"
}
}
}
```
## Argument Reference
The following arguments are supported:
* `zone` -
(Required)
A reference to the zone where the machine resides.
- - -
* `metadata` -
(Optional)
The metadata key/value pairs assigned to all the instances in the corresponding scope.
Structure is [documented below](#nested_metadata).
* `project` - (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
<a name="nested_metadata"></a>The `metadata` block supports:
* `items` -
(Optional)
A metadata key/value items map. The total size of all keys and values must be less than 512KB
## Attributes Reference
In addition to the arguments listed above, the following computed attributes are exported:
* `id` - an identifier for the resource with format `projects/{{project}}/zones/{{zone}}/instanceSettings`
* `fingerprint` -
The fingerprint used for optimistic locking of this resource. Used
internally during updates.
## Timeouts
This resource provides the following
[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options:
- `create` - Default is 20 minutes.
- `update` - Default is 20 minutes.
- `delete` - Default is 20 minutes.
## Import
InstanceSettings can be imported using any of these accepted formats:
* `projects/{{project}}/zones/{{zone}}/instanceSettings`
* `{{project}}/{{zone}}`
* `{{zone}}`
In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import InstanceSettings using one of the formats above. For example:
```tf
import {
id = "projects/{{project}}/zones/{{zone}}/instanceSettings"
to = google_compute_instance_settings.default
}
```
When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), InstanceSettings can be imported using one of the formats above. For example:
```
$ terraform import google_compute_instance_settings.default projects/{{project}}/zones/{{zone}}/instanceSettings
$ terraform import google_compute_instance_settings.default {{project}}/{{zone}}
$ terraform import google_compute_instance_settings.default {{zone}}
```
## User Project Overrides
This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override).