Project: Chef InSpec (Provisioning / Security & Compliance)
File: google_compute_snapshot.md

+++ title = "googlecomputesnapshot resource" draft = false gh_repo = "inspec" platform = "gcp" [menu] [menu.inspec] title = "googlecomputesnapshot" identifier = "inspec/resources/gcp/googlecomputesnapshot.md googlecomputesnapshot resource" parent = "inspec/resources/gcp" +++ A `googlecomputesnapshot` is used to test a Google Snapshot resource This resource has beta fields available. To retrieve these fields, include `beta: true` in the constructor for the resource ```ruby describe googlecomputesnapshot(project: 'chef-gcp-inspec', name: 'inspec-gcp-disk-snapshot') do it { should exist } its('source_disk') { should match 'inspec-snapshot-disk' } end describe googlecomputesnapshot(project: 'chef-gcp-inspec', name: 'nonexistent') do it { should_not exist } end ``` Properties that can be accessed from the `googlecomputesnapshot` resource: `creation_timestamp` : Creation timestamp in RFC3339 text format. `id` : The unique identifier for the resource. `disksizegb` : Size of the snapshot, specified in GB. `name` : Name of the resource; provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. `description` : An optional description of this resource. `storage_bytes` : A size of the the storage used by the snapshot. As snapshots share storage, this number is expected to change with snapshot creation/deletion. `licenses` : A list of public visible licenses that apply to this snapshot. This can be because the original image had licenses attached (such as a Windows image). snapshotEncryptionKey nested object Encrypts the snapshot using a customer-supplied encryption key. `labels` : Labels to apply to this Snapshot. `label_fingerprint` : The fingerprint used for optimistic locking of this resource. Used internally during updates. `source_disk` : A reference to the disk used to create this snapshot. `zone` : A reference to the zone where the disk is hosted. `snapshotencryptionkey` : The customer -supplied encryption key of the snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. `raw_key` : Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. `sha256` : The RFC 4648 base64 encoded SHA-256 hash of the customer-supplied encryption key that protects this resource. `kmskeyname` : The name of the encryption key that is stored in Google Cloud KMS. `sourcediskencryption_key` : The customer -supplied encryption key of the source snapshot. Required if the source snapshot is protected by a customer-supplied encryption key. `raw_key` : Specifies a 256-bit customer-supplied encryption key, encoded in RFC 4648 base64 to either encrypt or decrypt this resource. `kmskeyname` : The name of the encryption key that is stored in Google Cloud KMS. Ensure the is enabled for the current project.