Using the Deploy to Oracle Cloud Button

Launch a remote Terraform configuration with the Deploy to Oracle Cloud button.

This page describes the advanced topic of constructing a URL for a Deploy to Oracle Cloud button.

When properly linked, this button provides a direct option for your users to create stacks with your Terraform configuration.

This image shows the Deploy to Oracle Cloud button.

This button takes a user directly to the Create Stack page in the Oracle Cloud Infrastructure Console. The button is linked to a Terraform configuration file package that you specify, so the Terraform configuration is already selected for the user when they create the stack. You can store Terraform configuration files in a supported provider.

Example of Functioning Deploy Button

Tip

Quickly create stacks with example OCI Terraform configurations. Go to Terraform Oracle Cloud Infrastructure Provider Examples, navigate to the folder for the configuration you want (such as adm), and then select the Deploy to Oracle Cloud button under "Magic Button" in the readme.

The following Deploy to Oracle Cloud button is configured to launch the template from https://github.com/oracle-quickstart/oci-cloudnative.

Deploy to Oracle Cloud

Supported Providers

The following providers are supported for forming package URLs to use with the Deploy to Oracle Cloud button:

To troubleshoot an error code, see Error Code 400 for Deploy Button.

To display the linked deploy button

Important

Ensure that your Terraform configuration file is valid. SeeAuthoring Configurations and Terraform Configurations for Resource Manager.

You can display the linked Deploy to Oracle Cloud button on repository pages and other web pages.

Markdown code

To display the Deploy to Oracle Cloud button on a repository page, add the following Markdown code to a README.md file.

[
![Deploy to Oracle Cloud]
(https://oci-resourcemanager-plugin.plugins.oci.oraclecloud.com/latest/deploy-to-oracle-cloud.svg)
]
(https://cloud.oracle.com/resourcemanager/stacks/create
?zipUrl=<package-url>)

<package-url> is the URL for the .zip file to a Terraform configuration that is stored in a supported provider.

Example Markdown code with a package URL from GitHub:

[![Deploy to Oracle Cloud](https://oci-resourcemanager-plugin.plugins.oci.oraclecloud.com/latest/deploy-to-oracle-cloud.svg)](https://cloud.oracle.com/resourcemanager/stacks/create?zipUrl=https://github.com/myrepo/mydirectory/master.zip)

HTML code

To display the Deploy to Oracle Cloud button on a web page, add the following HTML code.

<a 
href="https://cloud.oracle.com/resourcemanager/stacks/create?zipUrl=<package-url>" 
target="_blank">
  <img 
src="https://oci-resourcemanager-plugin.plugins.oci.oraclecloud.com/latest/deploy-to-oracle-cloud.svg" 
alt="Deploy to Oracle Cloud"/>
</a>

<package-url> is the URL for the .zip file to a Terraform configuration that is stored in a supported provider.

Example HTML code with a package URL from GitHub:

<a href="https://cloud.oracle.com/resourcemanager/stacks/create?zipUrl=https://github.com/myrepo/mydirectory/master.zip" target="_blank">
  <img src="https://oci-resourcemanager-plugin.plugins.oci.oraclecloud.com/latest/deploy-to-oracle-cloud.svg" alt="Deploy to Oracle Cloud"/>
</a>

To create a stack from the linked deploy button

  1. Select Deploy to Oracle Cloud (the deploy button linked to the Terraform configuration).

    To troubleshoot an error code, see Error Code 400 for Deploy Button.

  2. If you are not yet signed in to the Oracle Cloud Infrastructure Console, then sign in. See Signing In for the First Time.

    The Create stack page appears with the selected package identified.

  3. Enter a Name for the new stack (or accept the default name provided). Avoid entering confidential information.

  4. Optionally enter a Description.

  5. From the Create in compartment drop-down, select the compartment where you want to create the stack.

    A compartment from the list scope is set by default.

  6. Select a Terraform version.

    Note

    Terraform versions aren't backward compatible.
  7. If you have permissions to create a resource, then you also have permissions to apply free-form tags to that resource. To apply a defined tag, you must have permissions to use the tag namespace. For more information about tagging, see Resource Tags. If you're not sure whether to apply tags, skip this option or ask an administrator. You can apply tags later.

  8. Select Next.

    The Configure variables panel displays variables from the selected Terraform configuration file.

  9. Review the variables and make changes as necessary.

    Important

    Do not add your private key or other confidential information to configuration variables.
  10. Select Next.

  11. In the Review panel, verify your stack configuration.

    Run apply is selected by default. Preserve this setting to automatically provision resources on stack creation.

  12. Select Create to create your stack.

    The stack details page for the new stack appears.

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

To deploy the defined resources (if you did not select Run apply in the Create stack page), run an apply job on your new stack.