1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. ResourceManager
  5. getStacks
Oracle Cloud Infrastructure v2.32.0 published on Thursday, Apr 24, 2025 by Pulumi

oci.ResourceManager.getStacks

Explore with Pulumi AI

Oracle Cloud Infrastructure v2.32.0 published on Thursday, Apr 24, 2025 by Pulumi

This data source provides the list of Stacks in Oracle Cloud Infrastructure Resource Manager service.

Returns a list of stacks.

  • If called using the compartment ID, returns all stacks in the specified compartment.
  • If called using the stack ID, returns the specified stack.

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,
});
Copy
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)
Copy
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/v2/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
	})
}
Copy
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,
    });

});
Copy
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());

    }
}
Copy
variables:
  testStacks:
    fn::invoke:
      function: oci:ResourceManager:getStacks
      arguments:
        compartmentId: ${compartmentId}
        displayName: ${stackDisplayName}
        id: ${stackId}
        state: ${stackState}
Copy

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>
Copy
def get_stacks(compartment_id: Optional[str] = None,
               display_name: Optional[str] = None,
               filters: Optional[Sequence[_resourcemanager.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[_resourcemanager.GetStacksFilterArgs]]]] = None,
               id: Optional[pulumi.Input[str]] = None,
               state: Optional[pulumi.Input[str]] = None,
               opts: Optional[InvokeOptions] = None) -> Output[GetStacksResult]
