"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.DbInstance = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
 * The ``AWS::RDS::DBInstance`` resource creates an Amazon DB instance. The new DB instance can be an RDS DB instance, or it can be a DB instance in an Aurora DB cluster.
 *  For more information about creating an RDS DB instance, see [Creating an Amazon RDS DB instance](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreateDBInstance.html) in the *Amazon RDS User Guide*.
 *  For more information about creating a DB instance in an Aurora DB cluster, see [Creating an Amazon Aurora DB cluster](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.CreateInstance.html) in the *Amazon Aurora User Guide*.
 *  If you import an existing DB instance, and the template configuration doesn't match the actual configuration of the DB instance, AWS CloudFormation applies the changes in the template during the import operation.
 *   If a DB instance is deleted or replaced during an update, AWS CloudFormation deletes all automated snapshots. However, it retains manual DB snapshots. During an update that requires replacement, you can apply a stack policy to prevent DB instances from being replaced. For more information, see [Prevent Updates to Stack Resources](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html).
 *    *Updating DB instances*
 *  When properties labeled "*Update requires:*[Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)" are updated, AWS CloudFormation first creates a replacement DB instance, then changes references from other dependent resources to point to the replacement DB instance, and finally deletes the old DB instance.
 *   We highly recommend that you take a snapshot of the database before updating the stack. If you don't, you lose the data when AWS CloudFormation replaces your DB instance. To preserve your data, perform the following procedure:
 *   1.  Deactivate any applications that are using the DB instance so that there's no activity on the DB instance.
 *   2.  Create a snapshot of the DB instance. For more information, see [Creating a DB Snapshot](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreateSnapshot.html).
 *   3.  If you want to restore your instance using a DB snapshot, modify the updated template with your DB instance changes and add the ``DBSnapshotIdentifier`` property with the ID of the DB snapshot that you want to use.
 *        After you restore a DB instance with a ``DBSnapshotIdentifier`` property, you can delete the ``DBSnapshotIdentifier`` property. When you specify this property for an update, the DB instance is not restored from the DB snapshot again, and the data in the database is not changed. However, if you don't specify the ``DBSnapshotIdentifier`` property, an empty DB instance is created, and the original DB instance is deleted. If you specify a property that is different from the previous snapshot restore property, a new DB instance is restored from the specified ``DBSnapshotIdentifier`` property, and the original DB instance is deleted.
 *   4.  Update the stack.
 *
 *   For more information about updating other properties of this resource, see ``ModifyDBInstance``. For more information about updating stacks, see [CloudFormation Stacks Updates](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks.html).
 *   *Deleting DB instances*
 *  For DB instances that are part of an Aurora DB cluster, you can set a deletion policy for your DB instance to control how AWS CloudFormation handles the DB instance when the stack is deleted. For Amazon RDS DB instances, you can choose to *retain* the DB instance, to *delete* the DB instance, or to *create a snapshot* of the DB instance. The default AWS CloudFormation behavior depends on the ``DBClusterIdentifier`` property:
 *   1.  For ``AWS::RDS::DBInstance`` resources that don't specify the ``DBClusterIdentifier`` property, AWS CloudFormation saves a snapshot of the DB instance.
 *   2.   For ``AWS::RDS::DBInstance`` resources that do specify the ``DBClusterIdentifier`` property, AWS CloudFormation deletes the DB instance.
 *
 *   For more information, see [DeletionPolicy Attribute](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html).
 */
