Class WorkspaceStackState

java.lang.Object
com.pulumi.automation.WorkspaceStackState

public final class WorkspaceStackState extends Object
Class for manipulating stack state for a given WorkspaceStack.
  • Constructor Details

    • WorkspaceStackState

      public WorkspaceStackState(WorkspaceStack workspaceStack)
  • Method Details

    • delete

      public void delete(String urn) throws AutomationException
      This command deletes a resource from a stack's state, as long as it is safe to do so. The resource is specified by its Pulumi URN. Resources can't be deleted if there exist other resources that depend on it or are parented to it. Protected resources will not be deleted unless it is specifically requested using the force flag.
      Parameters:
      urn - The Pulumi URN of the resource to be deleted
      Throws:
      AutomationException - if an error occurs
    • delete

      public void delete(String urn, boolean force) throws AutomationException
      This command deletes a resource from a stack's state, as long as it is safe to do so. The resource is specified by its Pulumi URN. Resources can't be deleted if there exist other resources that depend on it or are parented to it. Protected resources will not be deleted unless it is specifically requested using the force flag.
      Parameters:
      urn - The Pulumi URN of the resource to be deleted
      force - A boolean indicating whether the deletion should be forced
      Throws:
      AutomationException - if an error occurs
    • unprotect

      public void unprotect(String urn) throws AutomationException
      Unprotect a resource in a stack's state. This command clears the 'protect' bit on the provided resource URN, allowing the resource to be deleted.
      Parameters:
      urn - The Pulumi URN to be unprotected
      Throws:
      AutomationException - if an error occurs
    • unprotectAll

      public void unprotectAll() throws AutomationException
      Unprotect all resources in a stack's state.
      Throws:
      AutomationException - if an error occurs