Table: oci_resourcemanager_stack - Query OCI Resource Manager Stacks using SQL
Oracle Cloud Infrastructure (OCI) Resource Manager is a fully managed service that allows you to automate the process of provisioning your Oracle Cloud Infrastructure resources. Using Terraform, Resource Manager helps you install, configure, and manage resources through the "infrastructure-as-code" model. It provides a consistent, reproducible way to create, change, and improve infrastructure.
Table Usage Guide
The oci_resourcemanager_stack
table provides insights into the stacks within OCI Resource Manager. As a DevOps engineer, this table allows you to explore stack-specific details, including configurations, terraform versions, and associated metadata. Utilize it to uncover information about stacks, such as their lifecycle state, time created, and the description of the stack.
Examples
Basic info
Explore the status and creation times of your resource manager stacks to understand their lifecycle and manage resources effectively. This can help in assessing the elements within your infrastructure for better planning and resource allocation.
select id, display_name, time_created, lifecycle_state as statefrom oci_resourcemanager_stack;
select id, display_name, time_created, lifecycle_state as statefrom oci_resourcemanager_stack;
List resource manager stacks that are not active
Determine the areas in which resource manager stacks are not currently active. This can help in identifying unused resources, potentially optimizing resource usage and reducing costs.
select id, display_name, time_created, lifecycle_state as statefrom oci_resourcemanager_stackwhere lifecycle_state <> 'ACTIVE';
select id, display_name, time_created, lifecycle_state as statefrom oci_resourcemanager_stackwhere lifecycle_state <> 'ACTIVE';
List resource manager stacks older than 90 days
Identify instances where resource manager stacks have been in existence for more than 90 days. This can be useful for cleaning up old resources and optimizing resource management.
select id, display_name, time_created, lifecycle_state as statefrom oci_resourcemanager_stackwhere time_created <= (current_date - interval '90' day)order by time_created;
select id, display_name, time_created, lifecycle_state as statefrom oci_resourcemanager_stackwhere time_created <= date('now', '-90 day')order by time_created;
Schema for oci_resourcemanager_stack
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
compartment_id | text | = | The OCID of the compartment in Tenant in which the resource is located. |
config_source | jsonb | The version of Terraform specified for the stack. | |
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 | General description of the stack. | |
display_name | text | = | Human-readable display name for the stack. |
freeform_tags | jsonb | Free-form tags for resource. This tags can be applied by any user with permissions on the resource. | |
id | text | = | Unique identifier of the specified stack. |
lifecycle_state | text | = | The current lifecycle state of the stack. |
region | text | The OCI region in which the resource is located. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
stack_drift_status | text | Drift status of the stack. | |
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. | |
terraform_version | text | The version of Terraform specified for the stack. | |
time_created | timestamp with time zone | The date and time when the stack was created. | |
time_drift_last_checked | timestamp with time zone | The date and time when the drift detection was last executed. | |
title | text | Title of the resource. | |
variables | jsonb | Terraform variables associated with this resource. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- oci
You can pass the configuration to the command with the --config
argument:
steampipe_export_oci --config '<your_config>' oci_resourcemanager_stack