|
| 1 | +# Copyright 2024 Google Inc. |
| 2 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | +# you may not use this file except in compliance with the License. |
| 4 | +# You may obtain a copy of the License at |
| 5 | +# |
| 6 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | +# |
| 8 | +# Unless required by applicable law or agreed to in writing, software |
| 9 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | +# See the License for the specific language governing permissions and |
| 12 | +# limitations under the License. |
| 13 | + |
| 14 | +--- |
| 15 | +name: 'InstantSnapshot' |
| 16 | +kind: 'compute#instantSnapshot' |
| 17 | +description: | |
| 18 | + Represents an instant snapshot resource. |
| 19 | +
|
| 20 | + An instant snapshot is an in-place backup of a disk that can be used to rapidly create a new disk in minutes. |
| 21 | +
|
| 22 | + Instant snapshots capture data at a specific point in time. They are optimized for rapidly restoring captured |
| 23 | + data to a new disk. Use instant snapshots to quickly recover data in cases where the zone and disk are still intact |
| 24 | + but the data on the disk has been lost or corrupted |
| 25 | +references: |
| 26 | + guides: |
| 27 | + 'Official Documentation': 'https://cloud.google.com/compute/docs/disks/instant-snapshots' |
| 28 | + api: 'https://cloud.google.com/compute/docs/reference/rest/v1/instantSnapshots' |
| 29 | +docs: |
| 30 | +base_url: 'projects/{{project}}/zones/{{zone}}/instantSnapshots' |
| 31 | +has_self_link: true |
| 32 | +immutable: true |
| 33 | +timeouts: |
| 34 | + insert_minutes: 20 |
| 35 | + update_minutes: 20 |
| 36 | + delete_minutes: 20 |
| 37 | +async: |
| 38 | + actions: ['create', 'delete', 'update'] |
| 39 | + type: 'OpAsync' |
| 40 | + operation: |
| 41 | + full_url: 'selfLink' |
| 42 | + result: |
| 43 | + resource_inside_response: false |
| 44 | +collection_url_key: 'items' |
| 45 | +iam_policy: |
| 46 | + parent_resource_attribute: 'name' |
| 47 | + example_config_body: 'templates/terraform/iam/iam_attributes.go.tmpl' |
| 48 | + iam_conditions_request_type: 'QUERY_PARAM' |
| 49 | + allowed_iam_role: 'roles/compute.storageAdmin' |
| 50 | + import_format: |
| 51 | + - 'projects/{{project}}/zones/{{zone}}/instantSnapshots/{{name}}' |
| 52 | +examples: |
| 53 | + - name: 'instant_snapshot_basic' |
| 54 | + primary_resource_id: 'default' |
| 55 | + primary_resource_name: 'fmt.Sprintf("tf-test-instant-snapshot%s", context["random_suffix"])' |
| 56 | + vars: |
| 57 | + instance_name: 'instant-snapshot' |
| 58 | + disk_name: 'example-disk' |
| 59 | +parameters: |
| 60 | + - name: 'sourceDisk' |
| 61 | + type: ResourceRef |
| 62 | + description: 'A reference to the disk used to create this instant snapshot.' |
| 63 | + required: true |
| 64 | + immutable: true |
| 65 | + diff_suppress_func: 'tpgresource.CompareSelfLinkOrResourceName' |
| 66 | + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.tmpl' |
| 67 | + resource: 'Disk' |
| 68 | + imports: 'name' |
| 69 | + - name: 'zone' |
| 70 | + type: ResourceRef |
| 71 | + description: 'A reference to the zone where the disk is located.' |
| 72 | + default_from_api: true |
| 73 | + required: false |
| 74 | + custom_flatten: 'templates/terraform/custom_flatten/name_from_self_link.tmpl' |
| 75 | + custom_expand: 'templates/terraform/custom_expand/resourceref_with_validation.go.tmpl' |
| 76 | + resource: 'Zone' |
| 77 | + imports: 'name' |
| 78 | +properties: |
| 79 | + - name: 'creationTimestamp' |
| 80 | + type: Time |
| 81 | + description: 'Creation timestamp in RFC3339 text format.' |
| 82 | + output: true |
| 83 | + - name: 'name' |
| 84 | + type: String |
| 85 | + description: | |
| 86 | + Name of the resource; provided by the client when the resource is |
| 87 | + created. The name must be 1-63 characters long, and comply with |
| 88 | + RFC1035. Specifically, the name must be 1-63 characters long and match |
| 89 | + the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the |
| 90 | + first character must be a lowercase letter, and all following |
| 91 | + characters must be a dash, lowercase letter, or digit, except the last |
| 92 | + character, which cannot be a dash. |
| 93 | + required: true |
| 94 | + immutable: true |
| 95 | + - name: 'description' |
| 96 | + type: String |
| 97 | + description: 'An optional description of this resource.' |
| 98 | + required: false |
| 99 | + - name: 'sourceDiskId' |
| 100 | + type: String |
| 101 | + description: 'The ID value of the disk used to create this InstantSnapshot.' |
| 102 | + output: true |
| 103 | + - name: 'diskSizeGb' |
| 104 | + type: Integer |
| 105 | + description: 'Size of the snapshot, specified in GB.' |
| 106 | + output: true |
| 107 | + - name: 'labels' |
| 108 | + type: KeyValueLabels |
| 109 | + description: Labels to apply to this InstantSnapshot. |
| 110 | + update_url: 'projects/{{project}}/zones/{{zone}}/instantSnapshots/{{name}}/setLabels' |
| 111 | + update_verb: 'POST' |
| 112 | + - name: 'labelFingerprint' |
| 113 | + type: Fingerprint |
| 114 | + description: | |
| 115 | + The fingerprint used for optimistic locking of this resource. Used |
| 116 | + internally during updates. |
| 117 | + output: true |
| 118 | + update_url: 'projects/{{project}}/zones/{{zone}}/instantSnapshots/{{name}}/setLabels' |
| 119 | + update_verb: 'POST' |
0 commit comments