Beside the OCI Commandline SDK there are also ansible modules available for configuring and changing components in the Oracle Cloud.
The modules are under the GPL 3.0 license or the Apache 2.0 license and can therefore be used without any license implications, take care that creating autonomous database can cause costs in your OCI account.
For the configuration of the ansible modules there is a screencast on the git repository and the modules can also be downloaded from Ansible Galaxy A more detailed installation documentation is available on the official Ansible Documentation.
There are sample playbooks available in the repository which explains most of the available modules. The documentation for the modules are a little bit tricky to find. Documentation
After the installation and the OCI SDK configuration you can start writing your playbook for creating Always Free Autonomous Databases.
Task for creation of an Autonomous Database
The easiest Task for the creation of an autonomous always free database looks like this:
For the creation the module oci_autonomous_database is used with the corresponding parameters. A list of all available parameters can be found in the documentation (link).
The important parameter is the “is_free_tier” parameter. Unfortunately the other parameters like data_storage_size_in_tbs must be set but will be ignored if the parameter is_free_tier is set.
Output of the creation
The answer of this task will look like the following output:
In the output above we see in the block starting at line 5 the URLs for Machine Learning, Apex and for the SQL Developer Web.
The most important line is here line 15 which shows that this autonomous database is a always free database and the used settings for size and cpu during the creation of the database were ignored.
On line 24 we have the ID of this database which can be used in further steps in the playbook or in other playbooks as example for starting and stopping the database.
The connection strings for the precreated three services can be found on in the block starting in line 34.
With the Ansible Modules for the Oracle Cloud it is easy to create Autonomous Databases and it is easy to create always free Autonomous Databases. If an always free Autonomous Database is sufficient for your testing environment you can easily include a role in your deployment procedure for building a database and run your tests. Afterwards you can stop or delete the database and everything without costs.
From my point of view this could be a solution for minimizing the cost of a development department.