Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.azurenative.sql.DatabaseArgs Maven / Gradle / Ivy
Go to download
A native Pulumi package for creating and managing Azure resources.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.azurenative.sql;
import com.pulumi.azurenative.sql.enums.BackupStorageRedundancy;
import com.pulumi.azurenative.sql.enums.CatalogCollationType;
import com.pulumi.azurenative.sql.enums.CreateMode;
import com.pulumi.azurenative.sql.enums.DatabaseLicenseType;
import com.pulumi.azurenative.sql.enums.DatabaseReadScale;
import com.pulumi.azurenative.sql.enums.SampleName;
import com.pulumi.azurenative.sql.enums.SecondaryType;
import com.pulumi.azurenative.sql.inputs.DatabaseIdentityArgs;
import com.pulumi.azurenative.sql.inputs.SkuArgs;
import com.pulumi.core.Either;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Boolean;
import java.lang.Double;
import java.lang.Integer;
import java.lang.String;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;
public final class DatabaseArgs extends com.pulumi.resources.ResourceArgs {
public static final DatabaseArgs Empty = new DatabaseArgs();
/**
* Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled
*
*/
@Import(name="autoPauseDelay")
private @Nullable Output autoPauseDelay;
/**
* @return Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled
*
*/
public Optional> autoPauseDelay() {
return Optional.ofNullable(this.autoPauseDelay);
}
/**
* Collation of the metadata catalog.
*
*/
@Import(name="catalogCollation")
private @Nullable Output> catalogCollation;
/**
* @return Collation of the metadata catalog.
*
*/
public Optional>> catalogCollation() {
return Optional.ofNullable(this.catalogCollation);
}
/**
* The collation of the database.
*
*/
@Import(name="collation")
private @Nullable Output collation;
/**
* @return The collation of the database.
*
*/
public Optional> collation() {
return Optional.ofNullable(this.collation);
}
/**
* Specifies the mode of database creation.
*
* Default: regular database creation.
*
* Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database.
*
* Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database.
*
* PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified.
*
* Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore.
*
* Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time.
*
* RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.
*
* Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition.
*
*/
@Import(name="createMode")
private @Nullable Output> createMode;
/**
* @return Specifies the mode of database creation.
*
* Default: regular database creation.
*
* Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database.
*
* Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database.
*
* PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified.
*
* Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore.
*
* Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time.
*
* RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.
*
* Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition.
*
*/
public Optional>> createMode() {
return Optional.ofNullable(this.createMode);
}
/**
* The name of the database.
*
*/
@Import(name="databaseName")
private @Nullable Output databaseName;
/**
* @return The name of the database.
*
*/
public Optional> databaseName() {
return Optional.ofNullable(this.databaseName);
}
/**
* The resource identifier of the elastic pool containing this database.
*
*/
@Import(name="elasticPoolId")
private @Nullable Output elasticPoolId;
/**
* @return The resource identifier of the elastic pool containing this database.
*
*/
public Optional> elasticPoolId() {
return Optional.ofNullable(this.elasticPoolId);
}
/**
* The Client id used for cross tenant per database CMK scenario
*
*/
@Import(name="federatedClientId")
private @Nullable Output federatedClientId;
/**
* @return The Client id used for cross tenant per database CMK scenario
*
*/
public Optional> federatedClientId() {
return Optional.ofNullable(this.federatedClientId);
}
/**
* The number of secondary replicas associated with the database that are used to provide high availability. Not applicable to a Hyperscale database within an elastic pool.
*
*/
@Import(name="highAvailabilityReplicaCount")
private @Nullable Output highAvailabilityReplicaCount;
/**
* @return The number of secondary replicas associated with the database that are used to provide high availability. Not applicable to a Hyperscale database within an elastic pool.
*
*/
public Optional> highAvailabilityReplicaCount() {
return Optional.ofNullable(this.highAvailabilityReplicaCount);
}
/**
* The Azure Active Directory identity of the database.
*
*/
@Import(name="identity")
private @Nullable Output identity;
/**
* @return The Azure Active Directory identity of the database.
*
*/
public Optional> identity() {
return Optional.ofNullable(this.identity);
}
/**
* Whether or not this database is a ledger database, which means all tables in the database are ledger tables. Note: the value of this property cannot be changed after the database has been created.
*
*/
@Import(name="isLedgerOn")
private @Nullable Output isLedgerOn;
/**
* @return Whether or not this database is a ledger database, which means all tables in the database are ledger tables. Note: the value of this property cannot be changed after the database has been created.
*
*/
public Optional> isLedgerOn() {
return Optional.ofNullable(this.isLedgerOn);
}
/**
* The license type to apply for this database. `LicenseIncluded` if you need a license, or `BasePrice` if you have a license and are eligible for the Azure Hybrid Benefit.
*
*/
@Import(name="licenseType")
private @Nullable Output> licenseType;
/**
* @return The license type to apply for this database. `LicenseIncluded` if you need a license, or `BasePrice` if you have a license and are eligible for the Azure Hybrid Benefit.
*
*/
public Optional>> licenseType() {
return Optional.ofNullable(this.licenseType);
}
/**
* Resource location.
*
*/
@Import(name="location")
private @Nullable Output location;
/**
* @return Resource location.
*
*/
public Optional> location() {
return Optional.ofNullable(this.location);
}
/**
* The resource identifier of the long term retention backup associated with create operation of this database.
*
*/
@Import(name="longTermRetentionBackupResourceId")
private @Nullable Output longTermRetentionBackupResourceId;
/**
* @return The resource identifier of the long term retention backup associated with create operation of this database.
*
*/
public Optional> longTermRetentionBackupResourceId() {
return Optional.ofNullable(this.longTermRetentionBackupResourceId);
}
/**
* Maintenance configuration id assigned to the database. This configuration defines the period when the maintenance updates will occur.
*
*/
@Import(name="maintenanceConfigurationId")
private @Nullable Output maintenanceConfigurationId;
/**
* @return Maintenance configuration id assigned to the database. This configuration defines the period when the maintenance updates will occur.
*
*/
public Optional> maintenanceConfigurationId() {
return Optional.ofNullable(this.maintenanceConfigurationId);
}
/**
* The max size of the database expressed in bytes.
*
*/
@Import(name="maxSizeBytes")
private @Nullable Output maxSizeBytes;
/**
* @return The max size of the database expressed in bytes.
*
*/
public Optional> maxSizeBytes() {
return Optional.ofNullable(this.maxSizeBytes);
}
/**
* Minimal capacity that database will always have allocated, if not paused
*
*/
@Import(name="minCapacity")
private @Nullable Output minCapacity;
/**
* @return Minimal capacity that database will always have allocated, if not paused
*
*/
public Optional> minCapacity() {
return Optional.ofNullable(this.minCapacity);
}
/**
* The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region. Not applicable to a Hyperscale database within an elastic pool.
*
*/
@Import(name="readScale")
private @Nullable Output> readScale;
/**
* @return The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region. Not applicable to a Hyperscale database within an elastic pool.
*
*/
public Optional>> readScale() {
return Optional.ofNullable(this.readScale);
}
/**
* The resource identifier of the recoverable database associated with create operation of this database.
*
*/
@Import(name="recoverableDatabaseId")
private @Nullable Output recoverableDatabaseId;
/**
* @return The resource identifier of the recoverable database associated with create operation of this database.
*
*/
public Optional> recoverableDatabaseId() {
return Optional.ofNullable(this.recoverableDatabaseId);
}
/**
* The resource identifier of the recovery point associated with create operation of this database.
*
*/
@Import(name="recoveryServicesRecoveryPointId")
private @Nullable Output recoveryServicesRecoveryPointId;
/**
* @return The resource identifier of the recovery point associated with create operation of this database.
*
*/
public Optional> recoveryServicesRecoveryPointId() {
return Optional.ofNullable(this.recoveryServicesRecoveryPointId);
}
/**
* The storage account type to be used to store backups for this database.
*
*/
@Import(name="requestedBackupStorageRedundancy")
private @Nullable Output> requestedBackupStorageRedundancy;
/**
* @return The storage account type to be used to store backups for this database.
*
*/
public Optional>> requestedBackupStorageRedundancy() {
return Optional.ofNullable(this.requestedBackupStorageRedundancy);
}
/**
* The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
*
*/
@Import(name="resourceGroupName", required=true)
private Output resourceGroupName;
/**
* @return The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
*
*/
public Output resourceGroupName() {
return this.resourceGroupName;
}
/**
* The resource identifier of the restorable dropped database associated with create operation of this database.
*
*/
@Import(name="restorableDroppedDatabaseId")
private @Nullable Output restorableDroppedDatabaseId;
/**
* @return The resource identifier of the restorable dropped database associated with create operation of this database.
*
*/
public Optional> restorableDroppedDatabaseId() {
return Optional.ofNullable(this.restorableDroppedDatabaseId);
}
/**
* Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.
*
*/
@Import(name="restorePointInTime")
private @Nullable Output restorePointInTime;
/**
* @return Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.
*
*/
public Optional> restorePointInTime() {
return Optional.ofNullable(this.restorePointInTime);
}
/**
* The name of the sample schema to apply when creating this database.
*
*/
@Import(name="sampleName")
private @Nullable Output> sampleName;
/**
* @return The name of the sample schema to apply when creating this database.
*
*/
public Optional>> sampleName() {
return Optional.ofNullable(this.sampleName);
}
/**
* The secondary type of the database if it is a secondary. Valid values are Geo and Named.
*
*/
@Import(name="secondaryType")
private @Nullable Output> secondaryType;
/**
* @return The secondary type of the database if it is a secondary. Valid values are Geo and Named.
*
*/
public Optional>> secondaryType() {
return Optional.ofNullable(this.secondaryType);
}
/**
* The name of the server.
*
*/
@Import(name="serverName", required=true)
private Output serverName;
/**
* @return The name of the server.
*
*/
public Output serverName() {
return this.serverName;
}
/**
* The database SKU.
*
* The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands:
*
*/
@Import(name="sku")
private @Nullable Output sku;
/**
* @return The database SKU.
*
* The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands:
*
*/
public Optional> sku() {
return Optional.ofNullable(this.sku);
}
/**
* Specifies the time that the database was deleted.
*
*/
@Import(name="sourceDatabaseDeletionDate")
private @Nullable Output sourceDatabaseDeletionDate;
/**
* @return Specifies the time that the database was deleted.
*
*/
public Optional> sourceDatabaseDeletionDate() {
return Optional.ofNullable(this.sourceDatabaseDeletionDate);
}
/**
* The resource identifier of the source database associated with create operation of this database.
*
*/
@Import(name="sourceDatabaseId")
private @Nullable Output sourceDatabaseId;
/**
* @return The resource identifier of the source database associated with create operation of this database.
*
*/
public Optional> sourceDatabaseId() {
return Optional.ofNullable(this.sourceDatabaseId);
}
/**
* The resource identifier of the source associated with the create operation of this database.
*
* This property is only supported for DataWarehouse edition and allows to restore across subscriptions.
*
* When sourceResourceId is specified, sourceDatabaseId, recoverableDatabaseId, restorableDroppedDatabaseId and sourceDatabaseDeletionDate must not be specified and CreateMode must be PointInTimeRestore, Restore or Recover.
*
* When createMode is PointInTimeRestore, sourceResourceId must be the resource ID of the existing database or existing sql pool, and restorePointInTime must be specified.
*
* When createMode is Restore, sourceResourceId must be the resource ID of restorable dropped database or restorable dropped sql pool.
*
* When createMode is Recover, sourceResourceId must be the resource ID of recoverable database or recoverable sql pool.
*
* When source subscription belongs to a different tenant than target subscription, “x-ms-authorization-auxiliary” header must contain authentication token for the source tenant. For more details about “x-ms-authorization-auxiliary” header see https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/authenticate-multi-tenant
*
*/
@Import(name="sourceResourceId")
private @Nullable Output sourceResourceId;
/**
* @return The resource identifier of the source associated with the create operation of this database.
*
* This property is only supported for DataWarehouse edition and allows to restore across subscriptions.
*
* When sourceResourceId is specified, sourceDatabaseId, recoverableDatabaseId, restorableDroppedDatabaseId and sourceDatabaseDeletionDate must not be specified and CreateMode must be PointInTimeRestore, Restore or Recover.
*
* When createMode is PointInTimeRestore, sourceResourceId must be the resource ID of the existing database or existing sql pool, and restorePointInTime must be specified.
*
* When createMode is Restore, sourceResourceId must be the resource ID of restorable dropped database or restorable dropped sql pool.
*
* When createMode is Recover, sourceResourceId must be the resource ID of recoverable database or recoverable sql pool.
*
* When source subscription belongs to a different tenant than target subscription, “x-ms-authorization-auxiliary” header must contain authentication token for the source tenant. For more details about “x-ms-authorization-auxiliary” header see https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/authenticate-multi-tenant
*
*/
public Optional> sourceResourceId() {
return Optional.ofNullable(this.sourceResourceId);
}
/**
* Resource tags.
*
*/
@Import(name="tags")
private @Nullable Output> tags;
/**
* @return Resource tags.
*
*/
public Optional>> tags() {
return Optional.ofNullable(this.tags);
}
/**
* Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
*
*/
@Import(name="zoneRedundant")
private @Nullable Output zoneRedundant;
/**
* @return Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
*
*/
public Optional> zoneRedundant() {
return Optional.ofNullable(this.zoneRedundant);
}
private DatabaseArgs() {}
private DatabaseArgs(DatabaseArgs $) {
this.autoPauseDelay = $.autoPauseDelay;
this.catalogCollation = $.catalogCollation;
this.collation = $.collation;
this.createMode = $.createMode;
this.databaseName = $.databaseName;
this.elasticPoolId = $.elasticPoolId;
this.federatedClientId = $.federatedClientId;
this.highAvailabilityReplicaCount = $.highAvailabilityReplicaCount;
this.identity = $.identity;
this.isLedgerOn = $.isLedgerOn;
this.licenseType = $.licenseType;
this.location = $.location;
this.longTermRetentionBackupResourceId = $.longTermRetentionBackupResourceId;
this.maintenanceConfigurationId = $.maintenanceConfigurationId;
this.maxSizeBytes = $.maxSizeBytes;
this.minCapacity = $.minCapacity;
this.readScale = $.readScale;
this.recoverableDatabaseId = $.recoverableDatabaseId;
this.recoveryServicesRecoveryPointId = $.recoveryServicesRecoveryPointId;
this.requestedBackupStorageRedundancy = $.requestedBackupStorageRedundancy;
this.resourceGroupName = $.resourceGroupName;
this.restorableDroppedDatabaseId = $.restorableDroppedDatabaseId;
this.restorePointInTime = $.restorePointInTime;
this.sampleName = $.sampleName;
this.secondaryType = $.secondaryType;
this.serverName = $.serverName;
this.sku = $.sku;
this.sourceDatabaseDeletionDate = $.sourceDatabaseDeletionDate;
this.sourceDatabaseId = $.sourceDatabaseId;
this.sourceResourceId = $.sourceResourceId;
this.tags = $.tags;
this.zoneRedundant = $.zoneRedundant;
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(DatabaseArgs defaults) {
return new Builder(defaults);
}
public static final class Builder {
private DatabaseArgs $;
public Builder() {
$ = new DatabaseArgs();
}
public Builder(DatabaseArgs defaults) {
$ = new DatabaseArgs(Objects.requireNonNull(defaults));
}
/**
* @param autoPauseDelay Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled
*
* @return builder
*
*/
public Builder autoPauseDelay(@Nullable Output autoPauseDelay) {
$.autoPauseDelay = autoPauseDelay;
return this;
}
/**
* @param autoPauseDelay Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled
*
* @return builder
*
*/
public Builder autoPauseDelay(Integer autoPauseDelay) {
return autoPauseDelay(Output.of(autoPauseDelay));
}
/**
* @param catalogCollation Collation of the metadata catalog.
*
* @return builder
*
*/
public Builder catalogCollation(@Nullable Output> catalogCollation) {
$.catalogCollation = catalogCollation;
return this;
}
/**
* @param catalogCollation Collation of the metadata catalog.
*
* @return builder
*
*/
public Builder catalogCollation(Either catalogCollation) {
return catalogCollation(Output.of(catalogCollation));
}
/**
* @param catalogCollation Collation of the metadata catalog.
*
* @return builder
*
*/
public Builder catalogCollation(String catalogCollation) {
return catalogCollation(Either.ofLeft(catalogCollation));
}
/**
* @param catalogCollation Collation of the metadata catalog.
*
* @return builder
*
*/
public Builder catalogCollation(CatalogCollationType catalogCollation) {
return catalogCollation(Either.ofRight(catalogCollation));
}
/**
* @param collation The collation of the database.
*
* @return builder
*
*/
public Builder collation(@Nullable Output collation) {
$.collation = collation;
return this;
}
/**
* @param collation The collation of the database.
*
* @return builder
*
*/
public Builder collation(String collation) {
return collation(Output.of(collation));
}
/**
* @param createMode Specifies the mode of database creation.
*
* Default: regular database creation.
*
* Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database.
*
* Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database.
*
* PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified.
*
* Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore.
*
* Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time.
*
* RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.
*
* Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition.
*
* @return builder
*
*/
public Builder createMode(@Nullable Output> createMode) {
$.createMode = createMode;
return this;
}
/**
* @param createMode Specifies the mode of database creation.
*
* Default: regular database creation.
*
* Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database.
*
* Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database.
*
* PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified.
*
* Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore.
*
* Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time.
*
* RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.
*
* Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition.
*
* @return builder
*
*/
public Builder createMode(Either createMode) {
return createMode(Output.of(createMode));
}
/**
* @param createMode Specifies the mode of database creation.
*
* Default: regular database creation.
*
* Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database.
*
* Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database.
*
* PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified.
*
* Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore.
*
* Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time.
*
* RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.
*
* Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition.
*
* @return builder
*
*/
public Builder createMode(String createMode) {
return createMode(Either.ofLeft(createMode));
}
/**
* @param createMode Specifies the mode of database creation.
*
* Default: regular database creation.
*
* Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified as the resource ID of the source database.
*
* Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId must be specified as the resource ID of the existing primary database.
*
* PointInTimeRestore: Creates a database by restoring a point in time backup of an existing database. sourceDatabaseId must be specified as the resource ID of the existing database, and restorePointInTime must be specified.
*
* Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be specified as the recoverable database resource ID to restore.
*
* Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must be specified. If sourceDatabaseId is the database's original resource ID, then sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may also be specified to restore from an earlier point in time.
*
* RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource ID.
*
* Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse edition.
*
* @return builder
*
*/
public Builder createMode(CreateMode createMode) {
return createMode(Either.ofRight(createMode));
}
/**
* @param databaseName The name of the database.
*
* @return builder
*
*/
public Builder databaseName(@Nullable Output databaseName) {
$.databaseName = databaseName;
return this;
}
/**
* @param databaseName The name of the database.
*
* @return builder
*
*/
public Builder databaseName(String databaseName) {
return databaseName(Output.of(databaseName));
}
/**
* @param elasticPoolId The resource identifier of the elastic pool containing this database.
*
* @return builder
*
*/
public Builder elasticPoolId(@Nullable Output elasticPoolId) {
$.elasticPoolId = elasticPoolId;
return this;
}
/**
* @param elasticPoolId The resource identifier of the elastic pool containing this database.
*
* @return builder
*
*/
public Builder elasticPoolId(String elasticPoolId) {
return elasticPoolId(Output.of(elasticPoolId));
}
/**
* @param federatedClientId The Client id used for cross tenant per database CMK scenario
*
* @return builder
*
*/
public Builder federatedClientId(@Nullable Output federatedClientId) {
$.federatedClientId = federatedClientId;
return this;
}
/**
* @param federatedClientId The Client id used for cross tenant per database CMK scenario
*
* @return builder
*
*/
public Builder federatedClientId(String federatedClientId) {
return federatedClientId(Output.of(federatedClientId));
}
/**
* @param highAvailabilityReplicaCount The number of secondary replicas associated with the database that are used to provide high availability. Not applicable to a Hyperscale database within an elastic pool.
*
* @return builder
*
*/
public Builder highAvailabilityReplicaCount(@Nullable Output highAvailabilityReplicaCount) {
$.highAvailabilityReplicaCount = highAvailabilityReplicaCount;
return this;
}
/**
* @param highAvailabilityReplicaCount The number of secondary replicas associated with the database that are used to provide high availability. Not applicable to a Hyperscale database within an elastic pool.
*
* @return builder
*
*/
public Builder highAvailabilityReplicaCount(Integer highAvailabilityReplicaCount) {
return highAvailabilityReplicaCount(Output.of(highAvailabilityReplicaCount));
}
/**
* @param identity The Azure Active Directory identity of the database.
*
* @return builder
*
*/
public Builder identity(@Nullable Output identity) {
$.identity = identity;
return this;
}
/**
* @param identity The Azure Active Directory identity of the database.
*
* @return builder
*
*/
public Builder identity(DatabaseIdentityArgs identity) {
return identity(Output.of(identity));
}
/**
* @param isLedgerOn Whether or not this database is a ledger database, which means all tables in the database are ledger tables. Note: the value of this property cannot be changed after the database has been created.
*
* @return builder
*
*/
public Builder isLedgerOn(@Nullable Output isLedgerOn) {
$.isLedgerOn = isLedgerOn;
return this;
}
/**
* @param isLedgerOn Whether or not this database is a ledger database, which means all tables in the database are ledger tables. Note: the value of this property cannot be changed after the database has been created.
*
* @return builder
*
*/
public Builder isLedgerOn(Boolean isLedgerOn) {
return isLedgerOn(Output.of(isLedgerOn));
}
/**
* @param licenseType The license type to apply for this database. `LicenseIncluded` if you need a license, or `BasePrice` if you have a license and are eligible for the Azure Hybrid Benefit.
*
* @return builder
*
*/
public Builder licenseType(@Nullable Output> licenseType) {
$.licenseType = licenseType;
return this;
}
/**
* @param licenseType The license type to apply for this database. `LicenseIncluded` if you need a license, or `BasePrice` if you have a license and are eligible for the Azure Hybrid Benefit.
*
* @return builder
*
*/
public Builder licenseType(Either licenseType) {
return licenseType(Output.of(licenseType));
}
/**
* @param licenseType The license type to apply for this database. `LicenseIncluded` if you need a license, or `BasePrice` if you have a license and are eligible for the Azure Hybrid Benefit.
*
* @return builder
*
*/
public Builder licenseType(String licenseType) {
return licenseType(Either.ofLeft(licenseType));
}
/**
* @param licenseType The license type to apply for this database. `LicenseIncluded` if you need a license, or `BasePrice` if you have a license and are eligible for the Azure Hybrid Benefit.
*
* @return builder
*
*/
public Builder licenseType(DatabaseLicenseType licenseType) {
return licenseType(Either.ofRight(licenseType));
}
/**
* @param location Resource location.
*
* @return builder
*
*/
public Builder location(@Nullable Output location) {
$.location = location;
return this;
}
/**
* @param location Resource location.
*
* @return builder
*
*/
public Builder location(String location) {
return location(Output.of(location));
}
/**
* @param longTermRetentionBackupResourceId The resource identifier of the long term retention backup associated with create operation of this database.
*
* @return builder
*
*/
public Builder longTermRetentionBackupResourceId(@Nullable Output longTermRetentionBackupResourceId) {
$.longTermRetentionBackupResourceId = longTermRetentionBackupResourceId;
return this;
}
/**
* @param longTermRetentionBackupResourceId The resource identifier of the long term retention backup associated with create operation of this database.
*
* @return builder
*
*/
public Builder longTermRetentionBackupResourceId(String longTermRetentionBackupResourceId) {
return longTermRetentionBackupResourceId(Output.of(longTermRetentionBackupResourceId));
}
/**
* @param maintenanceConfigurationId Maintenance configuration id assigned to the database. This configuration defines the period when the maintenance updates will occur.
*
* @return builder
*
*/
public Builder maintenanceConfigurationId(@Nullable Output maintenanceConfigurationId) {
$.maintenanceConfigurationId = maintenanceConfigurationId;
return this;
}
/**
* @param maintenanceConfigurationId Maintenance configuration id assigned to the database. This configuration defines the period when the maintenance updates will occur.
*
* @return builder
*
*/
public Builder maintenanceConfigurationId(String maintenanceConfigurationId) {
return maintenanceConfigurationId(Output.of(maintenanceConfigurationId));
}
/**
* @param maxSizeBytes The max size of the database expressed in bytes.
*
* @return builder
*
*/
public Builder maxSizeBytes(@Nullable Output maxSizeBytes) {
$.maxSizeBytes = maxSizeBytes;
return this;
}
/**
* @param maxSizeBytes The max size of the database expressed in bytes.
*
* @return builder
*
*/
public Builder maxSizeBytes(Double maxSizeBytes) {
return maxSizeBytes(Output.of(maxSizeBytes));
}
/**
* @param minCapacity Minimal capacity that database will always have allocated, if not paused
*
* @return builder
*
*/
public Builder minCapacity(@Nullable Output minCapacity) {
$.minCapacity = minCapacity;
return this;
}
/**
* @param minCapacity Minimal capacity that database will always have allocated, if not paused
*
* @return builder
*
*/
public Builder minCapacity(Double minCapacity) {
return minCapacity(Output.of(minCapacity));
}
/**
* @param readScale The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region. Not applicable to a Hyperscale database within an elastic pool.
*
* @return builder
*
*/
public Builder readScale(@Nullable Output> readScale) {
$.readScale = readScale;
return this;
}
/**
* @param readScale The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region. Not applicable to a Hyperscale database within an elastic pool.
*
* @return builder
*
*/
public Builder readScale(Either readScale) {
return readScale(Output.of(readScale));
}
/**
* @param readScale The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region. Not applicable to a Hyperscale database within an elastic pool.
*
* @return builder
*
*/
public Builder readScale(String readScale) {
return readScale(Either.ofLeft(readScale));
}
/**
* @param readScale The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection string may be routed to a readonly secondary replica in the same region. Not applicable to a Hyperscale database within an elastic pool.
*
* @return builder
*
*/
public Builder readScale(DatabaseReadScale readScale) {
return readScale(Either.ofRight(readScale));
}
/**
* @param recoverableDatabaseId The resource identifier of the recoverable database associated with create operation of this database.
*
* @return builder
*
*/
public Builder recoverableDatabaseId(@Nullable Output recoverableDatabaseId) {
$.recoverableDatabaseId = recoverableDatabaseId;
return this;
}
/**
* @param recoverableDatabaseId The resource identifier of the recoverable database associated with create operation of this database.
*
* @return builder
*
*/
public Builder recoverableDatabaseId(String recoverableDatabaseId) {
return recoverableDatabaseId(Output.of(recoverableDatabaseId));
}
/**
* @param recoveryServicesRecoveryPointId The resource identifier of the recovery point associated with create operation of this database.
*
* @return builder
*
*/
public Builder recoveryServicesRecoveryPointId(@Nullable Output recoveryServicesRecoveryPointId) {
$.recoveryServicesRecoveryPointId = recoveryServicesRecoveryPointId;
return this;
}
/**
* @param recoveryServicesRecoveryPointId The resource identifier of the recovery point associated with create operation of this database.
*
* @return builder
*
*/
public Builder recoveryServicesRecoveryPointId(String recoveryServicesRecoveryPointId) {
return recoveryServicesRecoveryPointId(Output.of(recoveryServicesRecoveryPointId));
}
/**
* @param requestedBackupStorageRedundancy The storage account type to be used to store backups for this database.
*
* @return builder
*
*/
public Builder requestedBackupStorageRedundancy(@Nullable Output> requestedBackupStorageRedundancy) {
$.requestedBackupStorageRedundancy = requestedBackupStorageRedundancy;
return this;
}
/**
* @param requestedBackupStorageRedundancy The storage account type to be used to store backups for this database.
*
* @return builder
*
*/
public Builder requestedBackupStorageRedundancy(Either requestedBackupStorageRedundancy) {
return requestedBackupStorageRedundancy(Output.of(requestedBackupStorageRedundancy));
}
/**
* @param requestedBackupStorageRedundancy The storage account type to be used to store backups for this database.
*
* @return builder
*
*/
public Builder requestedBackupStorageRedundancy(String requestedBackupStorageRedundancy) {
return requestedBackupStorageRedundancy(Either.ofLeft(requestedBackupStorageRedundancy));
}
/**
* @param requestedBackupStorageRedundancy The storage account type to be used to store backups for this database.
*
* @return builder
*
*/
public Builder requestedBackupStorageRedundancy(BackupStorageRedundancy requestedBackupStorageRedundancy) {
return requestedBackupStorageRedundancy(Either.ofRight(requestedBackupStorageRedundancy));
}
/**
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
*
* @return builder
*
*/
public Builder resourceGroupName(Output resourceGroupName) {
$.resourceGroupName = resourceGroupName;
return this;
}
/**
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
*
* @return builder
*
*/
public Builder resourceGroupName(String resourceGroupName) {
return resourceGroupName(Output.of(resourceGroupName));
}
/**
* @param restorableDroppedDatabaseId The resource identifier of the restorable dropped database associated with create operation of this database.
*
* @return builder
*
*/
public Builder restorableDroppedDatabaseId(@Nullable Output restorableDroppedDatabaseId) {
$.restorableDroppedDatabaseId = restorableDroppedDatabaseId;
return this;
}
/**
* @param restorableDroppedDatabaseId The resource identifier of the restorable dropped database associated with create operation of this database.
*
* @return builder
*
*/
public Builder restorableDroppedDatabaseId(String restorableDroppedDatabaseId) {
return restorableDroppedDatabaseId(Output.of(restorableDroppedDatabaseId));
}
/**
* @param restorePointInTime Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.
*
* @return builder
*
*/
public Builder restorePointInTime(@Nullable Output restorePointInTime) {
$.restorePointInTime = restorePointInTime;
return this;
}
/**
* @param restorePointInTime Specifies the point in time (ISO8601 format) of the source database that will be restored to create the new database.
*
* @return builder
*
*/
public Builder restorePointInTime(String restorePointInTime) {
return restorePointInTime(Output.of(restorePointInTime));
}
/**
* @param sampleName The name of the sample schema to apply when creating this database.
*
* @return builder
*
*/
public Builder sampleName(@Nullable Output> sampleName) {
$.sampleName = sampleName;
return this;
}
/**
* @param sampleName The name of the sample schema to apply when creating this database.
*
* @return builder
*
*/
public Builder sampleName(Either sampleName) {
return sampleName(Output.of(sampleName));
}
/**
* @param sampleName The name of the sample schema to apply when creating this database.
*
* @return builder
*
*/
public Builder sampleName(String sampleName) {
return sampleName(Either.ofLeft(sampleName));
}
/**
* @param sampleName The name of the sample schema to apply when creating this database.
*
* @return builder
*
*/
public Builder sampleName(SampleName sampleName) {
return sampleName(Either.ofRight(sampleName));
}
/**
* @param secondaryType The secondary type of the database if it is a secondary. Valid values are Geo and Named.
*
* @return builder
*
*/
public Builder secondaryType(@Nullable Output> secondaryType) {
$.secondaryType = secondaryType;
return this;
}
/**
* @param secondaryType The secondary type of the database if it is a secondary. Valid values are Geo and Named.
*
* @return builder
*
*/
public Builder secondaryType(Either secondaryType) {
return secondaryType(Output.of(secondaryType));
}
/**
* @param secondaryType The secondary type of the database if it is a secondary. Valid values are Geo and Named.
*
* @return builder
*
*/
public Builder secondaryType(String secondaryType) {
return secondaryType(Either.ofLeft(secondaryType));
}
/**
* @param secondaryType The secondary type of the database if it is a secondary. Valid values are Geo and Named.
*
* @return builder
*
*/
public Builder secondaryType(SecondaryType secondaryType) {
return secondaryType(Either.ofRight(secondaryType));
}
/**
* @param serverName The name of the server.
*
* @return builder
*
*/
public Builder serverName(Output serverName) {
$.serverName = serverName;
return this;
}
/**
* @param serverName The name of the server.
*
* @return builder
*
*/
public Builder serverName(String serverName) {
return serverName(Output.of(serverName));
}
/**
* @param sku The database SKU.
*
* The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands:
*
* @return builder
*
*/
public Builder sku(@Nullable Output sku) {
$.sku = sku;
return this;
}
/**
* @param sku The database SKU.
*
* The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU name, tier/edition, family, and capacity) that are available to your subscription in an Azure region, use the `Capabilities_ListByLocation` REST API or one of the following commands:
*
* @return builder
*
*/
public Builder sku(SkuArgs sku) {
return sku(Output.of(sku));
}
/**
* @param sourceDatabaseDeletionDate Specifies the time that the database was deleted.
*
* @return builder
*
*/
public Builder sourceDatabaseDeletionDate(@Nullable Output sourceDatabaseDeletionDate) {
$.sourceDatabaseDeletionDate = sourceDatabaseDeletionDate;
return this;
}
/**
* @param sourceDatabaseDeletionDate Specifies the time that the database was deleted.
*
* @return builder
*
*/
public Builder sourceDatabaseDeletionDate(String sourceDatabaseDeletionDate) {
return sourceDatabaseDeletionDate(Output.of(sourceDatabaseDeletionDate));
}
/**
* @param sourceDatabaseId The resource identifier of the source database associated with create operation of this database.
*
* @return builder
*
*/
public Builder sourceDatabaseId(@Nullable Output sourceDatabaseId) {
$.sourceDatabaseId = sourceDatabaseId;
return this;
}
/**
* @param sourceDatabaseId The resource identifier of the source database associated with create operation of this database.
*
* @return builder
*
*/
public Builder sourceDatabaseId(String sourceDatabaseId) {
return sourceDatabaseId(Output.of(sourceDatabaseId));
}
/**
* @param sourceResourceId The resource identifier of the source associated with the create operation of this database.
*
* This property is only supported for DataWarehouse edition and allows to restore across subscriptions.
*
* When sourceResourceId is specified, sourceDatabaseId, recoverableDatabaseId, restorableDroppedDatabaseId and sourceDatabaseDeletionDate must not be specified and CreateMode must be PointInTimeRestore, Restore or Recover.
*
* When createMode is PointInTimeRestore, sourceResourceId must be the resource ID of the existing database or existing sql pool, and restorePointInTime must be specified.
*
* When createMode is Restore, sourceResourceId must be the resource ID of restorable dropped database or restorable dropped sql pool.
*
* When createMode is Recover, sourceResourceId must be the resource ID of recoverable database or recoverable sql pool.
*
* When source subscription belongs to a different tenant than target subscription, “x-ms-authorization-auxiliary” header must contain authentication token for the source tenant. For more details about “x-ms-authorization-auxiliary” header see https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/authenticate-multi-tenant
*
* @return builder
*
*/
public Builder sourceResourceId(@Nullable Output sourceResourceId) {
$.sourceResourceId = sourceResourceId;
return this;
}
/**
* @param sourceResourceId The resource identifier of the source associated with the create operation of this database.
*
* This property is only supported for DataWarehouse edition and allows to restore across subscriptions.
*
* When sourceResourceId is specified, sourceDatabaseId, recoverableDatabaseId, restorableDroppedDatabaseId and sourceDatabaseDeletionDate must not be specified and CreateMode must be PointInTimeRestore, Restore or Recover.
*
* When createMode is PointInTimeRestore, sourceResourceId must be the resource ID of the existing database or existing sql pool, and restorePointInTime must be specified.
*
* When createMode is Restore, sourceResourceId must be the resource ID of restorable dropped database or restorable dropped sql pool.
*
* When createMode is Recover, sourceResourceId must be the resource ID of recoverable database or recoverable sql pool.
*
* When source subscription belongs to a different tenant than target subscription, “x-ms-authorization-auxiliary” header must contain authentication token for the source tenant. For more details about “x-ms-authorization-auxiliary” header see https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/authenticate-multi-tenant
*
* @return builder
*
*/
public Builder sourceResourceId(String sourceResourceId) {
return sourceResourceId(Output.of(sourceResourceId));
}
/**
* @param tags Resource tags.
*
* @return builder
*
*/
public Builder tags(@Nullable Output> tags) {
$.tags = tags;
return this;
}
/**
* @param tags Resource tags.
*
* @return builder
*
*/
public Builder tags(Map tags) {
return tags(Output.of(tags));
}
/**
* @param zoneRedundant Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
*
* @return builder
*
*/
public Builder zoneRedundant(@Nullable Output zoneRedundant) {
$.zoneRedundant = zoneRedundant;
return this;
}
/**
* @param zoneRedundant Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
*
* @return builder
*
*/
public Builder zoneRedundant(Boolean zoneRedundant) {
return zoneRedundant(Output.of(zoneRedundant));
}
public DatabaseArgs build() {
if ($.resourceGroupName == null) {
throw new MissingRequiredPropertyException("DatabaseArgs", "resourceGroupName");
}
if ($.serverName == null) {
throw new MissingRequiredPropertyException("DatabaseArgs", "serverName");
}
return $;
}
}
}