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 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.
Supported Providers
- GitHub
Example URL 1: Direct:
https://github.com/myrepo/mydirectory/master.zip
Example 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 URL 1: Direct:
https://gitlab.com/myrepo/mydirectory/master.zip
Example URL 2: Release:
https://gitlab.com/myrepo/mydirectory/0.0.1.zip
Example URL:
https://objectstorage.region.oraclecloud.com/p/encrypted-string/n/object-storage-namespace/b/bucket/o/filename
To troubleshoot an error code, see Error Code 400 for Deploy Button.
To display the linked deploy button
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
-
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.
-
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.
-
Enter a Name for the new stack (or accept the default name provided). Avoid entering confidential information.
-
Optionally enter a Description.
-
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.
-
Select a Terraform version.
Note
Terraform versions aren't backward compatible. 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.
-
Select Next.
The Configure variables panel displays variables from the selected Terraform configuration file.
-
Review the variables and make changes as necessary.
Important
Do not add your private key or other confidential information to configuration variables. -
Select Next.
-
In the Review panel, verify your stack configuration.
Run apply is selected by default. Preserve this setting to automatically provision resources on stack creation.
-
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.