ResourcePolicy
A policy that can be attached to a resource to specify or schedule actions on that resource.
Create a ResourcePolicy Resource
new ResourcePolicy(name: string, args?: ResourcePolicyArgs, opts?: CustomResourceOptions);def ResourcePolicy(resource_name, opts=None, group_placement_policy=None, name=None, project=None, region=None, snapshot_schedule_policy=None, __props__=None);func NewResourcePolicy(ctx *Context, name string, args *ResourcePolicyArgs, opts ...ResourceOption) (*ResourcePolicy, error)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:
- Group
Placement ResourcePolicy Policy Group Placement Policy Args 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.
- Snapshot
Schedule ResourcePolicy Policy Snapshot Schedule Policy Args Policy for creating snapshots of persistent disks. Structure is documented below.
- Group
Placement ResourcePolicy Policy Group Placement Policy 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.
- Snapshot
Schedule ResourcePolicy Policy Snapshot Schedule Policy Policy for creating snapshots of persistent disks. Structure is documented below.
- group
Placement ResourcePolicy Policy Group Placement Policy 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.
- snapshot
Schedule ResourcePolicy Policy Snapshot Schedule Policy Policy for creating snapshots of persistent disks. Structure is documented below.
- group_
placement_ Dict[Resourcepolicy Policy Group Placement Policy] 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_ Dict[Resourcepolicy Policy Snapshot Schedule Policy] 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:
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): ResourcePolicystatic 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:
- Group
Placement ResourcePolicy Policy Group Placement Policy Args 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.
- Self
Link string The URI of the created resource.
- Snapshot
Schedule ResourcePolicy Policy Snapshot Schedule Policy Args Policy for creating snapshots of persistent disks. Structure is documented below.
- Group
Placement ResourcePolicy Policy Group Placement Policy 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.
- Self
Link string The URI of the created resource.
- Snapshot
Schedule ResourcePolicy Policy Snapshot Schedule Policy Policy for creating snapshots of persistent disks. Structure is documented below.
- group
Placement ResourcePolicy Policy Group Placement Policy 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.
- self
Link string The URI of the created resource.
- snapshot
Schedule ResourcePolicy Policy Snapshot Schedule Policy Policy for creating snapshots of persistent disks. Structure is documented below.
- group_
placement_ Dict[Resourcepolicy Policy Group Placement Policy] 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_ Dict[Resourcepolicy Policy Snapshot Schedule Policy] Policy for creating snapshots of persistent disks. Structure is documented below.
Supporting Types
ResourcePolicyGroupPlacementPolicy
- Availability
Domain intCount 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
COLLOCATEDto enable collocation. Can only be specified withvm_count. If compute instances are created with a COLLOCATED policy, then exactlyvm_countinstances must be created at the same time with the resource policy attached.- Vm
Count int Number of vms in this placement group.
- Availability
Domain intCount 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
COLLOCATEDto enable collocation. Can only be specified withvm_count. If compute instances are created with a COLLOCATED policy, then exactlyvm_countinstances must be created at the same time with the resource policy attached.- Vm
Count int Number of vms in this placement group.
- availability
Domain numberCount 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
COLLOCATEDto enable collocation. Can only be specified withvm_count. If compute instances are created with a COLLOCATED policy, then exactlyvm_countinstances must be created at the same time with the resource policy attached.- vm
Count number Number of vms in this placement group.
- availability
Domain floatCount 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
COLLOCATEDto enable collocation. Can only be specified withvm_count. If compute instances are created with a COLLOCATED policy, then exactlyvm_countinstances must be created at the same time with the resource policy attached.- vm
Count float Number of vms in this placement group.
ResourcePolicySnapshotSchedulePolicy
- Schedule
Resource
Policy Snapshot Schedule Policy Schedule Args Contains one of an
hourlySchedule,dailySchedule, orweeklySchedule. Structure is documented below.- Retention
Policy ResourcePolicy Snapshot Schedule Policy Retention Policy Args Retention policy applied to snapshots created by this resource policy. Structure is documented below.
- Snapshot
Properties ResourcePolicy Snapshot Schedule Policy Snapshot Properties Args Properties with which the snapshots are created, such as labels. Structure is documented below.
- Schedule
Resource
Policy Snapshot Schedule Policy Schedule Contains one of an
hourlySchedule,dailySchedule, orweeklySchedule. Structure is documented below.- Retention
Policy ResourcePolicy Snapshot Schedule Policy Retention Policy Retention policy applied to snapshots created by this resource policy. Structure is documented below.
- Snapshot
Properties ResourcePolicy Snapshot Schedule Policy Snapshot Properties Properties with which the snapshots are created, such as labels. Structure is documented below.
- schedule
Resource
Policy Snapshot Schedule Policy Schedule Contains one of an
hourlySchedule,dailySchedule, orweeklySchedule. Structure is documented below.- retention
Policy ResourcePolicy Snapshot Schedule Policy Retention Policy Retention policy applied to snapshots created by this resource policy. Structure is documented below.
- snapshot
Properties ResourcePolicy Snapshot Schedule Policy Snapshot Properties Properties with which the snapshots are created, such as labels. Structure is documented below.
- schedule
Dict[Resource
Policy Snapshot Schedule Policy Schedule] Contains one of an
hourlySchedule,dailySchedule, orweeklySchedule. Structure is documented below.- retention_
policy Dict[ResourcePolicy Snapshot Schedule Policy Retention Policy] Retention policy applied to snapshots created by this resource policy. Structure is documented below.
- snapshot
Properties Dict[ResourcePolicy Snapshot Schedule Policy Snapshot Properties] Properties with which the snapshots are created, such as labels. Structure is documented below.
ResourcePolicySnapshotSchedulePolicyRetentionPolicy
- Max
Retention intDays Maximum age of the snapshot that is allowed to be kept.
- On
Source stringDisk Delete Specifies the behavior to apply to scheduled snapshots when the source disk is deleted.
- Max
Retention intDays Maximum age of the snapshot that is allowed to be kept.
- On
Source stringDisk Delete Specifies the behavior to apply to scheduled snapshots when the source disk is deleted.
- max
Retention numberDays Maximum age of the snapshot that is allowed to be kept.
- on
Source stringDisk Delete Specifies the behavior to apply to scheduled snapshots when the source disk is deleted.
- max
Retention floatDays Maximum age of the snapshot that is allowed to be kept.
- on
Source strDisk Delete Specifies the behavior to apply to scheduled snapshots when the source disk is deleted.
ResourcePolicySnapshotSchedulePolicySchedule
- Daily
Schedule ResourcePolicy Snapshot Schedule Policy Schedule Daily Schedule Args The policy will execute every nth day at the specified time. Structure is documented below.
- Hourly
Schedule ResourcePolicy Snapshot Schedule Policy Schedule Hourly Schedule Args The policy will execute every nth hour starting at the specified time. Structure is documented below.
- Weekly
Schedule ResourcePolicy Snapshot Schedule Policy Schedule Weekly Schedule Args Allows specifying a snapshot time for each day of the week. Structure is documented below.
- Daily
Schedule ResourcePolicy Snapshot Schedule Policy Schedule Daily Schedule The policy will execute every nth day at the specified time. Structure is documented below.
- Hourly
Schedule ResourcePolicy Snapshot Schedule Policy Schedule Hourly Schedule The policy will execute every nth hour starting at the specified time. Structure is documented below.
- Weekly
Schedule ResourcePolicy Snapshot Schedule Policy Schedule Weekly Schedule Allows specifying a snapshot time for each day of the week. Structure is documented below.
- daily
Schedule ResourcePolicy Snapshot Schedule Policy Schedule Daily Schedule The policy will execute every nth day at the specified time. Structure is documented below.
- hourly
Schedule ResourcePolicy Snapshot Schedule Policy Schedule Hourly Schedule The policy will execute every nth hour starting at the specified time. Structure is documented below.
- weekly
Schedule ResourcePolicy Snapshot Schedule Policy Schedule Weekly Schedule Allows specifying a snapshot time for each day of the week. Structure is documented below.
- daily
Schedule Dict[ResourcePolicy Snapshot Schedule Policy Schedule Daily Schedule] The policy will execute every nth day at the specified time. Structure is documented below.
- hourly
Schedule Dict[ResourcePolicy Snapshot Schedule Policy Schedule Hourly Schedule] The policy will execute every nth hour starting at the specified time. Structure is documented below.
- weekly
Schedule Dict[ResourcePolicy Snapshot Schedule Policy Schedule Weekly Schedule] Allows specifying a snapshot time for each day of the week. Structure is documented below.
ResourcePolicySnapshotSchedulePolicyScheduleDailySchedule
- Days
In intCycle The number of days between snapshots.
- Start
Time 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.
- Days
In intCycle The number of days between snapshots.
- Start
Time 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.
- days
In numberCycle The number of days between snapshots.
- start
Time 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.
- days
In floatCycle The number of days between snapshots.
- start
Time 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
- Hours
In intCycle The number of hours between snapshots.
- Start
Time 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.
- Hours
In intCycle The number of hours between snapshots.
- Start
Time 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.
- hours
In numberCycle The number of hours between snapshots.
- start
Time 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.
- hours
In floatCycle The number of hours between snapshots.
- start
Time 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
- Day
Of List<ResourceWeeks Policy Snapshot Schedule Policy Schedule Weekly Schedule Day Of Week Args> May contain up to seven (one for each day of the week) snapshot times. Structure is documented below.
- Day
Of []ResourceWeeks Policy Snapshot Schedule Policy Schedule Weekly Schedule Day Of Week May contain up to seven (one for each day of the week) snapshot times. Structure is documented below.
- day
Of ResourceWeeks Policy Snapshot Schedule Policy Schedule Weekly Schedule Day Of Week[] May contain up to seven (one for each day of the week) snapshot times. Structure is documented below.
- day
Of List[ResourceWeeks Policy Snapshot Schedule Policy Schedule Weekly Schedule Day Of Week] May contain up to seven (one for each day of the week) snapshot times. Structure is documented below.
ResourcePolicySnapshotSchedulePolicyScheduleWeeklyScheduleDayOfWeek
ResourcePolicySnapshotSchedulePolicySnapshotProperties
- Guest
Flush bool Whether to perform a ‘guest aware’ snapshot.
- Labels Dictionary<string, string>
A set of key-value pairs.
- Storage
Locations string Cloud Storage bucket location to store the auto snapshot (regional or multi-regional)
- Guest
Flush bool Whether to perform a ‘guest aware’ snapshot.
- Labels map[string]string
A set of key-value pairs.
- Storage
Locations string Cloud Storage bucket location to store the auto snapshot (regional or multi-regional)
- guest
Flush boolean Whether to perform a ‘guest aware’ snapshot.
- labels {[key: string]: string}
A set of key-value pairs.
- storage
Locations string Cloud Storage bucket location to store the auto snapshot (regional or multi-regional)
- guest
Flush bool Whether to perform a ‘guest aware’ snapshot.
- labels Dict[str, str]
A set of key-value pairs.
- storage
Locations 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-betaTerraform Provider.