UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

165 lines (164 loc) 5.94 kB
import * as pulumi from "@pulumi/pulumi"; /** * 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 * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const myImage = gcp.compute.getImage({ * family: "debian-11", * project: "debian-cloud", * }); * const ssd = new gcp.compute.Disk("ssd", { * name: "my-disk", * image: myImage.then(myImage => myImage.selfLink), * size: 50, * type: "pd-ssd", * zone: "us-central1-a", * }); * const policy = new gcp.compute.ResourcePolicy("policy", { * name: "my-resource-policy", * region: "us-central1", * snapshotSchedulePolicy: { * schedule: { * dailySchedule: { * daysInCycle: 1, * startTime: "04:00", * }, * }, * }, * }); * const attachment = new gcp.compute.DiskResourcePolicyAttachment("attachment", { * name: policy.name, * disk: ssd.name, * zone: "us-central1-a", * }); * ``` * * ## 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: * * ```sh * $ pulumi import gcp:compute/diskResourcePolicyAttachment:DiskResourcePolicyAttachment default projects/{{project}}/zones/{{zone}}/disks/{{disk}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:compute/diskResourcePolicyAttachment:DiskResourcePolicyAttachment default {{project}}/{{zone}}/{{disk}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:compute/diskResourcePolicyAttachment:DiskResourcePolicyAttachment default {{zone}}/{{disk}}/{{name}} * ``` * * ```sh * $ pulumi import gcp:compute/diskResourcePolicyAttachment:DiskResourcePolicyAttachment default {{disk}}/{{name}} * ``` */ export declare class DiskResourcePolicyAttachment extends pulumi.CustomResource { /** * Get an existing DiskResourcePolicyAttachment resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DiskResourcePolicyAttachmentState, opts?: pulumi.CustomResourceOptions): DiskResourcePolicyAttachment; /** * Returns true if the given object is an instance of DiskResourcePolicyAttachment. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is DiskResourcePolicyAttachment; /** * The name of the disk in which the resource policies are attached to. */ readonly disk: pulumi.Output<string>; /** * The resource policy to be attached to the disk for scheduling snapshot * creation. Do not specify the self link. */ readonly name: pulumi.Output<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output<string>; /** * A reference to the zone where the disk resides. */ readonly zone: pulumi.Output<string>; /** * Create a DiskResourcePolicyAttachment resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: DiskResourcePolicyAttachmentArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering DiskResourcePolicyAttachment resources. */ export interface DiskResourcePolicyAttachmentState { /** * The name of the disk in which the resource policies are attached to. */ disk?: pulumi.Input<string>; /** * The resource policy to be attached to the disk for scheduling snapshot * creation. Do not specify the self link. */ name?: pulumi.Input<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; /** * A reference to the zone where the disk resides. */ zone?: pulumi.Input<string>; } /** * The set of arguments for constructing a DiskResourcePolicyAttachment resource. */ export interface DiskResourcePolicyAttachmentArgs { /** * The name of the disk in which the resource policies are attached to. */ disk: pulumi.Input<string>; /** * The resource policy to be attached to the disk for scheduling snapshot * creation. Do not specify the self link. */ name?: pulumi.Input<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; /** * A reference to the zone where the disk resides. */ zone?: pulumi.Input<string>; }