class DbInstance extends pulumi.CustomResource {
    /**
     * Get an existing DbInstance resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, opts) {
        return new DbInstance(name, undefined, { ...opts, id: id });
    }
    /**
     * Returns true if the given object is an instance of DbInstance.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    static isInstance(obj) {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === DbInstance.__pulumiType;
    }
    /**
     * Create a DbInstance resource with the given unique name, arguments, and options.
     *
     * @param name The _unique_ name of the resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param opts A bag of options that control this resource's behavior.
     */
    constructor(name, args, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (!opts.id) {
            resourceInputs["additionalStorageVolumes"] = args?.additionalStorageVolumes;
            resourceInputs["allocatedStorage"] = args?.allocatedStorage;
            resourceInputs["allowMajorVersionUpgrade"] = args?.allowMajorVersionUpgrade;
            resourceInputs["applyImmediately"] = args?.applyImmediately;
            resourceInputs["associatedRoles"] = args?.associatedRoles;
            resourceInputs["autoMinorVersionUpgrade"] = args?.autoMinorVersionUpgrade;
            resourceInputs["automaticBackupReplicationKmsKeyId"] = args?.automaticBackupReplicationKmsKeyId;
            resourceInputs["automaticBackupReplicationRegion"] = args?.automaticBackupReplicationRegion;
            resourceInputs["automaticBackupReplicationRetentionPeriod"] = args?.automaticBackupReplicationRetentionPeriod;
            resourceInputs["availabilityZone"] = args?.availabilityZone;
            resourceInputs["backupRetentionPeriod"] = args?.backupRetentionPeriod;
            resourceInputs["backupTarget"] = args?.backupTarget;
            resourceInputs["caCertificateIdentifier"] = args?.caCertificateIdentifier;
            resourceInputs["certificateRotationRestart"] = args?.certificateRotationRestart;
            resourceInputs["characterSetName"] = args?.characterSetName;
            resourceInputs["copyTagsToSnapshot"] = args?.copyTagsToSnapshot;
            resourceInputs["customIamInstanceProfile"] = args?.customIamInstanceProfile;
            resourceInputs["databaseInsightsMode"] = args?.databaseInsightsMode;
            resourceInputs["dbClusterIdentifier"] = args?.dbClusterIdentifier;
            resourceInputs["dbClusterSnapshotIdentifier"] = args?.dbClusterSnapshotIdentifier;
            resourceInputs["dbInstanceClass"] = args?.dbInstanceClass;
            resourceInputs["dbInstanceIdentifier"] = args?.dbInstanceIdentifier;
            resourceInputs["dbName"] = args?.dbName;
            resourceInputs["dbParameterGroupName"] = args?.dbParameterGroupName;
            resourceInputs["dbSecurityGroups"] = args?.dbSecurityGroups;
            resourceInputs["dbSnapshotIdentifier"] = args?.dbSnapshotIdentifier;
            resourceInputs["dbSubnetGroupName"] = args?.dbSubnetGroupName;
            resourceInputs["dbSystemId"] = args?.dbSystemId;
            resourceInputs["dedicatedLogVolume"] = args?.dedicatedLogVolume;
            resourceInputs["deleteAutomatedBackups"] = args?.deleteAutomatedBackups;
            resourceInputs["deletionProtection"] = args?.deletionProtection;
            resourceInputs["domain"] = args?.domain;
            resourceInputs["domainAuthSecretArn"] = args?.domainAuthSecretArn;
            resourceInputs["domainDnsIps"] = args?.domainDnsIps;
            resourceInputs["domainFqdn"] = args?.domainFqdn;
            resourceInputs["domainIamRoleName"] = args?.domainIamRoleName;
            resourceInputs["domainOu"] = args?.domainOu;
            resourceInputs["enableCloudwatchLogsExports"] = args?.enableCloudwatchLogsExports;
            resourceInputs["enableIamDatabaseAuthentication"] = args?.enableIamDatabaseAuthentication;
            resourceInputs["enablePerformanceInsights"] = args?.enablePerformanceInsights;
            resourceInputs["engine"] = args?.engine;
            resourceInputs["engineLifecycleSupport"] = args?.engineLifecycleSupport;
            resourceInputs["engineVersion"] = args?.engineVersion;
            resourceInputs["iops"] = args?.iops;
            resourceInputs["kmsKeyId"] = args?.kmsKeyId;
            resourceInputs["licenseModel"] = args?.licenseModel;
            resourceInputs["manageMasterUserPassword"] = args?.manageMasterUserPassword;
            resourceInputs["masterUserAuthenticationType"] = args?.masterUserAuthenticationType;
            resourceInputs["masterUserPassword"] = args?.masterUserPassword;
            resourceInputs["masterUserSecret"] = args?.masterUserSecret;
            resourceInputs["masterUsername"] = args?.masterUsername;
            resourceInputs["maxAllocatedStorage"] = args?.maxAllocatedStorage;
            resourceInputs["monitoringInterval"] = args?.monitoringInterval;
            resourceInputs["monitoringRoleArn"] = args?.monitoringRoleArn;
            resourceInputs["multiAz"] = args?.multiAz;
            resourceInputs["ncharCharacterSetName"] = args?.ncharCharacterSetName;
            resourceInputs["networkType"] = args?.networkType;
            resourceInputs["optionGroupName"] = args?.optionGroupName;
            resourceInputs["performanceInsightsKmsKeyId"] = args?.performanceInsightsKmsKeyId;
            resourceInputs["performanceInsightsRetentionPeriod"] = args?.performanceInsightsRetentionPeriod;
            resourceInputs["port"] = args?.port;
            resourceInputs["preferredBackupWindow"] = args?.preferredBackupWindow;
            resourceInputs["preferredMaintenanceWindow"] = args?.preferredMaintenanceWindow;
            resourceInputs["processorFeatures"] = args?.processorFeatures;
            resourceInputs["promotionTier"] = args?.promotionTier;
            resourceInputs["publiclyAccessible"] = args?.publiclyAccessible;
            resourceInputs["replicaMode"] = args?.replicaMode;
            resourceInputs["restoreTime"] = args?.restoreTime;
            resourceInputs["sourceDbClusterIdentifier"] = args?.sourceDbClusterIdentifier;
            resourceInputs["sourceDbInstanceAutomatedBackupsArn"] = args?.sourceDbInstanceAutomatedBackupsArn;
            resourceInputs["sourceDbInstanceIdentifier"] = args?.sourceDbInstanceIdentifier;
            resourceInputs["sourceDbiResourceId"] = args?.sourceDbiResourceId;
            resourceInputs["sourceRegion"] = args?.sourceRegion;
            resourceInputs["storageEncrypted"] = args?.storageEncrypted;
            resourceInputs["storageThroughput"] = args?.storageThroughput;
            resourceInputs["storageType"] = args?.storageType;
            resourceInputs["tags"] = args?.tags;
            resourceInputs["tdeCredentialArn"] = args?.tdeCredentialArn;
            resourceInputs["tdeCredentialPassword"] = args?.tdeCredentialPassword;
            resourceInputs["timezone"] = args?.timezone;
            resourceInputs["useDefaultProcessorFeatures"] = args?.useDefaultProcessorFeatures;
            resourceInputs["useLatestRestorableTime"] = args?.useLatestRestorableTime;
            resourceInputs["vpcSecurityGroups"] = args?.vpcSecurityGroups;
            resourceInputs["automaticRestartTime"] = undefined /*out*/;
            resourceInputs["certificateDetails"] = undefined /*out*/;
            resourceInputs["dbInstanceArn"] = undefined /*out*/;
            resourceInputs["dbInstanceStatus"] = undefined /*out*/;
            resourceInputs["dbiResourceId"] = undefined /*out*/;
            resourceInputs["endpoint"] = undefined /*out*/;
            resourceInputs["instanceCreateTime"] = undefined /*out*/;
            resourceInputs["isStorageConfigUpgradeAvailable"] = undefined /*out*/;
            resourceInputs["latestRestorableTime"] = undefined /*out*/;
            resourceInputs["listenerEndpoint"] = undefined /*out*/;
            resourceInputs["percentProgress"] = undefined /*out*/;
            resourceInputs["readReplicaDbClusterIdentifiers"] = undefined /*out*/;
            resourceInputs["readReplicaDbInstanceIdentifiers"] = undefined /*out*/;
            resourceInputs["resumeFullAutomationModeTime"] = undefined /*out*/;
            resourceInputs["secondaryAvailabilityZone"] = undefined /*out*/;
            resourceInputs["statusInfos"] = undefined /*out*/;
        }
        else {
            resourceInputs["additionalStorageVolumes"] = undefined /*out*/;
            resourceInputs["allocatedStorage"] = undefined /*out*/;
            resourceInputs["allowMajorVersionUpgrade"] = undefined /*out*/;
            resourceInputs["applyImmediately"] = undefined /*out*/;
            resourceInputs["associatedRoles"] = undefined /*out*/;
            resourceInputs["autoMinorVersionUpgrade"] = undefined /*out*/;
            resourceInputs["automaticBackupReplicationKmsKeyId"] = undefined /*out*/;
            resourceInputs["automaticBackupReplicationRegion"] = undefined /*out*/;
            resourceInputs["automaticBackupReplicationRetentionPeriod"] = undefined /*out*/;
            resourceInputs["automaticRestartTime"] = undefined /*out*/;
            resourceInputs["availabilityZone"] = undefined /*out*/;
            resourceInputs["backupRetentionPeriod"] = undefined /*out*/;
            resourceInputs["backupTarget"] = undefined /*out*/;
            resourceInputs["caCertificateIdentifier"] = undefined /*out*/;
            resourceInputs["certificateDetails"] = undefined /*out*/;
            resourceInputs["certificateRotationRestart"] = undefined /*out*/;
            resourceInputs["characterSetName"] = undefined /*out*/;
            resourceInputs["copyTagsToSnapshot"] = undefined /*out*/;
            resourceInputs["customIamInstanceProfile"] = undefined /*out*/;
            resourceInputs["databaseInsightsMode"] = undefined /*out*/;
            resourceInputs["dbClusterIdentifier"] = undefined /*out*/;
            resourceInputs["dbClusterSnapshotIdentifier"] = undefined /*out*/;
            resourceInputs["dbInstanceArn"] = undefined /*out*/;
            resourceInputs["dbInstanceClass"] = undefined /*out*/;
            resourceInputs["dbInstanceIdentifier"] = undefined /*out*/;
            resourceInputs["dbInstanceStatus"] = undefined /*out*/;
            resourceInputs["dbName"] = undefined /*out*/;
            resourceInputs["dbParameterGroupName"] = undefined /*out*/;
            resourceInputs["dbSecurityGroups"] = undefined /*out*/;
            resourceInputs["dbSnapshotIdentifier"] = undefined /*out*/;
            resourceInputs["dbSubnetGroupName"] = undefined /*out*/;
            resourceInputs["dbSystemId"] = undefined /*out*/;
            resourceInputs["dbiResourceId"] = undefined /*out*/;
            resourceInputs["dedicatedLogVolume"] = undefined /*out*/;
            resourceInputs["deleteAutomatedBackups"] = undefined /*out*/;
            resourceInputs["deletionProtection"] = undefined /*out*/;
            resourceInputs["domain"] = undefined /*out*/;
            resourceInputs["domainAuthSecretArn"] = undefined /*out*/;
            resourceInputs["domainDnsIps"] = undefined /*out*/;
            resourceInputs["domainFqdn"] = undefined /*out*/;
            resourceInputs["domainIamRoleName"] = undefined /*out*/;
            resourceInputs["domainOu"] = undefined /*out*/;
            resourceInputs["enableCloudwatchLogsExports"] = undefined /*out*/;
            resourceInputs["enableIamDatabaseAuthentication"] = undefined /*out*/;
            resourceInputs["enablePerformanceInsights"] = undefined /*out*/;
            resourceInputs["endpoint"] = undefined /*out*/;
            resourceInputs["engine"] = undefined /*out*/;
            resourceInputs["engineLifecycleSupport"] = undefined /*out*/;
            resourceInputs["engineVersion"] = undefined /*out*/;
            resourceInputs["instanceCreateTime"] = undefined /*out*/;
            resourceInputs["iops"] = undefined /*out*/;
            resourceInputs["isStorageConfigUpgradeAvailable"] = undefined /*out*/;
            resourceInputs["kmsKeyId"] = undefined /*out*/;
            resourceInputs["latestRestorableTime"] = undefined /*out*/;
            resourceInputs["licenseModel"] = undefined /*out*/;
            resourceInputs["listenerEndpoint"] = undefined /*out*/;
            resourceInputs["manageMasterUserPassword"] = undefined /*out*/;
            resourceInputs["masterUserAuthenticationType"] = undefined /*out*/;
            resourceInputs["masterUserPassword"] = undefined /*out*/;
            resourceInputs["masterUserSecret"] = undefined /*out*/;
            resourceInputs["masterUsername"] = undefined /*out*/;
            resourceInputs["maxAllocatedStorage"] = undefined /*out*/;
            resourceInputs["monitoringInterval"] = undefined /*out*/;
            resourceInputs["monitoringRoleArn"] = undefined /*out*/;
            resourceInputs["multiAz"] = undefined /*out*/;
            resourceInputs["ncharCharacterSetName"] = undefined /*out*/;
            resourceInputs["networkType"] = undefined /*out*/;
            resourceInputs["optionGroupName"] = undefined /*out*/;
            resourceInputs["percentProgress"] = undefined /*out*/;
            resourceInputs["performanceInsightsKmsKeyId"] = undefined /*out*/;
            resourceInputs["performanceInsightsRetentionPeriod"] = undefined /*out*/;
            resourceInputs["port"] = undefined /*out*/;
            resourceInputs["preferredBackupWindow"] = undefined /*out*/;
            resourceInputs["preferredMaintenanceWindow"] = undefined /*out*/;
            resourceInputs["processorFeatures"] = undefined /*out*/;
            resourceInputs["promotionTier"] = undefined /*out*/;
            resourceInputs["publiclyAccessible"] = undefined /*out*/;
            resourceInputs["readReplicaDbClusterIdentifiers"] = undefined /*out*/;
            resourceInputs["readReplicaDbInstanceIdentifiers"] = undefined /*out*/;
            resourceInputs["replicaMode"] = undefined /*out*/;
            resourceInputs["restoreTime"] = undefined /*out*/;
            resourceInputs["resumeFullAutomationModeTime"] = undefined /*out*/;
            resourceInputs["secondaryAvailabilityZone"] = undefined /*out*/;
            resourceInputs["sourceDbClusterIdentifier"] = undefined /*out*/;
            resourceInputs["sourceDbInstanceAutomatedBackupsArn"] = undefined /*out*/;
            resourceInputs["sourceDbInstanceIdentifier"] = undefined /*out*/;
            resourceInputs["sourceDbiResourceId"] = undefined /*out*/;
            resourceInputs["sourceRegion"] = undefined /*out*/;
            resourceInputs["statusInfos"] = undefined /*out*/;
            resourceInputs["storageEncrypted"] = undefined /*out*/;
            resourceInputs["storageThroughput"] = undefined /*out*/;
            resourceInputs["storageType"] = undefined /*out*/;
            resourceInputs["tags"] = undefined /*out*/;
            resourceInputs["tdeCredentialArn"] = undefined /*out*/;
            resourceInputs["tdeCredentialPassword"] = undefined /*out*/;
            resourceInputs["timezone"] = undefined /*out*/;
            resourceInputs["useDefaultProcessorFeatures"] = undefined /*out*/;
            resourceInputs["useLatestRestorableTime"] = undefined /*out*/;
            resourceInputs["vpcSecurityGroups"] = undefined /*out*/;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        const replaceOnChanges = { replaceOnChanges: ["backupTarget", "characterSetName", "customIamInstanceProfile", "dbClusterIdentifier", "dbInstanceIdentifier", "dbName", "dbSubnetGroupName", "dbSystemId", "kmsKeyId", "masterUsername", "ncharCharacterSetName", "sourceRegion", "storageEncrypted", "timezone"] };
        opts = pulumi.mergeOptions(opts, replaceOnChanges);
        super(DbInstance.__pulumiType, name, resourceInputs, opts);
    }
}
exports.DbInstance = DbInstance;
/** @internal */
DbInstance.__pulumiType = 'aws-native:rds:DbInstance';
//# sourceMappingURL=dbInstance.js.map