oci_database_autonomous_database

This resource provides the Autonomous Database resource in Oracle Cloud Infrastructure Database service.

Creates a new Autonomous Database.

This API must be called on the remote region where the peer needs to be created.

Example Usage

resource "oci_database_autonomous_database" "test_autonomous_database" {
    #Required
    admin_password = var.autonomous_database_admin_password
    compartment_id = var.compartment_id
    db_name = var.autonomous_database_db_name

    #Optional
    are_primary_whitelisted_ips_used = var.autonomous_database_are_primary_whitelisted_ips_used
    auto_refresh_frequency_in_seconds = var.autonomous_database_auto_refresh_frequency_in_seconds
    auto_refresh_point_lag_in_seconds = var.autonomous_database_auto_refresh_point_lag_in_seconds
    autonomous_container_database_id = oci_database_autonomous_container_database.test_autonomous_container_database.id
    autonomous_database_backup_id = oci_database_autonomous_database_backup.test_autonomous_database_backup.id
    autonomous_database_id = oci_database_autonomous_database.test_autonomous_database.id
    autonomous_maintenance_schedule_type = var.autonomous_database_autonomous_maintenance_schedule_type
    backup_retention_period_in_days = var.autonomous_database_backup_retention_period_in_days
    character_set = var.autonomous_database_character_set
    clone_type = var.autonomous_database_clone_type
    compute_count = var.autonomous_database_compute_count
    compute_model = var.autonomous_database_compute_model
    cpu_core_count = var.autonomous_database_cpu_core_count
    customer_contacts {

        #Optional
        email = var.autonomous_database_customer_contacts_email
    }
    data_safe_status = var.autonomous_database_data_safe_status
    data_storage_size_in_gb = var.autonomous_database_data_storage_size_in_gb
    data_storage_size_in_tbs = var.autonomous_database_data_storage_size_in_tbs
    database_edition = var.autonomous_database_database_edition
    db_name = var.autonomous_database_db_name
    db_tools_details {
        #Required
        name = var.autonomous_database_db_tools_details_name

        #Optional
        compute_count = var.autonomous_database_db_tools_details_compute_count
        is_enabled = var.autonomous_database_db_tools_details_is_enabled
        max_idle_time_in_minutes = var.autonomous_database_db_tools_details_max_idle_time_in_minutes
    }
    db_version = var.autonomous_database_db_version
    db_workload = var.autonomous_database_db_workload
    defined_tags = var.autonomous_database_defined_tags
    display_name = var.autonomous_database_display_name
    freeform_tags = {"Department"= "Finance"}
    in_memory_percentage = var.autonomous_database_in_memory_percentage
    is_access_control_enabled = var.autonomous_database_is_access_control_enabled
    is_auto_scaling_enabled = var.autonomous_database_is_auto_scaling_enabled
    is_auto_scaling_for_storage_enabled = var.autonomous_database_is_auto_scaling_for_storage_enabled
    is_data_guard_enabled = var.autonomous_database_is_data_guard_enabled
    is_dedicated = var.autonomous_database_is_dedicated
    is_dev_tier = var.autonomous_database_is_dev_tier
    is_free_tier = var.autonomous_database_is_free_tier
    is_local_data_guard_enabled = var.autonomous_database_is_local_data_guard_enabled
    is_mtls_connection_required = var.autonomous_database_is_mtls_connection_required
    is_preview_version_with_service_terms_accepted = var.autonomous_database_is_preview_version_with_service_terms_accepted
    kms_key_id = oci_kms_key.test_key.id
    license_model = var.autonomous_database_license_model
    max_cpu_core_count = var.autonomous_database_max_cpu_core_count
    ncharacter_set = var.autonomous_database_ncharacter_set
    nsg_ids = var.autonomous_database_nsg_ids
    ocpu_count = var.autonomous_database_ocpu_count
    private_endpoint_label = var.autonomous_database_private_endpoint_label
    refreshable_mode = var.autonomous_database_refreshable_mode
    resource_pool_leader_id = oci_database_resource_pool_leader.test_resource_pool_leader.id
    resource_pool_summary {
        #Optional
        is_disabled = var.autonomous_database_resource_pool_summary_is_disabled
        pool_size = var.autonomous_database_resource_pool_summary_pool_size
    }
    scheduled_operations {
        #Required
        day_of_week {
            #Required
            name = var.autonomous_database_scheduled_operations_day_of_week_name
        }

        #Optional
        scheduled_start_time = var.autonomous_database_scheduled_operations_scheduled_start_time
        scheduled_stop_time = var.autonomous_database_scheduled_operations_scheduled_stop_time
    }
    secret_id = oci_vault_secret.test_secret.id
    secret_version_number = var.autonomous_database_secret_version_number
    source = var.autonomous_database_source
    source_id = oci_database_source.test_source.id
    standby_whitelisted_ips = var.autonomous_database_standby_whitelisted_ips
    subnet_id = oci_core_subnet.test_subnet.id
    time_of_auto_refresh_start = var.autonomous_database_time_of_auto_refresh_start
    timestamp = var.autonomous_database_timestamp
    use_latest_available_backup_time_stamp = var.autonomous_database_use_latest_available_backup_time_stamp
    vault_id = oci_kms_vault.test_vault.id
    whitelisted_ips = var.autonomous_database_whitelisted_ips
}

