Deploy GCP Oracle Autonomous Databases

The gcp:oracledatabase/autonomousDatabase:AutonomousDatabase resource, part of the Pulumi GCP provider, provisions Oracle Autonomous Database instances on Google Cloud: their network placement, compute resources, and database configuration. This guide focuses on three capabilities: VPC and Oracle Database Network connectivity, compute and storage sizing, and public vs private access patterns.

Autonomous Databases connect to existing VPC networks or Oracle Database Network resources. The examples are intentionally small. Combine them with your own network infrastructure and security policies.

Create a database with VPC network and CIDR

Most deployments connect to an existing VPC network and allocate a CIDR range for database connectivity.

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const _default = gcp.compute.getNetwork({
    name: "new",
    project: "my-project",
});
const myADB = new gcp.oracledatabase.AutonomousDatabase("myADB", {
    autonomousDatabaseId: "my-instance",
    location: "us-east4",
    project: "my-project",
    database: "mydatabase",
    adminPassword: "123Abpassword",
    network: _default.then(_default => _default.id),
    cidr: "10.5.0.0/24",
    properties: {
        computeCount: 2,
        dataStorageSizeTb: 1,
        dbVersion: "19c",
        dbWorkload: "OLTP",
        licenseType: "LICENSE_INCLUDED",
    },
    deletionProtection: true,
});
import pulumi
import pulumi_gcp as gcp

default = gcp.compute.get_network(name="new",
    project="my-project")
