Instance - Querying the instances from the lists of compartment¶
Set the OCI_COMPARTMENTS environment variable with the compartment OCID’s like below. Multiple compartments can be separated by comma. By default, without OCI_COMPARTMENTS environment variable, the resources are queried at the tenancy level.
The following example policy lists all the instances in the specified lists of compartments
policies: - name: list-instances-from-compartments description: | Lists all the instances in the specified compartments resource: oci.instance