Creating a Stack from DevOps

Create a stack in Resource Manager from a Terraform configuration stored in DevOps.

Ensure that your Terraform configuration is valid. See Terraform Configurations for Resource Manager and Authoring Configurations.

For information about DevOps, see DevOps.

    1. Open the navigation menu and click Developer Services. Under Resource Manager, click Stacks.
    2. On the Stacks page, select a compartment.
    3. Click Create stack.
    4. On the Create stack page, under Choose the origin of the Terraform configuration, select Source code control system.
    5. Under Stack configuration, for Source code management type, select DevOps.
    6. Select the DevOps project, repository, and branch that contains the Terraform configuration that you want. The list of branches is limited to 100.
    7. (Optional) To use a directory other than the root directory for running Terraform, specify the working directory. This field is visible when the selected branch has directories. Examples:
      • One level: Directory
      • Two levels: Directory/Subdirectory
    8. (Optional) To use custom providers, select Use custom providers and then select the bucket that contains the custom provider.
    9. (Optional) Edit the default stack name and enter a stack description. Avoid entering confidential information.
    10. Select the compartment where you want to create the stack.
    11. For Terraform version, select the version used by the Terraform configuration.
    12. (Optional) Click Show advanced options and assign tags to the stack.
      • Tag namespace: To add a defined tag, select an existing namespace. To add a free-from tag, leave the value blank.
      • Tag key: To add a defined tag, select an existing tag key. To add a free-form tag, type the key name that you want.
      • Tag value: Type the tag value that you want.
      • Add tag: Click to add another tag.
    13. Click Next.
    14. In the Configure variables panel, review the variables listed from the Terraform configuration and change as needed.
      Important

      Don't add your private key or other confidential information to configuration variables.
    15. Click Next.
    16. In the Review panel, verify the stack configuration.
    17. (Optional) To automatically provision resources on creation of the stack, select Run apply.
    18. Click Create.

    The stack is created and its Stack details page opens.

    If you selected Run apply, then Resource Manager runs the apply action on the new stack.

  • Use the oci resource-manager stack create-stack-create-dev-ops-config-source-details command and required parameters to create a stack from DevOps.

    oci resource-manager stack create-stack-create-dev-ops-config-source-details --compartment-id <compartment_OCID> --config-source-project-id <devops_project_OCID> --config-source-repository-id <devops_repository_OCID>

    For a complete list of parameters and values for CLI commands, see the Command Line Reference for Resource Manager.

  • Use the CreateStack operation to create a stack from DevOps.

    For an example of the configSource part of the request, see CreateDevOpsConfigSourceDetails.