Creating a Stack from a Private Template

Create a stack in Resource Manager from a template. A template is a prebuilt Terraform configuration for deploying cloud resources in a common scenario.

For more information about templates, see Oracle-Provided Templates and Managing Private Templates.

    1. On the Private templates list page, find the private template that you want to work with. If you need help finding the list page or the private template, see Listing Private Templates.
    2. From the Actions menu (Actions Menu) for the private template, select Create stack from private template.
      The Create stack page opens with the private template already selected.
    3. (Optional) To use custom providers, select Use custom providers and then select the bucket that contains the custom provider.
    4. (Optional) Edit the default stack name and enter a stack description. Avoid entering confidential information.
    5. Select the compartment where you want to create the stack.
    6. For Terraform version, select the version used by the Terraform configuration.
    7. (Optional) Select 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.
    8. Select Next.
    9. 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.
    10. Select Next.
    11. In the Review panel, verify the stack configuration.
    12. (Optional) To automatically provision resources on creation of the stack, select Run apply.
      Run apply is selected by default for stacks created from the Deploy to Oracle Cloud button or from Marketplace.
    13. Select Create.

    The stack is created and its 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-from-template command and required parameters to create a stack from a template.

    oci resource-manager stack create-from-template --compartment-id <compartment_OCID> --template-id <template_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 a template.

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