oci_adm_knowledge_baseoci_adm_vulnerability_auditoci_ai_anomaly_detection_ai_private_endpointoci_ai_anomaly_detection_data_assetoci_ai_anomaly_detection_modeloci_ai_anomaly_detection_projectoci_analytics_instanceoci_apigateway_apioci_application_migration_migrationoci_application_migration_sourceoci_artifacts_container_imageoci_artifacts_container_image_signatureoci_artifacts_container_repositoryoci_artifacts_generic_artifactoci_artifacts_repositoryoci_autoscaling_auto_scaling_configurationoci_autoscaling_auto_scaling_policyoci_bastion_bastionoci_bastion_sessionoci_bds_bds_instanceoci_budget_alert_ruleoci_budget_budgetoci_certificates_authority_bundleoci_certificates_management_associationoci_certificates_management_ca_bundleoci_certificates_management_certificateoci_certificates_management_certificate_authorityoci_certificates_management_certificate_authority_versionoci_certificates_management_certificate_versionoci_cloud_guard_configurationoci_cloud_guard_detector_recipeoci_cloud_guard_managed_listoci_cloud_guard_responder_recipeoci_cloud_guard_targetoci_container_instances_containeroci_container_instances_container_instanceoci_containerengine_clusteroci_core_block_volume_replicaoci_core_boot_volumeoci_core_boot_volume_attachmentoci_core_boot_volume_backupoci_core_boot_volume_metric_read_opsoci_core_boot_volume_metric_read_ops_dailyoci_core_boot_volume_metric_read_ops_hourlyoci_core_boot_volume_metric_write_opsoci_core_boot_volume_metric_write_ops_dailyoci_core_boot_volume_metric_write_ops_hourlyoci_core_boot_volume_replicaoci_core_cluster_networkoci_core_dhcp_optionsoci_core_drgoci_core_imageoci_core_image_customoci_core_instanceoci_core_instance_configurationoci_core_instance_metric_cpu_utilizationoci_core_instance_metric_cpu_utilization_dailyoci_core_instance_metric_cpu_utilization_hourlyoci_core_internet_gatewayoci_core_load_balanceroci_core_local_peering_gatewayoci_core_nat_gatewayoci_core_network_load_balanceroci_core_network_security_groupoci_core_public_ipoci_core_public_ip_pooloci_core_route_tableoci_core_security_listoci_core_service_gatewayoci_core_subnetoci_core_vcnoci_core_vnic_attachmentoci_core_volumeoci_core_volume_attachmentoci_core_volume_backupoci_core_volume_backup_policyoci_core_volume_default_backup_policyoci_core_volume_groupoci_database_autonomous_databaseoci_database_autonomous_db_metric_cpu_utilizationoci_database_autonomous_db_metric_cpu_utilization_dailyoci_database_autonomous_db_metric_cpu_utilization_hourlyoci_database_autonomous_db_metric_storage_utilizationoci_database_autonomous_db_metric_storage_utilization_dailyoci_database_autonomous_db_metric_storage_utilization_hourlyoci_database_dboci_database_db_homeoci_database_db_systemoci_database_pluggable_databaseoci_database_software_imageoci_devops_projectoci_devops_repositoryoci_dns_rrsetoci_dns_tsig_keyoci_dns_zoneoci_events_ruleoci_file_storage_file_systemoci_file_storage_mount_targetoci_file_storage_snapshotoci_functions_applicationoci_functions_functionoci_identity_api_keyoci_identity_auth_tokenoci_identity_authentication_policyoci_identity_availability_domainoci_identity_compartmentoci_identity_customer_secret_keyoci_identity_dynamic_groupoci_identity_groupoci_identity_network_sourceoci_identity_policyoci_identity_tag_defaultoci_identity_tag_namespaceoci_identity_tenancyoci_identity_useroci_kms_keyoci_kms_key_versionoci_kms_vaultoci_logging_logoci_logging_log_groupoci_logging_searchoci_mysql_backupoci_mysql_channeloci_mysql_configurationoci_mysql_configuration_customoci_mysql_db_systemoci_mysql_db_system_metric_connectionsoci_mysql_db_system_metric_connections_dailyoci_mysql_db_system_metric_connections_hourlyoci_mysql_db_system_metric_cpu_utilizationoci_mysql_db_system_metric_cpu_utilization_dailyoci_mysql_db_system_metric_cpu_utilization_hourlyoci_mysql_db_system_metric_memory_utilizationoci_mysql_db_system_metric_memory_utilization_dailyoci_mysql_heat_wave_clusteroci_network_firewall_firewalloci_network_firewall_policyoci_nosql_tableoci_nosql_table_metric_read_throttle_countoci_nosql_table_metric_read_throttle_count_dailyoci_nosql_table_metric_read_throttle_count_hourlyoci_nosql_table_metric_storage_utilizationoci_nosql_table_metric_storage_utilization_dailyoci_nosql_table_metric_storage_utilization_hourlyoci_nosql_table_metric_write_throttle_countoci_nosql_table_metric_write_throttle_count_dailyoci_nosql_table_metric_write_throttle_count_hourlyoci_objectstorage_bucketoci_objectstorage_objectoci_ons_notification_topicoci_ons_subscriptionoci_queue_queueoci_regionoci_resource_searchoci_resourcemanager_stackoci_streaming_streamoci_vault_secret
Table: oci_identity_compartment
Compartments are the primary building blocks you use to organize your cloud resources. You use compartments to organize and isolate your resources to make it easier to manage and secure access to them. For more information about compartments policy, go to Understanding Compartments
Examples
Basic info
select name, lifecycle_state, id, compartment_id as parent_compartmentfrom oci.oci_identity_compartment
Details joined with parent compartment
select child.name as name, coalesce(parent.name, 'root') as parent_compartment, child.id as id, coalesce(parent.id, child.tenant_id) as parent_compartment_idfrom oci_identity_compartment child left join oci_identity_compartment parent on (child.compartment_id = parent.id)order by parent.name;
Full path of the compartments
with recursive compartments as ( select name, id, compartment_id, tenant_id, name as path, name as last_name, id as last_id from oci_identity_compartment where lifecycle_state = 'ACTIVE' union all select oci_identity_compartment.name, oci_identity_compartment.id, oci_identity_compartment.compartment_id, oci_identity_compartment.tenant_id, oci_identity_compartment.name || '/' || compartments.path, compartments.last_name, compartments.last_id from oci_identity_compartment join compartments on oci_identity_compartment.id = compartments.compartment_id)select last_id as compartment_id, last_name as name, pathfrom compartmentswhere compartment_id = tenant_idorder by path;
Query examples
- blockstorage_block_volume_age_report
- blockstorage_block_volume_by_compartment
- blockstorage_block_volume_encryption_report
- blockstorage_block_volume_input
- blockstorage_block_volume_storage_by_compartment
- blockstorage_block_volume_unattached_report
- blockstorage_boot_volume_age_report
- blockstorage_boot_volume_by_compartment
- blockstorage_boot_volume_encryption_report
- blockstorage_boot_volume_input
- blockstorage_boot_volume_storage_by_compartment
- blockstorage_boot_volume_unattached_report
- compartment_count
- compartment_table
- compute_instance_age_report
- compute_instance_by_compartment
- compute_instance_input
- database_autonomous_database_input
- database_autonomous_db_age_report
- database_autonomous_db_by_compartment
- filestorage_filesystem_age_report
- filestorage_filesystem_by_compartment
- filestorage_filesystem_input
- key_vault_input
- kms_key_age_report
- kms_key_by_compartment
- kms_key_input
- kms_vault_age_report
- kms_vault_by_compartment
- mysql_backup_age_report
- mysql_backup_by_compartment
- mysql_backup_storage_by_compartment
- mysql_db_system_age_report
- mysql_db_system_by_compartment
- mysql_db_system_input
- mysql_db_system_storage_by_compartment
- nosql_table_age_report
- nosql_table_by_compartment
- nosql_table_input
- objectstorage_bucket_age_report
- objectstorage_bucket_by_compartment
- objectstorage_bucket_encryption_report
- objectstorage_bucket_input
- objectstorage_bucket_lifecycle_report
- objectstorage_bucket_public_access_report
- oci_vcn_by_compartment
- oci_vcn_security_group_unrestricted_ingress_rdp_count
- oci_vcn_security_group_unrestricted_ingress_ssh_count
- oci_vcn_security_groups_by_compartment
- oci_vcn_security_list_by_compartment
- oci_vcn_security_list_unrestricted_ingress_rdp_count
- oci_vcn_security_list_unrestricted_ingress_ssh_count
- oci_vcn_subnet_by_compartment
- ons_notification_topic_age_report
- ons_notification_topic_by_compartment
- ons_notification_topic_input
- ons_subscription_age_report
- ons_subscription_by_compartment
- vcn_input
- vcn_network_security_group_input
- vcn_security_list_input
- vcn_subnet_input
Control examples
- block_volume_auto_tune_performance_enabled
- block_volume_backup_max_age
- boot_and_block_volume_attached_stopped_instance
- boot_and_block_volume_large
- boot_and_block_volume_unattached
- boot_volume_low_usage
- budget_alert_count
- compute_instance_long_running
- compute_instance_low_utilization
- compute_instance_monitoring_enabled
- database_autonomous_database_low_utilization
- database_autonomous_database_max_age
- mysql_db_system_age
- mysql_db_system_low_connection_count
- mysql_db_system_low_usage
- network_public_ip_unattached
- nosql_table_stale_data
- objectstorage_bucket_without_lifecycle_policy
- blockstorage_block_volume_cmk_encryption_enabled
- blockstorage_boot_volume_cmk_encryption_enabled
- core_default_security_list_allow_icmp_only
- core_network_security_group_restrict_ingress_rdp_all
- core_network_security_group_restrict_ingress_ssh_all
- core_security_list_restrict_ingress_rdp_all
- core_security_list_restrict_ingress_ssh_all
- core_subnet_flow_log_enabled
- events_rule_notification_iam_group_changes
- events_rule_notification_iam_policy_changes
- events_rule_notification_iam_user_changes
- events_rule_notification_identity_provider_changes
- events_rule_notification_idp_group_mapping_changes
- events_rule_notification_network_gateway_changes
- events_rule_notification_network_security_list_changes
- events_rule_notification_route_table_changes
- events_rule_notification_security_list_changes
- events_rule_notification_vcn_changes
- filestorage_filesystem_cmk_encryption_enabled
- identity_tenancy_with_one_active_compartment
- kms_cmk_rotation_365
- notification_topic_with_subscription
- objectstorage_bucket_cmk_encryption_enabled
- objectstorage_bucket_public_access_blocked
- objectstorage_bucket_versioning_enabled
- oracle_autonomous_database_not_publicly_accessible
- objectstorage_bucket_logging_report
- oci_vcn_security_group_by_ingress_rdp
- oci_vcn_security_group_by_ingress_ssh
- oci_vcn_security_list_by_ingress_rdp
- oci_vcn_security_list_by_ingress_ssh
- oci_vcn_subnet_flow_logs_report
.inspect oci_identity_compartment
OCI Identity Compartment
Name | Type | Description |
---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. |
compartment_id | text | The OCID of the compartment in Tenant in which the resource is located. |
defined_tags | jsonb | Defined tags for resource. Defined tags are set up in your tenancy by an administrator. Only users granted permission to work with the defined tags can apply them to resources. |
description | text | The description you assign to the compartment. |
freeform_tags | jsonb | Free-form tags for resource. This tags can be applied by any user with permissions on the resource. |
id | text | The OCID of the compartment. |
inactive_status | bigint | The detailed status of INACTIVE lifecycleState |
is_accessible | boolean | Indicates whether or not the compartment is accessible for the user making the request. |
lifecycle_state | text | The compartment's current state. |
name | text | The name assigned to the compartment during creation |
tags | jsonb | A map of tags for the resource. |
tenant_id | text | The OCID of the Tenant in which the resource is located. |
tenant_name | text | The name of the Tenant in which the resource is located. |
time_created | timestamp with time zone | Date and time the user was created. |
title | text | Title of the resource. |