Argument Reference

The following arguments are supported:

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

Attributes Reference

The following attributes are exported: md5-5edb5fe8bfffc200f29f0a00e1e28d47

This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.

  • defined_tags - Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.
  • disaster_recovery_region_type - Deprecated The disaster recovery (DR) region type of the Autonomous Database. For Serverless Autonomous Databases, DR associations have designated primary (PRIMARY) and standby (REMOTE) regions. These region types do not change when the database changes roles. The standby region in DR associations can be the same region as the primary region, or they can be in a remote regions. Some database administration operations may be available only in the primary region of the DR association, and cannot be performed when the database using the primary role is operating in a remote region.
  • display_name - The user-friendly name for the Autonomous Database. The name does not have to be unique.
  • failed_data_recovery_in_seconds - Indicates the number of seconds of data loss for a Data Guard failover.
  • freeform_tags - Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
  • id - The OCID of the Autonomous Database.
  • in_memory_area_in_gbs - The area assigned to In-Memory tables in Autonomous Database.
  • in_memory_percentage - The percentage of the System Global Area(SGA) assigned to In-Memory tables in Autonomous Database. This property is applicable only to Autonomous Databases on the Exadata Cloud@Customer platform.
  • infrastructure_type - The infrastructure type this resource belongs to.
  • is_access_control_enabled - Indicates if the database-level access control is enabled. If disabled, database access is defined by the network security rules. If enabled, database access is restricted to the IP addresses defined by the rules specified with the whitelistedIps property. While specifying whitelistedIps rules is optional, if database-level access control is enabled and no rules are specified, the database will become inaccessible. The rules can be added later using the UpdateAutonomousDatabase API operation or edit option in console. When creating a database clone, the desired access control setting should be specified. By default, database-level access control will be disabled for the clone.

    This property is applicable only to Autonomous Databases on the Exadata Cloud@Customer platform. For Autonomous Database Serverless instances, whitelistedIps is used.

  • is_auto_scaling_enabled - Indicates if auto scaling is enabled for the Autonomous Database CPU core count. The default value is TRUE.
  • is_auto_scaling_for_storage_enabled - Indicates if auto scaling is enabled for the Autonomous Database storage. The default value is FALSE.
  • is_data_guard_enabled - Deprecated. Indicates whether the Autonomous Database has local (in-region) Data Guard enabled. Not applicable to cross-region Autonomous Data Guard associations, or to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure.
  • is_dedicated - True if the database uses dedicated Exadata infrastructure.
  • is_dev_tier - This project introduces Autonomous Database for Developers (ADB-Dev), a free tier on dedicated infrastructure, and Cloud@Customer for database development purposes. ADB-Dev enables ExaDB customers to experiment with ADB for free and incentivizes enterprises to use ADB for new development projects.Note that ADB-Dev have 4 CPU and 20GB of memory. For ADB-Dev , memory and CPU cannot be scaled
  • is_free_tier - Indicates if this is an Always Free resource. The default value is false. Note that Always Free Autonomous Databases have 1 CPU and 20GB of memory. For Always Free databases, memory and CPU cannot be scaled.

    This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, openMode, permissionLevel, privateEndpointLabel, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isLocalDataGuardEnabled

  • is_local_data_guard_enabled - Indicates whether the Autonomous Database has local (in-region) Data Guard enabled. Not applicable to cross-region Autonomous Data Guard associations, or to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure.
  • is_mtls_connection_required - Specifies if the Autonomous Database requires mTLS connections.

    This may not be updated in parallel with any of the following: licenseModel, databaseEdition, cpuCoreCount, computeCount, dataStorageSizeInTBs, whitelistedIps, openMode, permissionLevel, db-workload, privateEndpointLabel, nsgIds, customerContacts, dbVersion, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.

    Service Change: The default value of the isMTLSConnectionRequired attribute will change from true to false on July 1, 2023 in the following APIs:

  • is_preview - Indicates if the Autonomous Database version is a preview version.
  • is_reconnect_clone_enabled - Indicates if the refreshable clone can be reconnected to its source database.
  • is_refreshable_clone - Indicates if the Autonomous Database is a refreshable clone.

    This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, openMode, permissionLevel, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.

  • is_remote_data_guard_enabled - Indicates whether the Autonomous Database has Cross Region Data Guard enabled. It takes boolean values. Not applicable to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure.
  • key_history_entry - Key History Entry.
  • key_store_id - The OCID of the key store of Oracle Vault. This is used in Autonomous Databases on Serverless instances and dedicated Exadata infrastructure.
  • key_store_wallet_name - The wallet name for Oracle Key Vault.
  • kms_key_id - The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations.
  • kms_key_lifecycle_details - KMS key lifecycle details.
  • kms_key_version_id - The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. Autonomous Database Serverless does not use key versions, hence is not applicable for Autonomous Database Serverless instances.
  • license_model - The Oracle license model that applies to the Oracle Autonomous Database. Bring your own license (BYOL) allows you to apply your current on-premises Oracle software licenses to equivalent, highly automated Oracle services in the cloud. License Included allows you to subscribe to new Oracle Database software licenses and the Oracle Database service. Note that when provisioning an Autonomous Database on dedicated Exadata infrastructure, this attribute must be null. It is already set at the Autonomous Exadata Infrastructure level. When provisioning an [Autonomous Database Serverless] (https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html) database, if a value is not specified, the system defaults the value to BRING_YOUR_OWN_LICENSE. Bring your own license (BYOL) also allows you to select the DB edition using the optional parameter.

    This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, dataStorageSizeInTBs, adminPassword, isMTLSConnectionRequired, dbWorkload, privateEndpointLabel, nsgIds, dbVersion, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.

  • lifecycle_details - Information about the current lifecycle state.
  • local_adg_auto_failover_max_data_loss_limit - Parameter that allows users to select an acceptable maximum data loss limit in seconds, up to which Automatic Failover will be triggered when necessary for a Local Autonomous Data Guard
  • long_term_backup_schedule - Details for the long-term backup schedule.
  • max_cpu_core_count - Deprecated. The number of Max OCPU cores to be made available to the autonomous database with auto scaling of cpu enabled.
  • memory_per_oracle_compute_unit_in_gbs - The amount of memory (in GBs) enabled per OCPU or ECPU. See Compute Models in Autonomous Database on Dedicated Exadata Infrastructure for more details. This parameter is not used for Autonomous database Serverless.
  • local_disaster_recovery_type - Indicates the local disaster recovery (DR) type of the Serverless Autonomous Database. Autonomous Data Guard (ADG) DR type provides business critical DR with a faster recovery time objective (RTO) during failover or switchover. Backup-based (BACKUP_BASED) DR type provides lower cost DR with a slower RTO during failover or switchover.
  • local_standby_db - Autonomous Data Guard local (same region) standby database details.
  • ncharacter_set - The national character set for the autonomous database. The default is AL16UTF16. Allowed values are: AL16UTF16 or UTF8.
  • net_services_architecture - Enabling SHARED server architecture enables a database server to allow many client processes to share very few server processes, thereby increasing the number of supported users.
  • next_long_term_backup_time_stamp - The date and time when the next long-term backup would be created.
  • nsg_ids - The list of OCIDs for the network security groups (NSGs) to which this resource belongs. Setting this to an empty list removes all resources from all NSGs. For more information about NSGs, see Security Rules. NsgIds restrictions:
  • ocpu_count - The number of OCPU cores to be made available to the database.

    The following points apply:

    For Autonomous Databases on dedicated Exadata infrastructure, the maximum number of cores is determined by the infrastructure shape. See Characteristics of Infrastructure Shapes for shape details.

    Note: This parameter cannot be used with the cpuCoreCount parameter.

  • open_mode - Indicates the Autonomous Database mode. The database can be opened in READ_ONLY or READ_WRITE mode.

    This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.

  • operations_insights_status - Status of Operations Insights for this Autonomous Database.
  • peer_db_ids - The list of OCIDs of standby databases located in Autonomous Data Guard remote regions that are associated with the source database. Note that for Autonomous Database Serverless instances, standby databases located in the same region as the source primary database do not have OCIDs.
  • permission_level - The Autonomous Database permission level. Restricted mode allows access only by admin users.

    This cannot be updated in parallel with any of the following: cpuCoreCount, computeCount, computeModel, adminPassword, whitelistedIps, isMTLSConnectionRequired, nsgIds, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, or isFreeTier.

  • private_endpoint - The private endpoint for the resource. This parameter is not used in Autonomous Databases using Serverless infrastructure and Exadata Cloud@Customer infrastructure.
  • private_endpoint_ip - The private endpoint Ip address for the resource.
  • private_endpoint_label - The resource's private endpoint label. md5-d90f5da879b28501851ead8ad977dfa4

    These subnets are used by the Oracle Clusterware private interconnect on the database instance. Specifying an overlapping subnet will cause the private interconnect to malfunction. This restriction applies to both the client subnet and the backup subnet.

  • supported_regions_to_clone_to - The list of regions that support the creation of an Autonomous Database clone or an Autonomous Data Guard standby database.
  • system_tags - System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags.
  • time_created - The date and time the Autonomous Database was created.
  • time_data_guard_role_changed - The date and time the Autonomous Data Guard role was switched for the Autonomous Database. For databases that have standbys in both the primary Data Guard region and a remote Data Guard standby region, this is the latest timestamp of either the database using the "primary" role in the primary Data Guard region, or database located in the remote Data Guard standby region.
  • time_deletion_of_free_autonomous_database - The date and time the Always Free database will be automatically deleted because of inactivity. If the database is in the STOPPED state and without activity until this time, it will be deleted.
  • time_disaster_recovery_role_changed - The date and time the Disaster Recovery role was switched for the standby Autonomous Database.
  • time_local_data_guard_enabled - The date and time that Autonomous Data Guard was enabled for an Autonomous Database where the standby was provisioned in the same region as the primary database.
  • time_maintenance_begin - The date and time when maintenance will begin.
  • time_maintenance_end - The date and time when maintenance will end.
  • time_of_auto_refresh_start - The the date and time that auto-refreshing will begin for an Autonomous Database refreshable clone. This value controls only the start time for the first refresh operation. Subsequent (ongoing) refresh operations have start times controlled by the value of the autoRefreshFrequencyInSeconds parameter.
  • time_of_last_failover - The timestamp of the last failover operation.
  • time_of_last_refresh - The date and time when last refresh happened.
  • time_of_last_refresh_point - The refresh point timestamp (UTC). The refresh point is the time to which the database was most recently refreshed. Data created after the refresh point is not included in the refresh.
  • time_of_last_switchover - The timestamp of the last switchover operation for the Autonomous Database.
  • time_of_next_refresh - The date and time of next refresh.
  • time_reclamation_of_free_autonomous_database - The date and time the Always Free database will be stopped because of inactivity. If this time is reached without any database activity, the database will automatically be put into the STOPPED state.
  • time_until_reconnect_clone_enabled - The time and date as an RFC3339 formatted string, e.g., 2022-01-01T12:00:00.000Z, to set the limit for a refreshable clone to be reconnected to its source database.
  • total_backup_storage_size_in_gbs - The backup storage to the database.
  • used_data_storage_size_in_gbs - The storage space consumed by Autonomous Database in GBs.
  • used_data_storage_size_in_tbs - The amount of storage that has been used, in terabytes.
  • vault_id - The OCID of the Oracle Cloud Infrastructure vault. This parameter and secretId are required for Customer Managed Keys.
  • whitelisted_ips - The client IP access control list (ACL). This feature is available for [Autonomous Database Serverless] (https://docs.oracle.com/en/cloud/paas/autonomous-database/index.html) and on Exadata Cloud@Customer. Only clients connecting from an IP address included in the ACL may access the Autonomous Database instance. If arePrimaryWhitelistedIpsUsed is 'TRUE' then Autonomous Database uses this primary's IP access control list (ACL) for the disaster recovery peer called standbywhitelistedips.

    For Autonomous Database Serverless instances, this is an array of CIDR (Classless Inter-Domain Routing) notations for a subnet or VCN OCID. Use a semicolon (;) as a deliminator between the VCN-specific subnets or IPs. Example: ["1.1.1.1","1.1.1.0/24","ocid1.vcn.oc1.sea.<unique_id>","ocid1.vcn.oc1.sea.<unique_id1>;1.1.1.1","ocid1.vcn.oc1.sea.<unique_id2>;1.1.0.0/16"] For Exadata Cloud@Customer, this is an array of IP addresses or CIDR (Classless Inter-Domain Routing) notations. Example: ["1.1.1.1","1.1.1.0/24","1.1.2.25"]

    For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry.

    This cannot be updated in parallel with any of the following: licenseModel, dbEdition, cpuCoreCount, computeCount, computeModel, adminPassword, isMTLSConnectionRequired, openMode, permissionLevel, dbWorkload, dbVersion, isRefreshable, dbName, scheduledOperations, dbToolsDetails, isLocalDataGuardEnabled, or isFreeTier.

    For an update operation, if you want to delete all the IPs in the ACL, use an array with a single empty string entry.

    Timeouts

  • The `timeouts` block allows you to specify [timeouts](https://registry.terraform.io/providers/oracle/oci/latest/docs/guides/changing_timeouts) for certain operations: * `create` - (Defaults to 12 hours), when creating the Autonomous Database * `update` - (Defaults to 12 hours), when updating the Autonomous Database * `delete` - (Defaults to 12 hours), when destroying the Autonomous Database

    Import

    AutonomousDatabases can be imported using the id, e.g.

    $ terraform import oci_database_autonomous_database.test_autonomous_database "id"