Copy
func GetStacks(ctx *Context, args *GetStacksArgs, opts ...InvokeOption) (*GetStacksResult, error)
func GetStacksOutput(ctx *Context, args *GetStacksOutputArgs, opts ...InvokeOption) GetStacksResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetStacksResult> getStacks(GetStacksArgs args, InvokeOptions options)
public static Output<GetStacksResult> getStacks(GetStacksArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: oci:ResourceManager/getStacks:getStacks
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

CompartmentId This property is required. string
The compartment OCID on which to filter.
DisplayName string
Display name on which to query.
Filters Changes to this property will trigger replacement. List<GetStacksFilter>
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.

Allowable values:

  • CREATING
  • ACTIVE
  • DELETING
  • DELETED
CompartmentId This property is required. string
The compartment OCID on which to filter.
DisplayName string
Display name on which to query.
Filters Changes to this property will trigger replacement. []GetStacksFilter
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.

Allowable values:

  • CREATING
  • ACTIVE
  • DELETING
  • DELETED
compartmentId This property is required. String
The compartment OCID on which to filter.
displayName String
Display name on which to query.
filters Changes to this property will trigger replacement. List<GetStacksFilter>
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.

Allowable values:

  • CREATING
  • ACTIVE
  • DELETING
  • DELETED
compartmentId This property is required. string
The compartment OCID on which to filter.
displayName string
Display name on which to query.
filters Changes to this property will trigger replacement. GetStacksFilter[]
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.

Allowable values:

  • CREATING
  • ACTIVE
  • DELETING
  • DELETED
compartment_id This property is required. str
The compartment OCID on which to filter.
display_name str
Display name on which to query.
filters Changes to this property will trigger replacement. Sequence[resourcemanager.GetStacksFilter]
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.

Allowable values:

  • CREATING
  • ACTIVE
  • DELETING
  • DELETED
compartmentId This property is required. String
The compartment OCID on which to filter.
displayName String
Display name on which to query.
filters Changes to this property will trigger replacement. 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.

Allowable values:

  • CREATING
  • ACTIVE
  • DELETING
  • DELETED

getStacks Result

The following output properties are available:

CompartmentId string
Unique identifier (OCID) for the compartment where the stack is located.
Stacks List<GetStacksStack>
The list of stacks.
DisplayName string
Human-readable display name for the stack.
Filters List<GetStacksFilter>
Id string
Unique identifier (OCID) for the stack.
State string
The current lifecycle state of the stack.
CompartmentId string
Unique identifier (OCID) for the compartment where the stack is located.
Stacks []GetStacksStack
The list of stacks.
DisplayName string
Human-readable display name for the stack.
Filters []GetStacksFilter
Id string
Unique identifier (OCID) for the stack.
State string
The current lifecycle state of the stack.
compartmentId String
Unique identifier (OCID) for the compartment where the stack is located.
stacks List<GetStacksStack>
The list of stacks.
displayName String
Human-readable display name for the stack.
filters List<GetStacksFilter>
id String
Unique identifier (OCID) for the stack.
state String
The current lifecycle state of the stack.
compartmentId string
Unique identifier (OCID) for the compartment where the stack is located.
stacks GetStacksStack[]
The list of stacks.
displayName string
Human-readable display name for the stack.
filters GetStacksFilter[]
id string
Unique identifier (OCID) for the stack.
state string
The current lifecycle state of the stack.
compartment_id str
Unique identifier (OCID) for the compartment where the stack is located.
stacks Sequence[resourcemanager.GetStacksStack]
The list of stacks.
display_name str
Human-readable display name for the stack.
filters Sequence[resourcemanager.GetStacksFilter]
id str
Unique identifier (OCID) for the stack.
state str
The current lifecycle state of the stack.
compartmentId String
Unique identifier (OCID) for the compartment where the stack is located.
stacks List<Property Map>
The list of stacks.
displayName String
Human-readable display name for the stack.
filters List<Property Map>
id String
Unique identifier (OCID) for the stack.
state String
The current lifecycle state of the stack.

Supporting Types

GetStacksFilter

Name This property is required. string
Values This property is required. List<string>
Regex bool
Name This property is required. string
Values This property is required. []string
Regex bool
name This property is required. String
values This property is required. List<String>
regex Boolean
name This property is required. string
values This property is required. string[]
regex boolean
name This property is required. str
values This property is required. Sequence[str]
regex bool
name This property is required. String
values This property is required. List<String>
regex Boolean

GetStacksStack

CompartmentId This property is required. string
The compartment OCID on which to filter.
ConfigSource This property is required. GetStacksStackConfigSource
DefinedTags This property is required. 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 This property is required. string
General description of the stack.
DisplayName This property is required. string
Display name on which to query.
FreeformTags This property is required. Dictionary<string, string>
Free-form tags associated with this 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 This property is required. string
The OCID on which to query for a stack.
State This property is required. string

A filter that returns only those resources that match the specified lifecycle state. The state value is case-insensitive.

Allowable values:

  • CREATING
  • ACTIVE
  • DELETING
  • DELETED
TimeCreated This property is required. string
The date and time at which the stack was created.
Variables This property is required. Dictionary<string, string>
CompartmentId This property is required. string
The compartment OCID on which to filter.
ConfigSource This property is required. GetStacksStackConfigSource
DefinedTags This property is required. 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 This property is required. string
General description of the stack.
DisplayName This property is required. string
Display name on which to query.
FreeformTags This property is required. map[string]string
Free-form tags associated with this 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 This property is required. string
The OCID on which to query for a stack.
State This property is required. string

A filter that returns only those resources that match the specified lifecycle state. The state value is case-insensitive.

Allowable values:

  • CREATING
  • ACTIVE
  • DELETING
  • DELETED
TimeCreated This property is required. string
The date and time at which the stack was created.
Variables This property is required. map[string]string
compartmentId This property is required. String
The compartment OCID on which to filter.
configSource This property is required. GetStacksStackConfigSource
definedTags This property is required. 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 This property is required. String
General description of the stack.
displayName This property is required. String
Display name on which to query.
freeformTags This property is required. Map<String,String>
Free-form tags associated with this 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 This property is required. String
The OCID on which to query for a stack.
state This property is required. String

A filter that returns only those resources that match the specified lifecycle state. The state value is case-insensitive.

Allowable values:

  • CREATING
  • ACTIVE
  • DELETING
  • DELETED
timeCreated This property is required. String
The date and time at which the stack was created.
variables This property is required. Map<String,String>
compartmentId This property is required. string
The compartment OCID on which to filter.
configSource This property is required. GetStacksStackConfigSource
definedTags This property is required. {[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 This property is required. string
General description of the stack.
displayName This property is required. string
Display name on which to query.
freeformTags This property is required. {[key: string]: string}
Free-form tags associated with this 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 This property is required. string
The OCID on which to query for a stack.
state This property is required. string

A filter that returns only those resources that match the specified lifecycle state. The state value is case-insensitive.

Allowable values:

  • CREATING
  • ACTIVE
  • DELETING
  • DELETED
timeCreated This property is required. string
The date and time at which the stack was created.
variables This property is required. {[key: string]: string}
compartment_id This property is required. str
The compartment OCID on which to filter.
config_source This property is required. resourcemanager.GetStacksStackConfigSource
defined_tags This property is required. 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 This property is required. str
General description of the stack.
display_name This property is required. str
Display name on which to query.
freeform_tags This property is required. Mapping[str, str]
Free-form tags associated with this 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 This property is required. str
The OCID on which to query for a stack.
state This property is required. str

A filter that returns only those resources that match the specified lifecycle state. The state value is case-insensitive.

Allowable values:

  • CREATING
  • ACTIVE
  • DELETING
  • DELETED
time_created This property is required. str
The date and time at which the stack was created.
variables This property is required. Mapping[str, str]
compartmentId This property is required. String
The compartment OCID on which to filter.
configSource This property is required. Property Map
definedTags This property is required. 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 This property is required. String
General description of the stack.
displayName This property is required. String
Display name on which to query.
freeformTags This property is required. Map<String>
Free-form tags associated with this 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 This property is required. String
The OCID on which to query for a stack.
state This property is required. String

A filter that returns only those resources that match the specified lifecycle state. The state value is case-insensitive.

Allowable values:

  • CREATING
  • ACTIVE
  • DELETING
  • DELETED
timeCreated This property is required. String
The date and time at which the stack was created.
variables This property is required. Map<String>

GetStacksStackConfigSource

ConfigSourceType This property is required. string
WorkingDirectory This property is required. string
ZipFileBase64encoded This property is required. string
ConfigSourceType This property is required. string
WorkingDirectory This property is required. string
ZipFileBase64encoded This property is required. string
configSourceType This property is required. String
workingDirectory This property is required. String
zipFileBase64encoded This property is required. String
configSourceType This property is required. string
workingDirectory This property is required. string
zipFileBase64encoded This property is required. string
config_source_type This property is required. str
working_directory This property is required. str
zip_file_base64encoded This property is required. str
configSourceType This property is required. String
workingDirectory This property is required. String
zipFileBase64encoded This property is required. String

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.
Oracle Cloud Infrastructure v2.32.0 published on Thursday, Apr 24, 2025 by Pulumi