1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. ResourceManager
  5. getStackTfState
Viewing docs for Oracle Cloud Infrastructure v4.3.0
published on Thursday, Mar 19, 2026 by Pulumi
oci logo
Viewing docs for Oracle Cloud Infrastructure v4.3.0
published on Thursday, Mar 19, 2026 by Pulumi

    This data source provides details about a specific Stack Tf State resource in Oracle Cloud Infrastructure Resource Manager service.

    Returns the Terraform state for the specified stack. For more information, see Getting a Stack State File.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testStackTfState = oci.ResourceManager.getStackTfState({
        stackId: testStack.id,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_stack_tf_state = oci.ResourceManager.get_stack_tf_state(stack_id=test_stack["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v4/go/oci/resourcemanager"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := resourcemanager.GetStackTfState(ctx, &resourcemanager.GetStackTfStateArgs{
    			StackId: testStack.Id,
    		}, 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 testStackTfState = Oci.ResourceManager.GetStackTfState.Invoke(new()
        {
            StackId = testStack.Id,
        });
    
    });
    
    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.GetStackTfStateArgs;
    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 testStackTfState = ResourceManagerFunctions.getStackTfState(GetStackTfStateArgs.builder()
                .stackId(testStack.id())
                .build());
    
        }
    }
    
    variables:
      testStackTfState:
        fn::invoke:
          function: oci:ResourceManager:getStackTfState
          arguments:
            stackId: ${testStack.id}
    

    Using getStackTfState

    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 getStackTfState(args: GetStackTfStateArgs, opts?: InvokeOptions): Promise<GetStackTfStateResult>
    function getStackTfStateOutput(args: GetStackTfStateOutputArgs, opts?: InvokeOptions): Output<GetStackTfStateResult>
    def get_stack_tf_state(local_path: Optional[str] = None,
                           stack_id: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetStackTfStateResult
    def get_stack_tf_state_output(local_path: Optional[pulumi.Input[str]] = None,
                           stack_id: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetStackTfStateResult]
    func GetStackTfState(ctx *Context, args *GetStackTfStateArgs, opts ...InvokeOption) (*GetStackTfStateResult, error)
    func GetStackTfStateOutput(ctx *Context, args *GetStackTfStateOutputArgs, opts ...InvokeOption) GetStackTfStateResultOutput

    > Note: This function is named GetStackTfState in the Go SDK.

    public static class GetStackTfState 
    {
        public static Task<GetStackTfStateResult> InvokeAsync(GetStackTfStateArgs args, InvokeOptions? opts = null)
        public static Output<GetStackTfStateResult> Invoke(GetStackTfStateInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetStackTfStateResult> getStackTfState(GetStackTfStateArgs args, InvokeOptions options)
    public static Output<GetStackTfStateResult> getStackTfState(GetStackTfStateArgs args, InvokeOptions options)
    
    fn::invoke:
      function: oci:ResourceManager/getStackTfState:getStackTfState
      arguments:
        # arguments dictionary

    The following arguments are supported:

    LocalPath string
    The path and filename (relative to where Terraform is executing) to write the external statefile to.
    StackId string
    The OCID of the stack.
    LocalPath string
    The path and filename (relative to where Terraform is executing) to write the external statefile to.
    StackId string
    The OCID of the stack.
    localPath String
    The path and filename (relative to where Terraform is executing) to write the external statefile to.
    stackId String
    The OCID of the stack.
    localPath string
    The path and filename (relative to where Terraform is executing) to write the external statefile to.
    stackId string
    The OCID of the stack.
    local_path str
    The path and filename (relative to where Terraform is executing) to write the external statefile to.
    stack_id str
    The OCID of the stack.
    localPath String
    The path and filename (relative to where Terraform is executing) to write the external statefile to.
    stackId String
    The OCID of the stack.

    getStackTfState Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    LocalPath string
    The path and filename (relative to where Terraform is executing) to write the external statefile to.
    StackId string
    Id string
    The provider-assigned unique ID for this managed resource.
    LocalPath string
    The path and filename (relative to where Terraform is executing) to write the external statefile to.
    StackId string
    id String
    The provider-assigned unique ID for this managed resource.
    localPath String
    The path and filename (relative to where Terraform is executing) to write the external statefile to.
    stackId String
    id string
    The provider-assigned unique ID for this managed resource.
    localPath string
    The path and filename (relative to where Terraform is executing) to write the external statefile to.
    stackId string
    id str
    The provider-assigned unique ID for this managed resource.
    local_path str
    The path and filename (relative to where Terraform is executing) to write the external statefile to.
    stack_id str
    id String
    The provider-assigned unique ID for this managed resource.
    localPath String
    The path and filename (relative to where Terraform is executing) to write the external statefile to.
    stackId String

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Viewing docs for Oracle Cloud Infrastructure v4.3.0
    published on Thursday, Mar 19, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.