Deploy GCP Oracle Autonomous Databases

The gcp:oracledatabase/autonomousDatabase:AutonomousDatabase resource, part of the Pulumi GCP provider, provisions an Oracle Autonomous Database instance in Google Cloud: its compute resources, storage capacity, network placement, and operational settings. This guide focuses on four capabilities: VPC and ODB network integration, compute and storage configuration, auto-scaling and backup policies, and public vs private IP connectivity.

Autonomous Databases require either a VPC network with CIDR allocation or ODB network resources for connectivity. The examples are intentionally small. Combine them with your own network infrastructure and operational policies.

Create a database with VPC network and CIDR

Most deployments connect to an existing VPC network and allocate a CIDR range for the database’s private IP space.

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’s private endpoints. Inside properties, computeCount sets the number of OCPUs, dataStorageSizeTb defines storage capacity, and dbWorkload specifies whether the database is optimized for OLTP or data warehousing. The licenseType determines whether you bring your own Oracle licenses or use license-included pricing.

Configure auto-scaling and backup retention

Production databases often enable auto-scaling to handle variable workloads and configure extended backup retention for compliance.

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",
    displayName: "autonomousDatabase displayname",
    database: "mydatabase",
    adminPassword: "123Abpassword",
    network: _default.then(_default => _default.id),
    cidr: "10.5.0.0/24",
    labels: {
        "label-one": "value-one",
    },
    properties: {
        computeCount: 2,
        dataStorageSizeGb: 48,
        dbVersion: "19c",
        dbEdition: "STANDARD_EDITION",
        dbWorkload: "OLTP",
        isAutoScalingEnabled: true,
        licenseType: "BRING_YOUR_OWN_LICENSE",
        backupRetentionPeriodDays: 60,
        characterSet: "AL32UTF8",
        isStorageAutoScalingEnabled: false,
        maintenanceScheduleType: "REGULAR",
        mtlsConnectionRequired: false,
        nCharacterSet: "AL16UTF16",
        operationsInsightsState: "NOT_ENABLED",
        customerContacts: [{
            email: "xyz@example.com",
        }],
        privateEndpointIp: "10.5.0.11",
        privateEndpointLabel: "myendpoint",
    },
    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",
    display_name="autonomousDatabase displayname",
    database="mydatabase",
    admin_password="123Abpassword",
    network=default.id,
    cidr="10.5.0.0/24",
    labels={
        "label-one": "value-one",
    },
    properties={
        "compute_count": 2,
        "data_storage_size_gb": 48,
        "db_version": "19c",
        "db_edition": "STANDARD_EDITION",
        "db_workload": "OLTP",
        "is_auto_scaling_enabled": True,
        "license_type": "BRING_YOUR_OWN_LICENSE",
        "backup_retention_period_days": 60,
        "character_set": "AL32UTF8",
        "is_storage_auto_scaling_enabled": False,
        "maintenance_schedule_type": "REGULAR",
        "mtls_connection_required": False,
        "n_character_set": "AL16UTF16",
        "operations_insights_state": "NOT_ENABLED",
        "customer_contacts": [{
            "email": "xyz@example.com",
        }],
        "private_endpoint_ip": "10.5.0.11",
        "private_endpoint_label": "myendpoint",
    },
    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"),
			DisplayName:          pulumi.String("autonomousDatabase displayname"),
			Database:             pulumi.String("mydatabase"),
			AdminPassword:        pulumi.String("123Abpassword"),
			Network:              pulumi.String(_default.Id),
			Cidr:                 pulumi.String("10.5.0.0/24"),
			Labels: pulumi.StringMap{
				"label-one": pulumi.String("value-one"),
			},
			Properties: &oracledatabase.AutonomousDatabasePropertiesArgs{
				ComputeCount:                pulumi.Float64(2),
				DataStorageSizeGb:           pulumi.Int(48),
				DbVersion:                   pulumi.String("19c"),
				DbEdition:                   pulumi.String("STANDARD_EDITION"),
				DbWorkload:                  pulumi.String("OLTP"),
				IsAutoScalingEnabled:        pulumi.Bool(true),
				LicenseType:                 pulumi.String("BRING_YOUR_OWN_LICENSE"),
				BackupRetentionPeriodDays:   pulumi.Int(60),
				CharacterSet:                pulumi.String("AL32UTF8"),
				IsStorageAutoScalingEnabled: pulumi.Bool(false),
				MaintenanceScheduleType:     pulumi.String("REGULAR"),
				MtlsConnectionRequired:      pulumi.Bool(false),
				NCharacterSet:               pulumi.String("AL16UTF16"),
				OperationsInsightsState:     pulumi.String("NOT_ENABLED"),
				CustomerContacts: oracledatabase.AutonomousDatabasePropertiesCustomerContactArray{
					&oracledatabase.AutonomousDatabasePropertiesCustomerContactArgs{
						Email: pulumi.String("xyz@example.com"),
					},
				},
				PrivateEndpointIp:    pulumi.String("10.5.0.11"),
				PrivateEndpointLabel: pulumi.String("myendpoint"),
			},
			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",
        DisplayName = "autonomousDatabase displayname",
        Database = "mydatabase",
        AdminPassword = "123Abpassword",
        Network = @default.Apply(@default => @default.Apply(getNetworkResult => getNetworkResult.Id)),
        Cidr = "10.5.0.0/24",
        Labels = 
        {
            { "label-one", "value-one" },
        },
        Properties = new Gcp.OracleDatabase.Inputs.AutonomousDatabasePropertiesArgs
        {
            ComputeCount = 2,
            DataStorageSizeGb = 48,
            DbVersion = "19c",
            DbEdition = "STANDARD_EDITION",
            DbWorkload = "OLTP",
            IsAutoScalingEnabled = true,
            LicenseType = "BRING_YOUR_OWN_LICENSE",
            BackupRetentionPeriodDays = 60,
            CharacterSet = "AL32UTF8",
            IsStorageAutoScalingEnabled = false,
            MaintenanceScheduleType = "REGULAR",
            MtlsConnectionRequired = false,
            NCharacterSet = "AL16UTF16",
            OperationsInsightsState = "NOT_ENABLED",
            CustomerContacts = new[]
            {
                new Gcp.OracleDatabase.Inputs.AutonomousDatabasePropertiesCustomerContactArgs
                {
                    Email = "xyz@example.com",
                },
            },
            PrivateEndpointIp = "10.5.0.11",
            PrivateEndpointLabel = "myendpoint",
        },
        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")
            .displayName("autonomousDatabase displayname")
            .database("mydatabase")
            .adminPassword("123Abpassword")
            .network(default_.id())
            .cidr("10.5.0.0/24")
            .labels(Map.of("label-one", "value-one"))
            .properties(AutonomousDatabasePropertiesArgs.builder()
                .computeCount(2.0)
                .dataStorageSizeGb(48)
                .dbVersion("19c")
                .dbEdition("STANDARD_EDITION")
                .dbWorkload("OLTP")
                .isAutoScalingEnabled(true)
                .licenseType("BRING_YOUR_OWN_LICENSE")
                .backupRetentionPeriodDays(60)
                .characterSet("AL32UTF8")
                .isStorageAutoScalingEnabled(false)
                .maintenanceScheduleType("REGULAR")
                .mtlsConnectionRequired(false)
                .nCharacterSet("AL16UTF16")
                .operationsInsightsState("NOT_ENABLED")
                .customerContacts(AutonomousDatabasePropertiesCustomerContactArgs.builder()
                    .email("xyz@example.com")
                    .build())
                .privateEndpointIp("10.5.0.11")
                .privateEndpointLabel("myendpoint")
                .build())
            .deletionProtection(true)
            .build());

    }
}
resources:
  myADB:
    type: gcp:oracledatabase:AutonomousDatabase
    properties:
      autonomousDatabaseId: my-instance
      location: us-east4
      project: my-project
      displayName: autonomousDatabase displayname
      database: mydatabase
      adminPassword: 123Abpassword
      network: ${default.id}
      cidr: 10.5.0.0/24
      labels:
        label-one: value-one
      properties:
        computeCount: '2'
        dataStorageSizeGb: '48'
        dbVersion: 19c
        dbEdition: STANDARD_EDITION
        dbWorkload: OLTP
        isAutoScalingEnabled: 'true'
        licenseType: BRING_YOUR_OWN_LICENSE
        backupRetentionPeriodDays: '60'
        characterSet: AL32UTF8
        isStorageAutoScalingEnabled: 'false'
        maintenanceScheduleType: REGULAR
        mtlsConnectionRequired: 'false'
        nCharacterSet: AL16UTF16
        operationsInsightsState: NOT_ENABLED
        customerContacts:
          - email: xyz@example.com
        privateEndpointIp: 10.5.0.11
        privateEndpointLabel: myendpoint
      deletionProtection: 'true'
