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
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.
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.
Copy
[
![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:
Copy
[](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.
Copy
<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:
Copy
<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).
If you're 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.
To view the resources in a different compartment, use the Compartment filter to switch compartments.
You must have permission to work in a compartment to see the resources in it. If you're not sure which compartment to use, contact an administrator. For more information, see Understanding Compartments.
For Terraform version, select the version that you want to use for the new stack.
Note
Terraform versions aren't backward compatible.
Optionally add tags:
To add a defined tag, select the namespace and key, then enter a value.
To add a free-form tag, enter a key and value.
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
Don't 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 didn't select Run apply in the Create stack page), run an apply job on your new stack.