Oracle Cloud Infrastructure v3.10.0 published on Wednesday, Nov 5, 2025 by Pulumi
oci.ResourceManager.getStacks
Start a Neo task
Explain and create an oci.ResourceManager.getStacks resource
This data source provides the list of Stacks in Oracle Cloud Infrastructure Resource Manager service.
Lists stacks according to the specified filter. For more information, see Listing Stacks.
- If called using the compartment ID, returns all stacks in the specified compartment.
- If called using the stack ID, returns the specified stack. (See also GetStack.)
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testStacks = oci.ResourceManager.getStacks({
compartmentId: compartmentId,
displayName: stackDisplayName,
id: stackId,
state: stackState,
});
import pulumi
import pulumi_oci as oci
test_stacks = oci.ResourceManager.get_stacks(compartment_id=compartment_id,
display_name=stack_display_name,
id=stack_id,
state=stack_state)
package main
import (
"github.com/pulumi/pulumi-oci/sdk/v3/go/oci/resourcemanager"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := resourcemanager.GetStacks(ctx, &resourcemanager.GetStacksArgs{
CompartmentId: compartmentId,
DisplayName: pulumi.StringRef(stackDisplayName),
Id: pulumi.StringRef(stackId),
State: pulumi.StringRef(stackState),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() =>
{
var testStacks = Oci.ResourceManager.GetStacks.Invoke(new()
{
CompartmentId = compartmentId,
DisplayName = stackDisplayName,
Id = stackId,
State = stackState,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.ResourceManager.ResourceManagerFunctions;
import com.pulumi.oci.ResourceManager.inputs.GetStacksArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var testStacks = ResourceManagerFunctions.getStacks(GetStacksArgs.builder()
.compartmentId(compartmentId)
.displayName(stackDisplayName)
.id(stackId)
.state(stackState)
.build());
}
}
variables:
testStacks:
fn::invoke:
function: oci:ResourceManager:getStacks
arguments:
compartmentId: ${compartmentId}
displayName: ${stackDisplayName}
id: ${stackId}
state: ${stackState}
Using getStacks
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getStacks(args: GetStacksArgs, opts?: InvokeOptions): Promise<GetStacksResult>
function getStacksOutput(args: GetStacksOutputArgs, opts?: InvokeOptions): Output<GetStacksResult>def get_stacks(compartment_id: Optional[str] = None,
display_name: Optional[str] = None,
filters: Optional[Sequence[GetStacksFilter]] = None,
id: Optional[str] = None,
state: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetStacksResult
def get_stacks_output(compartment_id: Optional[pulumi.Input[str]] = None,
display_name: Optional[pulumi.Input[str]] = None,
filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetStacksFilterArgs]]]] = None,
id: Optional[pulumi.Input[str]] = None,
state: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetStacksResult]func GetStacks(ctx *Context, args *GetStacksArgs, opts ...InvokeOption) (*GetStacksResult, error)
func GetStacksOutput(ctx *Context, args *GetStacksOutputArgs, opts ...InvokeOption) GetStacksResultOutput> Note: This function is named GetStacks in the Go SDK.
public static class GetStacks
{
public static Task<GetStacksResult> InvokeAsync(GetStacksArgs args, InvokeOptions? opts = null)
public static Output<GetStacksResult> Invoke(GetStacksInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetStacksResult> getStacks(GetStacksArgs args, InvokeOptions options)
public static Output<GetStacksResult> getStacks(GetStacksArgs args, InvokeOptions options)
fn::invoke:
function: oci:ResourceManager/getStacks:getStacks
arguments:
# arguments dictionaryThe following arguments are supported:
- Compartment
Id string - The compartment OCID on which to filter.
- Display
Name string - Display name on which to query.
- Filters
List<Get
Stacks Filter> - Id string
- The OCID on which to query for a stack.
- State string
- A filter that returns only those resources that match the specified lifecycle state. The state value is case-insensitive. For more information about stack lifecycle states, see Key Concepts.
- Compartment
Id string - The compartment OCID on which to filter.
- Display
Name string - Display name on which to query.
- Filters
[]Get
Stacks Filter - Id string
- The OCID on which to query for a stack.
- State string
- A filter that returns only those resources that match the specified lifecycle state. The state value is case-insensitive. For more information about stack lifecycle states, see Key Concepts.
- compartment
Id String - The compartment OCID on which to filter.
- display
Name String - Display name on which to query.
- filters
List<Get
Stacks Filter> - id String
- The OCID on which to query for a stack.
- state String
- A filter that returns only those resources that match the specified lifecycle state. The state value is case-insensitive. For more information about stack lifecycle states, see Key Concepts.
- compartment
Id string - The compartment OCID on which to filter.
- display
Name string - Display name on which to query.
- filters
Get
Stacks Filter[] - id string
- The OCID on which to query for a stack.
- state string
- A filter that returns only those resources that match the specified lifecycle state. The state value is case-insensitive. For more information about stack lifecycle states, see Key Concepts.
- compartment_
id str - The compartment OCID on which to filter.
- display_
name str - Display name on which to query.
- filters
Sequence[Get
Stacks Filter] - id str
- The OCID on which to query for a stack.
- state str
- A filter that returns only those resources that match the specified lifecycle state. The state value is case-insensitive. For more information about stack lifecycle states, see Key Concepts.
- compartment
Id String - The compartment OCID on which to filter.
- display
Name String - Display name on which to query.
- filters List<Property Map>
- id String
- The OCID on which to query for a stack.
- state String
- A filter that returns only those resources that match the specified lifecycle state. The state value is case-insensitive. For more information about stack lifecycle states, see Key Concepts.
getStacks Result
The following output properties are available:
- Compartment
Id string - Unique identifier (OCID) for the compartment where the stack is located.
- Stacks
List<Get
Stacks Stack> - The list of stacks.
- Display
Name string - A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Filters
List<Get
Stacks Filter> - Id string
- Unique identifier (OCID) for the stack.
- State string
- The current lifecycle state of the stack. For more information about stack lifecycle states in Resource Manager, see Key Concepts.
- Compartment
Id string - Unique identifier (OCID) for the compartment where the stack is located.
- Stacks
[]Get
Stacks Stack - The list of stacks.
- Display
Name string - A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Filters
[]Get
Stacks Filter - Id string
- Unique identifier (OCID) for the stack.
- State string
- The current lifecycle state of the stack. For more information about stack lifecycle states in Resource Manager, see Key Concepts.
- compartment
Id String - Unique identifier (OCID) for the compartment where the stack is located.
- stacks
List<Get
Stacks Stack> - The list of stacks.
- display
Name String - A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- filters
List<Get
Stacks Filter> - id String
- Unique identifier (OCID) for the stack.
- state String
- The current lifecycle state of the stack. For more information about stack lifecycle states in Resource Manager, see Key Concepts.
- compartment
Id string - Unique identifier (OCID) for the compartment where the stack is located.
- stacks
Get
Stacks Stack[] - The list of stacks.
- display
Name string - A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- filters
Get
Stacks Filter[] - id string
- Unique identifier (OCID) for the stack.
- state string
- The current lifecycle state of the stack. For more information about stack lifecycle states in Resource Manager, see Key Concepts.
- compartment_
id str - Unique identifier (OCID) for the compartment where the stack is located.
- stacks
Sequence[Get
Stacks Stack] - The list of stacks.
- display_
name str - A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- filters
Sequence[Get
Stacks Filter] - id str
- Unique identifier (OCID) for the stack.
- state str
- The current lifecycle state of the stack. For more information about stack lifecycle states in Resource Manager, see Key Concepts.
- compartment
Id String - Unique identifier (OCID) for the compartment where the stack is located.
- stacks List<Property Map>
- The list of stacks.
- display
Name String - A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- filters List<Property Map>
- id String
- Unique identifier (OCID) for the stack.
- state String
- The current lifecycle state of the stack. For more information about stack lifecycle states in Resource Manager, see Key Concepts.
Supporting Types
GetStacksFilter
GetStacksStack
- Compartment
Id string - The compartment OCID on which to filter.
- Config
Source GetStacks Stack Config Source - Dictionary<string, string>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"} - Description string
- General description of the stack.
- Display
Name string - Display name on which to query.
- Dictionary<string, string>
- Free-form tags associated with the resource. Each tag is a key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"} - Id string
- The OCID on which to query for a stack.
- State string
- A filter that returns only those resources that match the specified lifecycle state. The state value is case-insensitive. For more information about stack lifecycle states, see Key Concepts.
- Dictionary<string, string>
- The system tags associated with this resource, if any. The system tags are set by Oracle cloud infrastructure services. Each key is predefined and scoped to namespaces. For more information, see Resource Tags. Example:
{orcl-cloud: {free-tier-retain: true}} - Terraform
Version string - Time
Created string - The date and time at which the stack was created. Format is defined by RFC3339. Example:
2020-01-25T21:10:29.600Z - Variables Dictionary<string, string>
- Compartment
Id string - The compartment OCID on which to filter.
- Config
Source GetStacks Stack Config Source - map[string]string
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"} - Description string
- General description of the stack.
- Display
Name string - Display name on which to query.
- map[string]string
- Free-form tags associated with the resource. Each tag is a key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"} - Id string
- The OCID on which to query for a stack.
- State string
- A filter that returns only those resources that match the specified lifecycle state. The state value is case-insensitive. For more information about stack lifecycle states, see Key Concepts.
- map[string]string
- The system tags associated with this resource, if any. The system tags are set by Oracle cloud infrastructure services. Each key is predefined and scoped to namespaces. For more information, see Resource Tags. Example:
{orcl-cloud: {free-tier-retain: true}} - Terraform
Version string - Time
Created string - The date and time at which the stack was created. Format is defined by RFC3339. Example:
2020-01-25T21:10:29.600Z - Variables map[string]string
- compartment
Id String - The compartment OCID on which to filter.
- config
Source GetStacks Stack Config Source - Map<String,String>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"} - description String
- General description of the stack.
- display
Name String - Display name on which to query.
- Map<String,String>
- Free-form tags associated with the resource. Each tag is a key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"} - id String
- The OCID on which to query for a stack.
- state String
- A filter that returns only those resources that match the specified lifecycle state. The state value is case-insensitive. For more information about stack lifecycle states, see Key Concepts.
- Map<String,String>
- The system tags associated with this resource, if any. The system tags are set by Oracle cloud infrastructure services. Each key is predefined and scoped to namespaces. For more information, see Resource Tags. Example:
{orcl-cloud: {free-tier-retain: true}} - terraform
Version String - time
Created String - The date and time at which the stack was created. Format is defined by RFC3339. Example:
2020-01-25T21:10:29.600Z - variables Map<String,String>
- compartment
Id string - The compartment OCID on which to filter.
- config
Source GetStacks Stack Config Source - {[key: string]: string}
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"} - description string
- General description of the stack.
- display
Name string - Display name on which to query.
- {[key: string]: string}
- Free-form tags associated with the resource. Each tag is a key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"} - id string
- The OCID on which to query for a stack.
- state string
- A filter that returns only those resources that match the specified lifecycle state. The state value is case-insensitive. For more information about stack lifecycle states, see Key Concepts.
- {[key: string]: string}
- The system tags associated with this resource, if any. The system tags are set by Oracle cloud infrastructure services. Each key is predefined and scoped to namespaces. For more information, see Resource Tags. Example:
{orcl-cloud: {free-tier-retain: true}} - terraform
Version string - time
Created string - The date and time at which the stack was created. Format is defined by RFC3339. Example:
2020-01-25T21:10:29.600Z - variables {[key: string]: string}
- compartment_
id str - The compartment OCID on which to filter.
- config_
source GetStacks Stack Config Source - Mapping[str, str]
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"} - description str
- General description of the stack.
- display_
name str - Display name on which to query.
- Mapping[str, str]
- Free-form tags associated with the resource. Each tag is a key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"} - id str
- The OCID on which to query for a stack.
- state str
- A filter that returns only those resources that match the specified lifecycle state. The state value is case-insensitive. For more information about stack lifecycle states, see Key Concepts.
- Mapping[str, str]
- The system tags associated with this resource, if any. The system tags are set by Oracle cloud infrastructure services. Each key is predefined and scoped to namespaces. For more information, see Resource Tags. Example:
{orcl-cloud: {free-tier-retain: true}} - terraform_
version str - time_
created str - The date and time at which the stack was created. Format is defined by RFC3339. Example:
2020-01-25T21:10:29.600Z - variables Mapping[str, str]
- compartment
Id String - The compartment OCID on which to filter.
- config
Source Property Map - Map<String>
- Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example:
{"Operations.CostCenter": "42"} - description String
- General description of the stack.
- display
Name String - Display name on which to query.
- Map<String>
- Free-form tags associated with the resource. Each tag is a key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:
{"Department": "Finance"} - id String
- The OCID on which to query for a stack.
- state String
- A filter that returns only those resources that match the specified lifecycle state. The state value is case-insensitive. For more information about stack lifecycle states, see Key Concepts.
- Map<String>
- The system tags associated with this resource, if any. The system tags are set by Oracle cloud infrastructure services. Each key is predefined and scoped to namespaces. For more information, see Resource Tags. Example:
{orcl-cloud: {free-tier-retain: true}} - terraform
Version String - time
Created String - The date and time at which the stack was created. Format is defined by RFC3339. Example:
2020-01-25T21:10:29.600Z - variables Map<String>
GetStacksStackConfigSource
- Config
Source stringType - Working
Directory string - Zip
File stringBase64encoded
- Config
Source stringType - Working
Directory string - Zip
File stringBase64encoded
- config
Source StringType - working
Directory String - zip
File StringBase64encoded
- config
Source stringType - working
Directory string - zip
File stringBase64encoded
- config
Source StringType - working
Directory String - zip
File StringBase64encoded
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
ociTerraform Provider.