variables:
  default:
    fn::invoke:
      function: gcp:compute:getNetwork
      arguments:
        name: new
        project: my-project

Setting isAutoScalingEnabled to true allows the database to automatically add compute capacity during peak load. The backupRetentionPeriodDays property controls how long automated backups are retained. The privateEndpointIp and privateEndpointLabel properties define a specific private IP and DNS label for the database endpoint. This configuration extends the basic example with production-ready features like customer contact notifications and resource labeling.

Deploy using ODB network and subnet

Some deployments use Oracle Database Network (ODB) resources for network isolation instead of direct VPC integration.

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-existing ODB network resources that manage IP allocation and network isolation. This approach replaces the network and cidr properties used in VPC-based deployments. The database inherits its network configuration from the specified ODB subnet.

Create a database with public IP access

Databases that need external connectivity can be deployed without VPC or ODB network configuration, using public IP access instead.

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'

Omitting network, cidr, odbNetwork, and odbSubnet properties creates a database accessible via public IP. The mtlsConnectionRequired property enforces mutual TLS authentication for all connections, providing transport-layer security for public endpoints.

Beyond these examples

These snippets focus on specific Autonomous Database features: VPC and ODB network integration, compute and storage sizing, and auto-scaling and backup policies. 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 ODB networks and subnets (for odbNetwork example). They focus on configuring the database rather than provisioning the surrounding network infrastructure.

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

  • Database edition selection (dbEdition)
  • Character set configuration (characterSet, nCharacterSet)
  • Maintenance scheduling (maintenanceScheduleType)
  • Operations Insights integration (operationsInsightsState)
  • Storage auto-scaling (isStorageAutoScalingEnabled)
  • Disaster recovery and standby configuration (sourceConfig)

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 be changed after creating the database?
Most properties are immutable, including autonomousDatabaseId, database, displayName, location, network, cidr, odbNetwork, odbSubnet, adminPassword, and the entire properties block. Changes to these require replacing the resource.
Can I rotate the admin password after creation?
No, adminPassword is immutable in Pulumi. Password rotation must be performed through the GCP Console or API directly.
What does deletionProtection do?
When set to true, it prevents Pulumi from destroying the database instance. You must explicitly set it to false before deletion. All examples enable this protection.
Network & Connectivity
What are my network configuration options?

