IaC Bazaar
Oracle CloudPlan-validated

Autonomous Database (Serverless)

ATP/ADW/JSON/APEX autonomous database with private endpoint, mTLS wallet output, ACLs, auto-scaling and backup config.

terraformOracle Cloud#oci

Compare Managed Relational Database across clouds →

oci-autonomous-databaseterraform v1.7

Verification

Plan-validated

Passed: module logic verified on a mocked plan — inputs, validation rules, conditional creation and outputs resolve (no real provider, no cloud).

Conformance

  • Static validation (fmt · validate · tflint)
  • Security scan clean (Checkov)
  • Plan tests (mocked: validation rules · outputs)

Provenance

  • SHA-256 checksum
  • Signature (pending)

Functional

  • Live test pending (no cloud run yet)

Last verified 2026-06-28 · how we verify

Documentation

oci-autonomous-database

ATP/ADW/JSON/APEX autonomous database with private endpoint, mTLS wallet output, ACLs, auto-scaling and backup config. Works with Terraform and OpenTofu (>= 1.6), OCI provider >= 8.0, < 9.0.

Secure defaults:

  • Mutual TLS required for every connection
  • No network path is opened implicitly — you either give a private-endpoint subnet or an explicit IP/VCN whitelist
  • ECPU compute model with compute auto-scaling on, 60-day automatic backups
  • Optional customer-managed encryption key (OCI Vault) and long-term backup
  • is_free_tier = true flips to an Always Free database for $0 environments

Usage

module "atp" {
  source = "./oci-autonomous-database"

  compartment_id = "ocid1.compartment.oc1..xxxx"
  db_name        = "appdb"
  workload       = "OLTP"
  admin_password = var.adb_admin_password # inject, never hardcode

  # Private endpoint in your VCN:
  subnet_id              = module.vcn.subnet_ids["db"]
  nsg_ids                = [module.vcn.network_security_group_ids["db"]]
  private_endpoint_label = "appdb"

  ecpu_count      = 2
  storage_size_gb = 100

  generate_wallet = true
  wallet_password = var.adb_wallet_password
}

Inputs

NameTypeDefaultDescription
compartment_idstringCompartment OCID (required)
db_namestring1-14 alphanumeric, starts with a letter (required)
display_namestringnullConsole name; defaults to db_name
workloadstringOLTPOLTP, DW, AJD or APEX
db_versionstring23aiOracle Database version
admin_passwordstring (sensitive)ADMIN password, 12-30 chars (required)
is_free_tierboolfalseAlways Free database (fixed shape, 20 GB)
ecpu_countnumber2Provisioned ECPUs (paid tier)
storage_size_gbnumber50Data storage GB (paid tier)
compute_auto_scaling_enabledbooltrueAuto-scale compute up to 3x
storage_auto_scaling_enabledboolfalseAuto-expand storage
license_modelstringLICENSE_INCLUDEDOr BRING_YOUR_OWN_LICENSE
mtls_requiredbooltrueRequire mutual TLS
subnet_idstringnullPrivate-endpoint subnet
nsg_idslist(string)[]NSGs on the private endpoint
private_endpoint_labelstringnullPrivate endpoint DNS label
whitelisted_ipslist(string)[]IP/CIDR/VCN-OCID ACL (no private endpoint)
kms_key_id / vault_idstringnullCustomer-managed encryption key
backup_retention_daysnumber60Automatic backup window (1-60)
long_term_backup_enabledboolfalseOne-off long-term backup
long_term_backup_retention_daysnumber9090-3650 days
generate_walletboolfalseEmit a wallet as a sensitive output
wallet_passwordstring (sensitive)nullRequired with generate_wallet
character_set / ncharacter_setstringAL32UTF8 / AL16UTF16Character sets
freeform_tagsmap(string){}Freeform tags

Outputs

autonomous_database_id, connection_strings, connection_urls, private_endpoint, private_endpoint_ip, wallet_base64 (sensitive), long_term_backup_id.

Notes

  • The generated wallet (and admin_password/wallet_password) are stored in Terraform state — encrypt and access-control your state backend.
  • Free tier: auto-scaling, ECPU count, storage size and license model are forced off/ignored by this module so OCI does not reject the request; you get 2 Always Free databases per tenancy.
  • whitelisted_ips and a private endpoint are mutually exclusive — when subnet_id is set the ACL list is ignored by design.
  • AJD/APEX workloads only allow LICENSE_INCLUDED.

Requirements

  • Terraform or OpenTofu >= 1.6
  • Provider oracle/oci >= 8.0, < 9.0

Verification

Static-validated (fmt, validate, tflint). Live apply/destroy testing pending cloud sandbox availability — see catalog status.

License

Commercial — IaC Bazaar EULA. © IaC Bazaar. Original work (not derived from a third-party module).