Property | Value |
---|---|
Google Cloud Service Name | Compute Engine |
Google Cloud Service Documentation | /compute/docs/ |
Google Cloud REST Resource Name | v1.resourcePolicies |
Google Cloud REST Resource Documentation | /compute/docs/reference/rest/v1/resourcePolicies |
Config Connector Resource Short Name | gcpcomputeresourcepolicy gcpcomputeresourcepolicies computeresourcepolicy |
Config Connector Resource Fully Qualified Name | computeresourcepolicies.compute.cnrm.cloud.google.com |
Can Be Referenced by IAMPolicy/IAMPolicyMember | No |
Custom Resource Definition Properties
Annotations
Fields | |
---|---|
cnrm.cloud.google.com/project-id |
Spec
Schema
groupPlacementPolicy:
availabilityDomainCount: integer
collocation: string
vmCount: integer
region: string
resourceID: string
snapshotSchedulePolicy:
retentionPolicy:
maxRetentionDays: integer
onSourceDiskDelete: string
schedule:
dailySchedule:
daysInCycle: integer
startTime: string
hourlySchedule:
hoursInCycle: integer
startTime: string
weeklySchedule:
dayOfWeeks:
- day: string
startTime: string
snapshotProperties:
guestFlush: boolean
labels:
string: string
storageLocations:
- string
Fields | |
---|---|
Optional |
Immutable. Policy for creating snapshots of persistent disks. |
Optional |
Immutable. The number of availability domains instances will be spread across. If two instances are in different availability domain, they will not be put in the same low latency network |
Optional |
Immutable. Collocation specifies whether to place VMs inside the same availability domain on the same low-latency network. Specify 'COLLOCATED' to enable collocation. Can only be specified with 'vm_count'. If compute instances are created with a COLLOCATED policy, then exactly 'vm_count' instances must be created at the same time with the resource policy attached. Possible values: ["COLLOCATED"] |
Optional |
Immutable. Number of vms in this placement group. |
Required |
Immutable. Region where resource policy resides. |
Optional |
Immutable. Optional. The name of the resource. Used for creation and acquisition. When unset, the value of `metadata.name` is used as the default. |
Optional |
Immutable. Policy for creating snapshots of persistent disks. |
Optional |
Immutable. Retention policy applied to snapshots created by this resource policy. |
Required* |
Immutable. Maximum age of the snapshot that is allowed to be kept. |
Optional |
Immutable. Specifies the behavior to apply to scheduled snapshots when the source disk is deleted. Default value: "KEEP_AUTO_SNAPSHOTS" Possible values: ["KEEP_AUTO_SNAPSHOTS", "APPLY_RETENTION_POLICY"] |
Required* |
Immutable. Contains one of an 'hourlySchedule', 'dailySchedule', or 'weeklySchedule'. |
Optional |
Immutable. The policy will execute every nth day at the specified time. |
Required* |
Immutable. The number of days between snapshots. |
Required* |
Immutable. This must be in UTC format that resolves to one of 00:00, 04:00, 08:00, 12:00, 16:00, or 20:00. For example, both 13:00-5 and 08:00 are valid. |
Optional |
Immutable. The policy will execute every nth hour starting at the specified time. |
Required* |
Immutable. The number of hours between snapshots. |
Required* |
Immutable. Time within the window to start the operations. It must be in an hourly format "HH:MM", where HH : [00-23] and MM : [00] GMT. eg: 21:00 |
Optional |
Immutable. Allows specifying a snapshot time for each day of the week. |
Required* |
Immutable. May contain up to seven (one for each day of the week) snapshot times. |
Required* |
|
Required* |
Immutable. The day of the week to create the snapshot. e.g. MONDAY Possible values: ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"] |
Required* |
Immutable. Time within the window to start the operations. It must be in format "HH:MM", where HH : [00-23] and MM : [00-00] GMT. |
Optional |
Immutable. Properties with which the snapshots are created, such as labels. |
Optional |
Immutable. Whether to perform a 'guest aware' snapshot. |
Optional |
Immutable. A set of key-value pairs. |
Optional |
Immutable. Cloud Storage bucket location to store the auto snapshot (regional or multi-regional) |
Optional |
|
* Field is required when parent field is specified
Status
Schema
conditions:
- lastTransitionTime: string
message: string
reason: string
status: string
type: string
selfLink: string
Fields | |
---|---|
conditions |
Conditions represents the latest available observation of the resource's current state. |
conditions.[] |
|
conditions.[].lastTransitionTime |
Last time the condition transitioned from one status to another. |
conditions.[].message |
Human-readable message indicating details about last transition. |
conditions.[].reason |
Unique, one-word, CamelCase reason for the condition's last transition. |
conditions.[].status |
Status is the status of the condition. Can be True, False, Unknown. |
conditions.[].type |
Type is the type of the condition. |
selfLink |
|
Sample YAML(s)
Daily Resource Policy Schedule
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeResourcePolicy
metadata:
name: computeresourcepolicy-sample-dailyschedule
spec:
region: us-central1
snapshotSchedulePolicy:
schedule:
dailySchedule:
daysInCycle: 1
startTime: "00:00"
retentionPolicy:
maxRetentionDays: 8
onSourceDiskDelete: KEEP_AUTO_SNAPSHOTS
snapshotProperties:
storageLocations:
- us-central1
guestFlush: true
labels:
autodeleted: "false"
interval: "daily"
Hourly Resource Policy Schedule
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeResourcePolicy
metadata:
name: computeresourcepolicy-sample-hourlyschedule
spec:
region: us-central1
snapshotSchedulePolicy:
schedule:
hourlySchedule:
hoursInCycle: 4
startTime: "13:00"
retentionPolicy:
maxRetentionDays: 2
onSourceDiskDelete: APPLY_RETENTION_POLICY
snapshotProperties:
labels:
autodeleted: "true"
interval: "hourly"
Weekly Resource Policy Schedule
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeResourcePolicy
metadata:
name: computeresourcepolicy-sample-weeklyschedule
spec:
region: us-central1
snapshotSchedulePolicy:
schedule:
weeklySchedule:
dayOfWeeks:
- startTime: "08:00"
day: MONDAY
- startTime: "15:00"
day: WEDNESDAY
- startTime: "23:00"
day: FRIDAY
retentionPolicy:
maxRetentionDays: 12
snapshotProperties:
storageLocations:
- us
guestFlush: false
labels:
autodeleted: "false"
interval: "weekly"