You have three options:

  1. VPC network - Use network and cidr for private VPC access
  2. ODB network - Use odbNetwork and odbSubnet for Oracle Database Network
  3. Public IP - Omit network properties entirely (requires mtlsConnectionRequired: true)
How do I create a database with public IP access?
Omit the network, cidr, odbNetwork, and odbSubnet properties, and set properties.mtlsConnectionRequired: true for secure public access.
Can I mix network and odbNetwork configurations?
No, these are mutually exclusive. Choose either VPC network (network + cidr) or ODB network (odbNetwork + odbSubnet), not both.
Database Properties & Sizing
What are the required properties for creating a database?
Required: autonomousDatabaseId, location, project, database, adminPassword, and within properties: computeCount, storage size (dataStorageSizeTb or dataStorageSizeGb), dbVersion, dbWorkload, and licenseType.
What's the difference between dataStorageSizeTb and dataStorageSizeGb?
Both specify storage size in different units (terabytes vs gigabytes). Use whichever is more convenient; the basic example uses dataStorageSizeTb: 1, while the full example uses dataStorageSizeGb: 48.
What license types are available?
Two options: LICENSE_INCLUDED (Oracle provides the license) or BRING_YOUR_OWN_LICENSE (you provide your own Oracle license).
What database workload types can I specify?
The dbWorkload property determines the workload type. Examples show OLTP (Online Transaction Processing), which is the most common type.
Advanced Features
How do I enable auto-scaling for compute and storage?
Set properties.isAutoScalingEnabled: true for compute auto-scaling and properties.isStorageAutoScalingEnabled: true for storage auto-scaling. The full example demonstrates both options.

Using a different cloud?

Explore database guides for other cloud providers: