pulumi_wasm_providers_gcp_mini::compute

Module region_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 zonal disks (gcp.compute.Disk). For zonal disks, please refer to the gcp.compute.DiskResourcePolicyAttachment resource.

§Example Usage

§Region Disk Resource Policy Attachment Basic

resources:
  attachment:
    type: gcp:compute:RegionDiskResourcePolicyAttachment
    properties:
      name: ${policy.name}
      disk: ${ssd.name}
      region: us-central1
  disk:
    type: gcp:compute:Disk
    properties:
      name: my-base-disk
      image: debian-cloud/debian-11
      size: 50
      type: pd-ssd
      zone: us-central1-a
  snapdisk:
    type: gcp:compute:Snapshot
    properties:
      name: my-snapshot
      sourceDisk: ${disk.name}
      zone: us-central1-a
  ssd:
    type: gcp:compute:RegionDisk
    properties:
      name: my-disk
      replicaZones:
        - us-central1-a
        - us-central1-f
      snapshot: ${snapdisk.id}
      size: 50
      type: pd-ssd
      region: us-central1
  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

RegionDiskResourcePolicyAttachment can be imported using any of these accepted formats:

  • projects/{{project}}/regions/{{region}}/disks/{{disk}}/{{name}}

  • {{project}}/{{region}}/{{disk}}/{{name}}

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

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

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

$ pulumi import gcp:compute/regionDiskResourcePolicyAttachment:RegionDiskResourcePolicyAttachment default projects/{{project}}/regions/{{region}}/disks/{{disk}}/{{name}}
$ pulumi import gcp:compute/regionDiskResourcePolicyAttachment:RegionDiskResourcePolicyAttachment default {{project}}/{{region}}/{{disk}}/{{name}}
$ pulumi import gcp:compute/regionDiskResourcePolicyAttachment:RegionDiskResourcePolicyAttachment default {{region}}/{{disk}}/{{name}}
$ pulumi import gcp:compute/regionDiskResourcePolicyAttachment:RegionDiskResourcePolicyAttachment default {{disk}}/{{name}}

Structs§

Functions§

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