ResourcePolicy

A policy that can be attached to a resource to specify or schedule actions on that resource.

Create a ResourcePolicy Resource

def ResourcePolicy(resource_name, opts=None, group_placement_policy=None, name=None, project=None, region=None, snapshot_schedule_policy=None, __props__=None);
public ResourcePolicy(string name, ResourcePolicyArgs? args = null, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args ResourcePolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ResourcePolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ResourcePolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

ResourcePolicy Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The ResourcePolicy resource accepts the following input properties:

GroupPlacementPolicy ResourcePolicyGroupPlacementPolicyArgs

Policy for creating snapshots of persistent disks. Structure is documented below.

Name string

The name of the resource, provided by the client when initially creating the resource. The resource 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 a-z? 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.

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Region string

Region where resource policy resides.

SnapshotSchedulePolicy ResourcePolicySnapshotSchedulePolicyArgs

Policy for creating snapshots of persistent disks. Structure is documented below.

GroupPlacementPolicy ResourcePolicyGroupPlacementPolicy

Policy for creating snapshots of persistent disks. Structure is documented below.

Name string

The name of the resource, provided by the client when initially creating the resource. The resource 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 a-z? 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.

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Region string

Region where resource policy resides.

SnapshotSchedulePolicy ResourcePolicySnapshotSchedulePolicy

Policy for creating snapshots of persistent disks. Structure is documented below.

groupPlacementPolicy ResourcePolicyGroupPlacementPolicy

Policy for creating snapshots of persistent disks. Structure is documented below.

name string

The name of the resource, provided by the client when initially creating the resource. The resource 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 a-z? 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.

project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

region string

Region where resource policy resides.

snapshotSchedulePolicy ResourcePolicySnapshotSchedulePolicy

Policy for creating snapshots of persistent disks. Structure is documented below.

group_placement_policy Dict[ResourcePolicyGroupPlacementPolicy]

Policy for creating snapshots of persistent disks. Structure is documented below.

name str

The name of the resource, provided by the client when initially creating the resource. The resource 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 a-z? 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.

project str

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

region str

Region where resource policy resides.

snapshot_schedule_policy Dict[ResourcePolicySnapshotSchedulePolicy]

Policy for creating snapshots of persistent disks. Structure is documented below.

Outputs

All input properties are implicitly available as output properties. Additionally, the ResourcePolicy resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
SelfLink string

The URI of the created resource.

Id string
The provider-assigned unique ID for this managed resource.
SelfLink string

The URI of the created resource.

id string
The provider-assigned unique ID for this managed resource.
selfLink string

The URI of the created resource.

id str
The provider-assigned unique ID for this managed resource.
self_link str

The URI of the created resource.

Look up an Existing ResourcePolicy Resource

Get an existing ResourcePolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ResourcePolicyState, opts?: CustomResourceOptions): ResourcePolicy
static get(resource_name, id, opts=None, group_placement_policy=None, name=None, project=None, region=None, self_link=None, snapshot_schedule_policy=None, __props__=None);
func GetResourcePolicy(ctx *Context, name string, id IDInput, state *ResourcePolicyState, opts ...ResourceOption) (*ResourcePolicy, error)
public static ResourcePolicy Get(string name, Input<string> id, ResourcePolicyState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

GroupPlacementPolicy ResourcePolicyGroupPlacementPolicyArgs

Policy for creating snapshots of persistent disks. Structure is documented below.

Name string

The name of the resource, provided by the client when initially creating the resource. The resource 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 a-z? 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.

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Region string

Region where resource policy resides.

SelfLink string

The URI of the created resource.

SnapshotSchedulePolicy ResourcePolicySnapshotSchedulePolicyArgs

Policy for creating snapshots of persistent disks. Structure is documented below.

GroupPlacementPolicy ResourcePolicyGroupPlacementPolicy

Policy for creating snapshots of persistent disks. Structure is documented below.

Name string

The name of the resource, provided by the client when initially creating the resource. The resource 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 a-z? 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.

Project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Region string

Region where resource policy resides.

SelfLink string

The URI of the created resource.

SnapshotSchedulePolicy ResourcePolicySnapshotSchedulePolicy

Policy for creating snapshots of persistent disks. Structure is documented below.

groupPlacementPolicy ResourcePolicyGroupPlacementPolicy

Policy for creating snapshots of persistent disks. Structure is documented below.

name string

The name of the resource, provided by the client when initially creating the resource. The resource 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 a-z? 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.

project string

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

region string

Region where resource policy resides.

selfLink string

The URI of the created resource.

snapshotSchedulePolicy ResourcePolicySnapshotSchedulePolicy

Policy for creating snapshots of persistent disks. Structure is documented below.

group_placement_policy Dict[ResourcePolicyGroupPlacementPolicy]

Policy for creating snapshots of persistent disks. Structure is documented below.

name str

The name of the resource, provided by the client when initially creating the resource. The resource 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 a-z? 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.

project str

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

region str

Region where resource policy resides.

self_link str

The URI of the created resource.

snapshot_schedule_policy Dict[ResourcePolicySnapshotSchedulePolicy]

Policy for creating snapshots of persistent disks. Structure is documented below.

Supporting Types

ResourcePolicyGroupPlacementPolicy

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

AvailabilityDomainCount int

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

Collocation string

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.

VmCount int

Number of vms in this placement group.

AvailabilityDomainCount int

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

Collocation string

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.

VmCount int

Number of vms in this placement group.

availabilityDomainCount number

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

collocation string

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.

vmCount number

Number of vms in this placement group.

availabilityDomainCount float

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

collocation str

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.

vmCount float

Number of vms in this placement group.

ResourcePolicySnapshotSchedulePolicy

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Schedule ResourcePolicySnapshotSchedulePolicyScheduleArgs

Contains one of an hourlySchedule, dailySchedule, or weeklySchedule. Structure is documented below.

RetentionPolicy ResourcePolicySnapshotSchedulePolicyRetentionPolicyArgs

Retention policy applied to snapshots created by this resource policy. Structure is documented below.

SnapshotProperties ResourcePolicySnapshotSchedulePolicySnapshotPropertiesArgs

Properties with which the snapshots are created, such as labels. Structure is documented below.

Schedule ResourcePolicySnapshotSchedulePolicySchedule

Contains one of an hourlySchedule, dailySchedule, or weeklySchedule. Structure is documented below.

RetentionPolicy ResourcePolicySnapshotSchedulePolicyRetentionPolicy

Retention policy applied to snapshots created by this resource policy. Structure is documented below.

SnapshotProperties ResourcePolicySnapshotSchedulePolicySnapshotProperties

Properties with which the snapshots are created, such as labels. Structure is documented below.

schedule ResourcePolicySnapshotSchedulePolicySchedule

Contains one of an hourlySchedule, dailySchedule, or weeklySchedule. Structure is documented below.

retentionPolicy ResourcePolicySnapshotSchedulePolicyRetentionPolicy

Retention policy applied to snapshots created by this resource policy. Structure is documented below.

snapshotProperties ResourcePolicySnapshotSchedulePolicySnapshotProperties

Properties with which the snapshots are created, such as labels. Structure is documented below.

schedule Dict[ResourcePolicySnapshotSchedulePolicySchedule]

Contains one of an hourlySchedule, dailySchedule, or weeklySchedule. Structure is documented below.

retention_policy Dict[ResourcePolicySnapshotSchedulePolicyRetentionPolicy]

Retention policy applied to snapshots created by this resource policy. Structure is documented below.

snapshotProperties Dict[ResourcePolicySnapshotSchedulePolicySnapshotProperties]

Properties with which the snapshots are created, such as labels. Structure is documented below.

ResourcePolicySnapshotSchedulePolicyRetentionPolicy

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

MaxRetentionDays int

Maximum age of the snapshot that is allowed to be kept.

OnSourceDiskDelete string

Specifies the behavior to apply to scheduled snapshots when the source disk is deleted.

MaxRetentionDays int

Maximum age of the snapshot that is allowed to be kept.

OnSourceDiskDelete string

Specifies the behavior to apply to scheduled snapshots when the source disk is deleted.

maxRetentionDays number

Maximum age of the snapshot that is allowed to be kept.

onSourceDiskDelete string

Specifies the behavior to apply to scheduled snapshots when the source disk is deleted.

maxRetentionDays float

Maximum age of the snapshot that is allowed to be kept.

onSourceDiskDelete str

Specifies the behavior to apply to scheduled snapshots when the source disk is deleted.

ResourcePolicySnapshotSchedulePolicySchedule

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

DailySchedule ResourcePolicySnapshotSchedulePolicyScheduleDailyScheduleArgs

The policy will execute every nth day at the specified time. Structure is documented below.

HourlySchedule ResourcePolicySnapshotSchedulePolicyScheduleHourlyScheduleArgs

The policy will execute every nth hour starting at the specified time. Structure is documented below.

WeeklySchedule ResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleArgs

Allows specifying a snapshot time for each day of the week. Structure is documented below.

DailySchedule ResourcePolicySnapshotSchedulePolicyScheduleDailySchedule

The policy will execute every nth day at the specified time. Structure is documented below.

HourlySchedule ResourcePolicySnapshotSchedulePolicyScheduleHourlySchedule

The policy will execute every nth hour starting at the specified time. Structure is documented below.

WeeklySchedule ResourcePolicySnapshotSchedulePolicyScheduleWeeklySchedule

Allows specifying a snapshot time for each day of the week. Structure is documented below.

dailySchedule ResourcePolicySnapshotSchedulePolicyScheduleDailySchedule

The policy will execute every nth day at the specified time. Structure is documented below.

hourlySchedule ResourcePolicySnapshotSchedulePolicyScheduleHourlySchedule

The policy will execute every nth hour starting at the specified time. Structure is documented below.

weeklySchedule ResourcePolicySnapshotSchedulePolicyScheduleWeeklySchedule

Allows specifying a snapshot time for each day of the week. Structure is documented below.

dailySchedule Dict[ResourcePolicySnapshotSchedulePolicyScheduleDailySchedule]

The policy will execute every nth day at the specified time. Structure is documented below.

hourlySchedule Dict[ResourcePolicySnapshotSchedulePolicyScheduleHourlySchedule]

The policy will execute every nth hour starting at the specified time. Structure is documented below.

weeklySchedule Dict[ResourcePolicySnapshotSchedulePolicyScheduleWeeklySchedule]

Allows specifying a snapshot time for each day of the week. Structure is documented below.

ResourcePolicySnapshotSchedulePolicyScheduleDailySchedule

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

DaysInCycle int

The number of days between snapshots.

StartTime string

Time within the window to start the operations. It must be in format “HH:MM”, where HH : [00-23] and MM : [00-00] GMT.

DaysInCycle int

The number of days between snapshots.

StartTime string

Time within the window to start the operations. It must be in format “HH:MM”, where HH : [00-23] and MM : [00-00] GMT.

daysInCycle number

The number of days between snapshots.

startTime string

Time within the window to start the operations. It must be in format “HH:MM”, where HH : [00-23] and MM : [00-00] GMT.

daysInCycle float

The number of days between snapshots.

startTime str

Time within the window to start the operations. It must be in format “HH:MM”, where HH : [00-23] and MM : [00-00] GMT.

ResourcePolicySnapshotSchedulePolicyScheduleHourlySchedule

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

HoursInCycle int

The number of hours between snapshots.

StartTime string

Time within the window to start the operations. It must be in format “HH:MM”, where HH : [00-23] and MM : [00-00] GMT.

HoursInCycle int

The number of hours between snapshots.

StartTime string

Time within the window to start the operations. It must be in format “HH:MM”, where HH : [00-23] and MM : [00-00] GMT.

hoursInCycle number

The number of hours between snapshots.

startTime string

Time within the window to start the operations. It must be in format “HH:MM”, where HH : [00-23] and MM : [00-00] GMT.

hoursInCycle float

The number of hours between snapshots.

startTime str

Time within the window to start the operations. It must be in format “HH:MM”, where HH : [00-23] and MM : [00-00] GMT.

ResourcePolicySnapshotSchedulePolicyScheduleWeeklySchedule

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

DayOfWeeks List<ResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeekArgs>

May contain up to seven (one for each day of the week) snapshot times. Structure is documented below.

DayOfWeeks []ResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeek

May contain up to seven (one for each day of the week) snapshot times. Structure is documented below.

dayOfWeeks ResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeek[]

May contain up to seven (one for each day of the week) snapshot times. Structure is documented below.

dayOfWeeks List[ResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeek]

May contain up to seven (one for each day of the week) snapshot times. Structure is documented below.

ResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeek

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Day string

The day of the week to create the snapshot. e.g. MONDAY

StartTime string

Time within the window to start the operations. It must be in format “HH:MM”, where HH : [00-23] and MM : [00-00] GMT.

Day string

The day of the week to create the snapshot. e.g. MONDAY

StartTime string

Time within the window to start the operations. It must be in format “HH:MM”, where HH : [00-23] and MM : [00-00] GMT.

day string

The day of the week to create the snapshot. e.g. MONDAY

startTime string

Time within the window to start the operations. It must be in format “HH:MM”, where HH : [00-23] and MM : [00-00] GMT.

day str

The day of the week to create the snapshot. e.g. MONDAY

startTime str

Time within the window to start the operations. It must be in format “HH:MM”, where HH : [00-23] and MM : [00-00] GMT.

ResourcePolicySnapshotSchedulePolicySnapshotProperties

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

GuestFlush bool

Whether to perform a ‘guest aware’ snapshot.

Labels Dictionary<string, string>

A set of key-value pairs.

StorageLocations string

Cloud Storage bucket location to store the auto snapshot (regional or multi-regional)

GuestFlush bool

Whether to perform a ‘guest aware’ snapshot.

Labels map[string]string

A set of key-value pairs.

StorageLocations string

Cloud Storage bucket location to store the auto snapshot (regional or multi-regional)

guestFlush boolean

Whether to perform a ‘guest aware’ snapshot.

labels {[key: string]: string}

A set of key-value pairs.

storageLocations string

Cloud Storage bucket location to store the auto snapshot (regional or multi-regional)

guestFlush bool

Whether to perform a ‘guest aware’ snapshot.

labels Dict[str, str]

A set of key-value pairs.

storageLocations str

Cloud Storage bucket location to store the auto snapshot (regional or multi-regional)

Package Details

Repository
https://github.com/pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.