Reference documentation and code samples for the Cloud OS Config V1 API class Google::Cloud::OsConfig::V1::OSPolicy::ResourceGroup.
Resource groups provide a mechanism to group OS policy resources.
Resource groups enable OS policy authors to create a single OS policy
to be applied to VMs running different operating Systems.
When the OS policy is applied to a target VM, the appropriate resource
group within the OS policy is selected based on the OSFilter specified
within the resource group.
The resources in this resource group are applied to the target VM if it
satisfies at least one of the following inventory filters.
For example, to apply this resource group to VMs running either RHEL or
CentOS operating systems, specify 2 items for the list with following
values:
inventory_filters[0].os_short_name='rhel' and
inventory_filters[1].os_short_name='centos'
If the list is empty, this resource group will be applied to the target
VM unconditionally.
The resources in this resource group are applied to the target VM if it
satisfies at least one of the following inventory filters.
For example, to apply this resource group to VMs running either RHEL or
CentOS operating systems, specify 2 items for the list with following
values:
inventory_filters[0].os_short_name='rhel' and
inventory_filters[1].os_short_name='centos'
If the list is empty, this resource group will be applied to the target
VM unconditionally.
The resources in this resource group are applied to the target VM if it
satisfies at least one of the following inventory filters.
For example, to apply this resource group to VMs running either RHEL or
CentOS operating systems, specify 2 items for the list with following
values:
inventory_filters[0].os_short_name='rhel' and
inventory_filters[1].os_short_name='centos'
If the list is empty, this resource group will be applied to the target
VM unconditionally.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[],[],null,["# Cloud OS Config V1 API - Class Google::Cloud::OsConfig::V1::OSPolicy::ResourceGroup (v1.4.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.4.0 (latest)](/ruby/docs/reference/google-cloud-os_config-v1/latest/Google-Cloud-OsConfig-V1-OSPolicy-ResourceGroup)\n- [1.3.0](/ruby/docs/reference/google-cloud-os_config-v1/1.3.0/Google-Cloud-OsConfig-V1-OSPolicy-ResourceGroup)\n- [1.2.1](/ruby/docs/reference/google-cloud-os_config-v1/1.2.1/Google-Cloud-OsConfig-V1-OSPolicy-ResourceGroup)\n- [1.1.0](/ruby/docs/reference/google-cloud-os_config-v1/1.1.0/Google-Cloud-OsConfig-V1-OSPolicy-ResourceGroup)\n- [1.0.1](/ruby/docs/reference/google-cloud-os_config-v1/1.0.1/Google-Cloud-OsConfig-V1-OSPolicy-ResourceGroup)\n- [0.16.0](/ruby/docs/reference/google-cloud-os_config-v1/0.16.0/Google-Cloud-OsConfig-V1-OSPolicy-ResourceGroup)\n- [0.15.2](/ruby/docs/reference/google-cloud-os_config-v1/0.15.2/Google-Cloud-OsConfig-V1-OSPolicy-ResourceGroup)\n- [0.14.0](/ruby/docs/reference/google-cloud-os_config-v1/0.14.0/Google-Cloud-OsConfig-V1-OSPolicy-ResourceGroup)\n- [0.13.0](/ruby/docs/reference/google-cloud-os_config-v1/0.13.0/Google-Cloud-OsConfig-V1-OSPolicy-ResourceGroup)\n- [0.12.0](/ruby/docs/reference/google-cloud-os_config-v1/0.12.0/Google-Cloud-OsConfig-V1-OSPolicy-ResourceGroup)\n- [0.11.0](/ruby/docs/reference/google-cloud-os_config-v1/0.11.0/Google-Cloud-OsConfig-V1-OSPolicy-ResourceGroup)\n- [0.10.0](/ruby/docs/reference/google-cloud-os_config-v1/0.10.0/Google-Cloud-OsConfig-V1-OSPolicy-ResourceGroup)\n- [0.9.1](/ruby/docs/reference/google-cloud-os_config-v1/0.9.1/Google-Cloud-OsConfig-V1-OSPolicy-ResourceGroup) \nReference documentation and code samples for the Cloud OS Config V1 API class Google::Cloud::OsConfig::V1::OSPolicy::ResourceGroup.\n\nResource groups provide a mechanism to group OS policy resources.\n\n\nResource groups enable OS policy authors to create a single OS policy\nto be applied to VMs running different operating Systems.\n\n\u003cbr /\u003e\n\nWhen the OS policy is applied to a target VM, the appropriate resource\ngroup within the OS policy is selected based on the `OSFilter` specified\nwithin the resource group. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #inventory_filters\n\n def inventory_filters() -\u003e ::Array\u003c::Google::Cloud::OsConfig::V1::OSPolicy::InventoryFilter\u003e\n\n**Returns**\n\n- (::Array\\\u003c[::Google::Cloud::OsConfig::V1::OSPolicy::InventoryFilter](./Google-Cloud-OsConfig-V1-OSPolicy-InventoryFilter)\\\u003e) --- List of inventory filters for the resource group.\n\n\n The resources in this resource group are applied to the target VM if it\n satisfies at least one of the following inventory filters.\n\n For example, to apply this resource group to VMs running either `RHEL` or\n `CentOS` operating systems, specify 2 items for the list with following\n values:\n inventory_filters\\[0\\].os_short_name='rhel' and\n inventory_filters\\[1\\].os_short_name='centos'\n\n If the list is empty, this resource group will be applied to the target\n VM unconditionally.\n\n### #inventory_filters=\n\n def inventory_filters=(value) -\u003e ::Array\u003c::Google::Cloud::OsConfig::V1::OSPolicy::InventoryFilter\u003e\n\n**Parameter**\n\n- **value** (::Array\\\u003c[::Google::Cloud::OsConfig::V1::OSPolicy::InventoryFilter](./Google-Cloud-OsConfig-V1-OSPolicy-InventoryFilter)\\\u003e) --- List of inventory filters for the resource group.\n\n\n The resources in this resource group are applied to the target VM if it\n satisfies at least one of the following inventory filters.\n\n For example, to apply this resource group to VMs running either `RHEL` or\n `CentOS` operating systems, specify 2 items for the list with following\n values:\n inventory_filters\\[0\\].os_short_name='rhel' and\n inventory_filters\\[1\\].os_short_name='centos'\n\n If the list is empty, this resource group will be applied to the target\nVM unconditionally. \n**Returns**\n\n- (::Array\\\u003c[::Google::Cloud::OsConfig::V1::OSPolicy::InventoryFilter](./Google-Cloud-OsConfig-V1-OSPolicy-InventoryFilter)\\\u003e) --- List of inventory filters for the resource group.\n\n\n The resources in this resource group are applied to the target VM if it\n satisfies at least one of the following inventory filters.\n\n For example, to apply this resource group to VMs running either `RHEL` or\n `CentOS` operating systems, specify 2 items for the list with following\n values:\n inventory_filters\\[0\\].os_short_name='rhel' and\n inventory_filters\\[1\\].os_short_name='centos'\n\n If the list is empty, this resource group will be applied to the target\n VM unconditionally.\n\n### #resources\n\n def resources() -\u003e ::Array\u003c::Google::Cloud::OsConfig::V1::OSPolicy::Resource\u003e\n\n**Returns**\n\n- (::Array\\\u003c[::Google::Cloud::OsConfig::V1::OSPolicy::Resource](./Google-Cloud-OsConfig-V1-OSPolicy-Resource)\\\u003e) --- Required. List of resources configured for this resource group. The resources are executed in the exact order specified here.\n\n### #resources=\n\n def resources=(value) -\u003e ::Array\u003c::Google::Cloud::OsConfig::V1::OSPolicy::Resource\u003e\n\n**Parameter**\n\n- **value** (::Array\\\u003c[::Google::Cloud::OsConfig::V1::OSPolicy::Resource](./Google-Cloud-OsConfig-V1-OSPolicy-Resource)\\\u003e) --- Required. List of resources configured for this resource group. The resources are executed in the exact order specified here. \n**Returns**\n\n- (::Array\\\u003c[::Google::Cloud::OsConfig::V1::OSPolicy::Resource](./Google-Cloud-OsConfig-V1-OSPolicy-Resource)\\\u003e) --- Required. List of resources configured for this resource group. The resources are executed in the exact order specified here."]]