my_adb = gcp.oracledatabase.AutonomousDatabase("myADB",
    autonomous_database_id="my-instance",
    location="us-east4",
    project="my-project",
    database="mydatabase",
    admin_password="123Abpassword",
    network=default.id,
    cidr="10.5.0.0/24",
    properties={
        "compute_count": 2,
        "data_storage_size_tb": 1,
        "db_version": "19c",
        "db_workload": "OLTP",
        "license_type": "LICENSE_INCLUDED",
    },
    deletion_protection=True)
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/compute"
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/oracledatabase"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_default, err := compute.LookupNetwork(ctx, &compute.LookupNetworkArgs{
			Name:    "new",
			Project: pulumi.StringRef("my-project"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = oracledatabase.NewAutonomousDatabase(ctx, "myADB", &oracledatabase.AutonomousDatabaseArgs{
			AutonomousDatabaseId: pulumi.String("my-instance"),
			Location:             pulumi.String("us-east4"),
			Project:              pulumi.String("my-project"),
			Database:             pulumi.String("mydatabase"),
			AdminPassword:        pulumi.String("123Abpassword"),
			Network:              pulumi.String(_default.Id),
			Cidr:                 pulumi.String("10.5.0.0/24"),
			Properties: &oracledatabase.AutonomousDatabasePropertiesArgs{
				ComputeCount:      pulumi.Float64(2),
				DataStorageSizeTb: pulumi.Int(1),
				DbVersion:         pulumi.String("19c"),
				DbWorkload:        pulumi.String("OLTP"),
				LicenseType:       pulumi.String("LICENSE_INCLUDED"),
			},
			DeletionProtection: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var @default = Gcp.Compute.GetNetwork.Invoke(new()
    {
        Name = "new",
        Project = "my-project",
    });

    var myADB = new Gcp.OracleDatabase.AutonomousDatabase("myADB", new()
    {
        AutonomousDatabaseId = "my-instance",
        Location = "us-east4",
        Project = "my-project",
        Database = "mydatabase",
        AdminPassword = "123Abpassword",
        Network = @default.Apply(@default => @default.Apply(getNetworkResult => getNetworkResult.Id)),
        Cidr = "10.5.0.0/24",
        Properties = new Gcp.OracleDatabase.Inputs.AutonomousDatabasePropertiesArgs
        {
            ComputeCount = 2,
            DataStorageSizeTb = 1,
            DbVersion = "19c",
            DbWorkload = "OLTP",
            LicenseType = "LICENSE_INCLUDED",
        },
        DeletionProtection = true,
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetNetworkArgs;
import com.pulumi.gcp.oracledatabase.AutonomousDatabase;
import com.pulumi.gcp.oracledatabase.AutonomousDatabaseArgs;
import com.pulumi.gcp.oracledatabase.inputs.AutonomousDatabasePropertiesArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var default = ComputeFunctions.getNetwork(GetNetworkArgs.builder()
            .name("new")
            .project("my-project")
            .build());

        var myADB = new AutonomousDatabase("myADB", AutonomousDatabaseArgs.builder()
            .autonomousDatabaseId("my-instance")
            .location("us-east4")
            .project("my-project")
            .database("mydatabase")
            .adminPassword("123Abpassword")
            .network(default_.id())
            .cidr("10.5.0.0/24")
            .properties(AutonomousDatabasePropertiesArgs.builder()
                .computeCount(2.0)
                .dataStorageSizeTb(1)
                .dbVersion("19c")
                .dbWorkload("OLTP")
                .licenseType("LICENSE_INCLUDED")
                .build())
            .deletionProtection(true)
            .build());

    }
}
resources:
  myADB:
    type: gcp:oracledatabase:AutonomousDatabase
    properties:
      autonomousDatabaseId: my-instance
      location: us-east4
      project: my-project
      database: mydatabase
      adminPassword: 123Abpassword
      network: ${default.id}
      cidr: 10.5.0.0/24
      properties:
        computeCount: '2'
        dataStorageSizeTb: '1'
        dbVersion: 19c
        dbWorkload: OLTP
        licenseType: LICENSE_INCLUDED
      deletionProtection: 'true'
variables:
  default:
    fn::invoke:
      function: gcp:compute:getNetwork
      arguments:
        name: new
        project: my-project

The network property references your VPC, and cidr allocates a subnet range for the database. Inside properties, computeCount sets CPU cores, dataStorageSizeTb defines storage capacity, and dbWorkload specifies whether the database optimizes for OLTP or data warehousing. The licenseType determines whether you bring your own Oracle license or use Google’s included licensing.

Deploy using Oracle Database Network resources

Organizations managing multiple Oracle databases often centralize network configuration using OdbNetwork and OdbSubnet resources.

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const myADB = new gcp.oracledatabase.AutonomousDatabase("myADB", {
    autonomousDatabaseId: "my-instance",
    location: "europe-west2",
    project: "my-project",
    database: "mydatabase",
    adminPassword: "123Abpassword",
    odbNetwork: "projects/my-project/locations/europe-west2/odbNetworks/my-odbnetwork",
    odbSubnet: "projects/my-project/locations/europe-west2/odbNetworks/my-odbnetwork/odbSubnets/my-odbsubnet",
    properties: {
        computeCount: 2,
        dataStorageSizeTb: 1,
        dbVersion: "19c",
        dbWorkload: "OLTP",
        licenseType: "LICENSE_INCLUDED",
    },
    deletionProtection: true,
});
import pulumi
import pulumi_gcp as gcp

my_adb = gcp.oracledatabase.AutonomousDatabase("myADB",
    autonomous_database_id="my-instance",
    location="europe-west2",
    project="my-project",
    database="mydatabase",
    admin_password="123Abpassword",
    odb_network="projects/my-project/locations/europe-west2/odbNetworks/my-odbnetwork",
    odb_subnet="projects/my-project/locations/europe-west2/odbNetworks/my-odbnetwork/odbSubnets/my-odbsubnet",
    properties={
        "compute_count": 2,
        "data_storage_size_tb": 1,
        "db_version": "19c",
        "db_workload": "OLTP",
        "license_type": "LICENSE_INCLUDED",
    },
    deletion_protection=True)
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/oracledatabase"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := oracledatabase.NewAutonomousDatabase(ctx, "myADB", &oracledatabase.AutonomousDatabaseArgs{
			AutonomousDatabaseId: pulumi.String("my-instance"),
			Location:             pulumi.String("europe-west2"),
			Project:              pulumi.String("my-project"),
			Database:             pulumi.String("mydatabase"),
			AdminPassword:        pulumi.String("123Abpassword"),
			OdbNetwork:           pulumi.String("projects/my-project/locations/europe-west2/odbNetworks/my-odbnetwork"),
			OdbSubnet:            pulumi.String("projects/my-project/locations/europe-west2/odbNetworks/my-odbnetwork/odbSubnets/my-odbsubnet"),
			Properties: &oracledatabase.AutonomousDatabasePropertiesArgs{
				ComputeCount:      pulumi.Float64(2),
				DataStorageSizeTb: pulumi.Int(1),
				DbVersion:         pulumi.String("19c"),
				DbWorkload:        pulumi.String("OLTP"),
				LicenseType:       pulumi.String("LICENSE_INCLUDED"),
			},
			DeletionProtection: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var myADB = new Gcp.OracleDatabase.AutonomousDatabase("myADB", new()
    {
        AutonomousDatabaseId = "my-instance",
        Location = "europe-west2",
        Project = "my-project",
        Database = "mydatabase",
        AdminPassword = "123Abpassword",
        OdbNetwork = "projects/my-project/locations/europe-west2/odbNetworks/my-odbnetwork",
        OdbSubnet = "projects/my-project/locations/europe-west2/odbNetworks/my-odbnetwork/odbSubnets/my-odbsubnet",
        Properties = new Gcp.OracleDatabase.Inputs.AutonomousDatabasePropertiesArgs
        {
            ComputeCount = 2,
            DataStorageSizeTb = 1,
            DbVersion = "19c",
            DbWorkload = "OLTP",
            LicenseType = "LICENSE_INCLUDED",
        },
        DeletionProtection = true,
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.oracledatabase.AutonomousDatabase;
import com.pulumi.gcp.oracledatabase.AutonomousDatabaseArgs;
import com.pulumi.gcp.oracledatabase.inputs.AutonomousDatabasePropertiesArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var myADB = new AutonomousDatabase("myADB", AutonomousDatabaseArgs.builder()
            .autonomousDatabaseId("my-instance")
            .location("europe-west2")
            .project("my-project")
            .database("mydatabase")
            .adminPassword("123Abpassword")
            .odbNetwork("projects/my-project/locations/europe-west2/odbNetworks/my-odbnetwork")
            .odbSubnet("projects/my-project/locations/europe-west2/odbNetworks/my-odbnetwork/odbSubnets/my-odbsubnet")
            .properties(AutonomousDatabasePropertiesArgs.builder()
                .computeCount(2.0)
                .dataStorageSizeTb(1)
                .dbVersion("19c")
                .dbWorkload("OLTP")
                .licenseType("LICENSE_INCLUDED")
                .build())
            .deletionProtection(true)
            .build());

    }
}
resources:
  myADB:
    type: gcp:oracledatabase:AutonomousDatabase
    properties:
      autonomousDatabaseId: my-instance
      location: europe-west2
      project: my-project
      database: mydatabase
      adminPassword: 123Abpassword
      odbNetwork: projects/my-project/locations/europe-west2/odbNetworks/my-odbnetwork
      odbSubnet: projects/my-project/locations/europe-west2/odbNetworks/my-odbnetwork/odbSubnets/my-odbsubnet
      properties:
        computeCount: '2'
        dataStorageSizeTb: '1'
        dbVersion: 19c
        dbWorkload: OLTP
        licenseType: LICENSE_INCLUDED
      deletionProtection: 'true'

The odbNetwork and odbSubnet properties reference pre-configured Oracle Database Network infrastructure instead of VPC network and CIDR. This approach simplifies IP allocation when you manage multiple databases that share networking resources.

Enable public IP access with mTLS

Some deployments require public internet access, typically for development or external application connectivity.

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const myADB = new gcp.oracledatabase.AutonomousDatabase("myADB", {
    autonomousDatabaseId: "my-instance",
    location: "europe-west2",
    project: "my-project",
    database: "mydatabase",
    adminPassword: "123Abpassword",
    properties: {
        computeCount: 2,
        dataStorageSizeTb: 1,
        dbVersion: "19c",
        dbWorkload: "OLTP",
        licenseType: "LICENSE_INCLUDED",
        mtlsConnectionRequired: true,
    },
    deletionProtection: true,
});
import pulumi
import pulumi_gcp as gcp

my_adb = gcp.oracledatabase.AutonomousDatabase("myADB",
    autonomous_database_id="my-instance",
    location="europe-west2",
    project="my-project",
    database="mydatabase",
    admin_password="123Abpassword",
    properties={
        "compute_count": 2,
        "data_storage_size_tb": 1,
        "db_version": "19c",
        "db_workload": "OLTP",
        "license_type": "LICENSE_INCLUDED",
        "mtls_connection_required": True,
    },
    deletion_protection=True)
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/oracledatabase"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := oracledatabase.NewAutonomousDatabase(ctx, "myADB", &oracledatabase.AutonomousDatabaseArgs{
			AutonomousDatabaseId: pulumi.String("my-instance"),
			Location:             pulumi.String("europe-west2"),
			Project:              pulumi.String("my-project"),
			Database:             pulumi.String("mydatabase"),
			AdminPassword:        pulumi.String("123Abpassword"),
			Properties: &oracledatabase.AutonomousDatabasePropertiesArgs{
				ComputeCount:           pulumi.Float64(2),
				DataStorageSizeTb:      pulumi.Int(1),
				DbVersion:              pulumi.String("19c"),
				DbWorkload:             pulumi.String("OLTP"),
				LicenseType:            pulumi.String("LICENSE_INCLUDED"),
				MtlsConnectionRequired: pulumi.Bool(true),
			},
			DeletionProtection: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() => 
{
    var myADB = new Gcp.OracleDatabase.AutonomousDatabase("myADB", new()
    {
        AutonomousDatabaseId = "my-instance",
        Location = "europe-west2",
        Project = "my-project",
        Database = "mydatabase",
        AdminPassword = "123Abpassword",
        Properties = new Gcp.OracleDatabase.Inputs.AutonomousDatabasePropertiesArgs
        {
            ComputeCount = 2,
            DataStorageSizeTb = 1,
            DbVersion = "19c",
            DbWorkload = "OLTP",
            LicenseType = "LICENSE_INCLUDED",
            MtlsConnectionRequired = true,
        },
        DeletionProtection = true,
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.oracledatabase.AutonomousDatabase;
import com.pulumi.gcp.oracledatabase.AutonomousDatabaseArgs;
import com.pulumi.gcp.oracledatabase.inputs.AutonomousDatabasePropertiesArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var myADB = new AutonomousDatabase("myADB", AutonomousDatabaseArgs.builder()
            .autonomousDatabaseId("my-instance")
            .location("europe-west2")
            .project("my-project")
            .database("mydatabase")
            .adminPassword("123Abpassword")
            .properties(AutonomousDatabasePropertiesArgs.builder()
                .computeCount(2.0)
                .dataStorageSizeTb(1)
                .dbVersion("19c")
                .dbWorkload("OLTP")
                .licenseType("LICENSE_INCLUDED")
                .mtlsConnectionRequired(true)
                .build())
            .deletionProtection(true)
            .build());

    }
}
resources:
  myADB:
    type: gcp:oracledatabase:AutonomousDatabase
    properties:
      autonomousDatabaseId: my-instance
      location: europe-west2
      project: my-project
      database: mydatabase
      adminPassword: 123Abpassword
      properties:
        computeCount: '2'
        dataStorageSizeTb: '1'
        dbVersion: 19c
        dbWorkload: OLTP
        licenseType: LICENSE_INCLUDED
        mtlsConnectionRequired: 'true'
      deletionProtection: 'true'

Without network, cidr, odbNetwork, or odbSubnet properties, the database receives a public IP address. Setting mtlsConnectionRequired to true enforces mutual TLS authentication, requiring clients to present valid certificates for connections.

Beyond these examples

These snippets focus on specific database-level features: VPC and Oracle Database Network connectivity, compute and storage sizing, and licensing and workload types. They’re intentionally minimal rather than full database deployments.

The examples may reference pre-existing infrastructure such as VPC networks (for network/cidr examples) and OdbNetwork and OdbSubnet resources (for odbNetwork example). They focus on configuring the database rather than provisioning everything around it.

To keep things focused, common database patterns are omitted, including:

  • Auto-scaling configuration (isAutoScalingEnabled, isStorageAutoScalingEnabled)
  • Backup retention and maintenance schedules
  • Private endpoints and custom IP allocation
  • Customer contacts and Operations Insights
  • Character set and database edition selection

These omissions are intentional: the goal is to illustrate how each database feature is wired, not provide drop-in production modules. See the Autonomous Database resource reference for all available configuration options.

Let's deploy GCP Oracle Autonomous Databases

Get started with Pulumi Cloud, then follow our quick setup guide to deploy this infrastructure.

Try Pulumi Cloud for FREE

Frequently Asked Questions

Configuration & Immutability
What properties can't I change after creating the database?
Most properties are immutable, including autonomousDatabaseId, database, displayName, location, network, cidr, odbNetwork, odbSubnet, adminPassword, and the entire properties object (compute, storage, version, workload, license). Changes require recreating the resource.
What's required to create an Autonomous Database?
You need autonomousDatabaseId, location, project, database, adminPassword, networking (either network+cidr OR odbNetwork+odbSubnet), and properties with computeCount, storage size (dataStorageSizeTb or dataStorageSizeGb), dbVersion, dbWorkload, and licenseType.
What's the difference between database and displayName?
database is the unique database name (max 30 alphanumeric characters, must start with a letter) used for identification. displayName is a user-friendly name that doesn’t need to be unique within your project.
Networking Options
Should I use network+cidr or odbNetwork+odbSubnet for connectivity?
Use network and cidr for standard VPC connectivity, or odbNetwork and odbSubnet for OdbNetwork-based IP allocation. These approaches are mutually exclusive and both are immutable after creation.
How do I create a publicly accessible database?
Omit network, cidr, odbNetwork, and odbSubnet properties. Set properties.mtlsConnectionRequired to true to require mutual TLS for secure public access.
Database Properties & Scaling
How do I specify storage size for the database?
Use either properties.dataStorageSizeTb (e.g., 1 for 1 TB) or properties.dataStorageSizeGb (e.g., 48 for 48 GB). Both options are immutable after creation.
How do I enable auto-scaling for compute and storage?
Set properties.isAutoScalingEnabled to true for compute auto-scaling and properties.isStorageAutoScalingEnabled to true for storage auto-scaling. These are part of the immutable properties object.
What license types are available?
You can use LICENSE_INCLUDED (Oracle provides the license) or BRING_YOUR_OWN_LICENSE (you provide your own Oracle license). Set via properties.licenseType.
Security & Access
Can I change the admin password after creation?
No, adminPassword is immutable. You must set the correct password for the default ADMIN user during creation.
What does mtlsConnectionRequired control?
properties.mtlsConnectionRequired determines whether mutual TLS is required for database connections. Set to true for public databases to enforce secure connections, or false for VPC-connected databases.
Should I enable deletion protection?
All examples set deletionProtection to true to prevent accidental deletion. You can set it to false if you need to allow deletion without additional confirmation.

Using a different cloud?

Explore database guides for other cloud providers: