pulumi_wasm_providers_gcp_mini::compute

Module disk_resource_policy_attachment

source
Expand description

Adds existing resource policies to a disk. You can only add one policy which will be applied to this disk for scheduling snapshot creation.

Note: This resource does not support regional disks (gcp.compute.RegionDisk). For regional disks, please refer to the gcp.compute.RegionDiskResourcePolicyAttachment resource.

§Example Usage

§Disk Resource Policy Attachment Basic

resources:
  attachment:
    type: gcp:compute:DiskResourcePolicyAttachment
    properties:
      name: ${policy.name}
      disk: ${ssd.name}
      zone: us-central1-a
  ssd:
    type: gcp:compute:Disk
    properties:
      name: my-disk
      image: ${myImage.selfLink}
      size: 50
      type: pd-ssd
      zone: us-central1-a
  policy:
    type: gcp:compute:ResourcePolicy
    properties:
      name: my-resource-policy
      region: us-central1
      snapshotSchedulePolicy:
        schedule:
          dailySchedule:
            daysInCycle: 1
            startTime: 04:00
variables:
  myImage:
    fn::invoke:
      function: gcp:compute:getImage
      arguments:
        family: debian-11
        project: debian-cloud

§Import

DiskResourcePolicyAttachment can be imported using any of these accepted formats:

  • projects/{{project}}/zones/{{zone}}/disks/{{disk}}/{{name}}

  • {{project}}/{{zone}}/{{disk}}/{{name}}

  • {{zone}}/{{disk}}/{{name}}

  • {{disk}}/{{name}}

When using the pulumi import command, DiskResourcePolicyAttachment can be imported using one of the formats above. For example:

$ pulumi import gcp:compute/diskResourcePolicyAttachment:DiskResourcePolicyAttachment default projects/{{project}}/zones/{{zone}}/disks/{{disk}}/{{name}}
$ pulumi import gcp:compute/diskResourcePolicyAttachment:DiskResourcePolicyAttachment default {{project}}/{{zone}}/{{disk}}/{{name}}
$ pulumi import gcp:compute/diskResourcePolicyAttachment:DiskResourcePolicyAttachment default {{zone}}/{{disk}}/{{name}}
$ pulumi import gcp:compute/diskResourcePolicyAttachment:DiskResourcePolicyAttachment default {{disk}}/{{name}}

Structs§

Functions§

  • Registers a new resource with the given unique name and arguments