This 20-minute tutorial shows you how to use the Oracle Cloud
Stack console to create and test a custom stack template.
Background
To build and deploy their applications, businesses often
require sophisticated environments that consist of multiple,
integrated cloud services. Provisioning each of these services
individually is time-consuming and error-prone. Oracle Cloud
Stack uses templates to provision a group of cloud resources
called a stack.
Templates also support input parameters. Users can enter values
for these parameters when they create a stack from the template.
Cloud Stack provides several standard templates, but you can
quickly create your own template using the web console. If you
prefer to create a custom template by cloning one of the Oracle
ones, see the tutorial Customizing a Template for Oracle Cloud Stack.
What Do You Need?
Valid credentials for an Oracle Cloud account
An active subscription to Oracle Database Cloud Service
An active subscription to Oracle Cloud Infrastructure Object Storage Classic
Your REST endpoint URL for Oracle Cloud Infrastructure Object Storage Classic (see About REST URLs)
Configure
Template Storage
If this is the first time for anyone in this Oracle Cloud
account to work with templates in the Cloud Stack console, you
must create a cloud storage container for your unpublished
template files.
From the Oracle Cloud Infrastructure Console, click the Navigation menu at the top left corner of the page, expand Classic Infrastructure Services, and then select Storage Classic.
Note: On some older Oracle Cloud accounts, you use the Oracle Cloud Infrastructure Classic Console. Click the Navigation menu, and then select Storage Classic.
From the Storage Classic console, click Create Container.
For Name, enter StackTemplates.
Then click Create.
Click the Navigation menu at the top left corner of the
page, and then select Oracle Database Cloud Service.
Tip: You can access Cloud Stack from any Oracle Platform service.
From the Oracle Database Cloud Service console, click the Navigation
menu
at the top left corner of the page, and then select Cloud
Stack.
Click the Unpublished tab. The Cloud
Storage Credentials dialog displays.
Note: You can also update the existing storage
settings by clicking Configure cloud storage.
For Cloud Storage Container, enter Your_Storage_REST_URL/StackTemplates.
For example, https://foo.storage.oraclecloud.com/v1/MyService-bar/StackTemplates.
For Username and Password,
enter your Oracle Cloud credentials, or the credentials of
another Oracle Cloud user who has write access to this storage
container.
Click Apply Changes.
Create
a Template
From the Unpublished Templates page, click
Add Template, and then select Create
New Template. The Template Builder
is displayed.
Note: You do not have to explicitly define the
serviceName parameter in your templates.
Update this value and use the Fn::Join
function to add the text "DB" to the end of the stack's name.
Pass the arguments to this function as a sequence:
'Fn::Join':
- ''
- - 'Fn::GetParam': serviceName
- DB
For vmPublicKeyText, retrieve the value of
your publicKey parameter: