Editing a Configuration Using Visual Studio Code

Work with stacks and Terraform configurations in Visual Studio Code using the OCI Resource Manager extension for VS Code.

OCI Resource Manager is an extension of OCI Toolkit for Visual Studio Code.

Listing Stacks

In the tree navigation on the left side, expand the node for the compartment that you want.

Opening a Terraform Configuration for Editing

  1. In the tree navigation on the left side, expand the node for the compartment that you want.
  2. Expand the node for the stack that you want.
  3. Double-click the node for the Terraform configuration that you want.
    The Terraform configuration file opens.

Saving Changes

  1. In the tree navigation on the left side, expand the node for the compartment that you want.
  2. Right-click the stack that you want, and then select Save changes.
    If the configuration is stored in Git, then a prompt for using the Git command line appears. If the configuration is stored outside Git, then a prompt appears for overwriting the existing file.
  3. Follow the prompts.

Running the Plan Action

Note

You can run the plan action on a stack outside Visual Studio Code. See Creating a Plan Job and Editing a Configuration Using Code Editor.
  1. In the tree navigation on the left side, expand the node for the compartment that you want.
  2. Right-click the stack that you want, and then select the relevant option.
    • Run Plan action on stack (displayed if the configuration is stored in Git)
    • Save changes and run Plan action on stack (displayed if the configuration is stored elsewhere; for example, locally, or in an Object Storage bucket)
    The status of the action is shown on the lower right corner. If the configuration is stored outside Git, then you are prompted to accept overwriting the existing file.
  3. Follow the prompts.
You can go to the Console to check status. Monitor the job status (lifecycle state) by getting the job's details. Succeeded (SUCCEEDED) indicates that the job has completed. Depending on the complexity of the job, the operation can take some time. While the job runs, or after it finishes, you can get the job logs content.

Running the Apply Action

Note

You can run the apply action on a stack outside Visual Studio Code. See Creating an Apply Job and Editing a Configuration Using Code Editor.
  1. In the tree navigation on the left side, expand the node for the compartment that you want.
  2. Right-click the stack that you want, and then select the relevant option.
    • Run Apply action on stack (displayed if the configuration is stored in Git)
    • Save changes and run Apply action on stack (displayed if the configuration is stored elsewhere; for example, locally, or in an Object Storage bucket)
    The status of the action is shown on the lower right corner. If the configuration is stored outside Git, then a prompt appears for overwriting the existing file.
  3. Follow the prompts.

Downloading the Terraform Configuration

  1. In the tree navigation on the left side, expand the node for the compartment that you want.
  2. Right-click the stack that you want, and then select Download configuration.
    If the configuration is stored in Git, then a prompt for the Git URL appears at the top of the window, followed by prompts for credentials. If the configuration is stored outside Git, then a prompt might appear for overwriting the existing file.
  3. Follow the prompts.