Using the Deploy to Oracle Cloud Button

This page describes the advanced topic of constructing a URL for 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

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:

  • GitHub

    Example package URL 1: Direct: https://github.com/myrepo/mydirectory/master.zip

    Example package URL 2: Release: https://github.com/myrepo/mydirectory/0.0.1.zip

    To get the .zip URL to a release in GitHub, see https://docs.github.com/en/free-pro-team@latest/github/administering-a-repository/linking-to-releases.

  • GitLab

    Example package URL 1: Direct: https://gitlab.com/myrepo/mydirectory/master.zip

    Example package URL 2: Release: https://gitlab.com/myrepo/mydirectory/0.0.1.zip

  • Object Storage (pre-authenticated request URL)

    Example package URL: https://objectstorage.region.oraclecloud.com/p/encrypted-string/n/object-storage-namespace/b/bucket/o/filename

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. Click Deploy to Oracle Cloud (the deploy button linked to the Terraform configuration).
  2. If you are not yet signed in to the Oracle Cloud Infrastructure Console, then sign in. See Signing In to the Console.

    The Create Stack dialog 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 are not 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 are not sure whether to apply tags, skip this option (you can apply tags later) or ask your administrator.
  8. Click 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. Click Next.
  11. In the Review panel, verify your stack configuration.
  12. Click Create to create your stack.

To deploy the defined resources, run an apply job on your new stack.