Class DatabaseInstanceFromSnapshot.Builder

java.lang.Object
software.amazon.awscdk.services.rds.DatabaseInstanceFromSnapshot.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<DatabaseInstanceFromSnapshot>
Enclosing class:
DatabaseInstanceFromSnapshot

@Stability(Stable) public static final class DatabaseInstanceFromSnapshot.Builder extends Object implements software.amazon.jsii.Builder<DatabaseInstanceFromSnapshot>
A fluent builder for DatabaseInstanceFromSnapshot.
  • Method Details

    • create

      @Stability(Stable) public static DatabaseInstanceFromSnapshot.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of DatabaseInstanceFromSnapshot.Builder.
    • vpc

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder vpc(IVpc vpc)
      The VPC network where the DB subnet group should be created.

      Parameters:
      vpc - The VPC network where the DB subnet group should be created. This parameter is required.
      Returns:
      this
    • autoMinorVersionUpgrade

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder autoMinorVersionUpgrade(Boolean autoMinorVersionUpgrade)
      Indicates that minor engine upgrades are applied automatically to the DB instance during the maintenance window.

      Default: true

      Parameters:
      autoMinorVersionUpgrade - Indicates that minor engine upgrades are applied automatically to the DB instance during the maintenance window. This parameter is required.
      Returns:
      this
    • availabilityZone

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder availabilityZone(String availabilityZone)
      The name of the Availability Zone where the DB instance will be located.

      Default: - no preference

      Parameters:
      availabilityZone - The name of the Availability Zone where the DB instance will be located. This parameter is required.
      Returns:
      this
    • backupRetention

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder backupRetention(Duration backupRetention)
      The number of days during which automatic DB snapshots are retained.

      Set to zero to disable backups. When creating a read replica, you must enable automatic backups on the source database instance by setting the backup retention to a value other than zero.

      Default: - Duration.days(1) for source instances, disabled for read replicas

      Parameters:
      backupRetention - The number of days during which automatic DB snapshots are retained. This parameter is required.
      Returns:
      this
    • cloudwatchLogsExports

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder cloudwatchLogsExports(List<String> cloudwatchLogsExports)
      The list of log types that need to be enabled for exporting to CloudWatch Logs.

      Default: - no log exports

      Parameters:
      cloudwatchLogsExports - The list of log types that need to be enabled for exporting to CloudWatch Logs. This parameter is required.
      Returns:
      this
    • cloudwatchLogsRetention

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder cloudwatchLogsRetention(RetentionDays cloudwatchLogsRetention)
      The number of days log events are kept in CloudWatch Logs.

      When updating this property, unsetting it doesn't remove the log retention policy. To remove the retention policy, set the value to Infinity.

      Default: - logs never expire

      Parameters:
      cloudwatchLogsRetention - The number of days log events are kept in CloudWatch Logs. This parameter is required.
      Returns:
      this
    • cloudwatchLogsRetentionRole

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder cloudwatchLogsRetentionRole(IRole cloudwatchLogsRetentionRole)
      The IAM role for the Lambda function associated with the custom resource that sets the retention policy.

      Default: - a new role is created.

      Parameters:
      cloudwatchLogsRetentionRole - The IAM role for the Lambda function associated with the custom resource that sets the retention policy. This parameter is required.
      Returns:
      this
    • copyTagsToSnapshot

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder copyTagsToSnapshot(Boolean copyTagsToSnapshot)
      Indicates whether to copy all of the user-defined tags from the DB instance to snapshots of the DB instance.

      Default: true

      Parameters:
      copyTagsToSnapshot - Indicates whether to copy all of the user-defined tags from the DB instance to snapshots of the DB instance. This parameter is required.
      Returns:
      this
    • deleteAutomatedBackups

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder deleteAutomatedBackups(Boolean deleteAutomatedBackups)
      Indicates whether automated backups should be deleted or retained when you delete a DB instance.

      Default: false

      Parameters:
      deleteAutomatedBackups - Indicates whether automated backups should be deleted or retained when you delete a DB instance. This parameter is required.
      Returns:
      this
    • deletionProtection

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder deletionProtection(Boolean deletionProtection)
      Indicates whether the DB instance should have deletion protection enabled.

      Default: - true if ``removalPolicy`` is RETAIN, false otherwise

      Parameters:
      deletionProtection - Indicates whether the DB instance should have deletion protection enabled. This parameter is required.
      Returns:
      this
    • domain

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder domain(String domain)
      The Active Directory directory ID to create the DB instance in.

      Default: - Do not join domain

      Parameters:
      domain - The Active Directory directory ID to create the DB instance in. This parameter is required.
      Returns:
      this
    • domainRole

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder domainRole(IRole domainRole)
      The IAM role to be used when making API calls to the Directory Service.

      The role needs the AWS-managed policy AmazonRDSDirectoryServiceAccess or equivalent.

      Default: - The role will be created for you if

      invalid @link
      DatabaseInstanceNewProps#domain
      is specified

      Parameters:
      domainRole - The IAM role to be used when making API calls to the Directory Service. This parameter is required.
      Returns:
      this
    • enablePerformanceInsights

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder enablePerformanceInsights(Boolean enablePerformanceInsights)
      Whether to enable Performance Insights for the DB instance.

      Default: - false, unless ``performanceInsightRentention`` or ``performanceInsightEncryptionKey`` is set.

      Parameters:
      enablePerformanceInsights - Whether to enable Performance Insights for the DB instance. This parameter is required.
      Returns:
      this
    • iamAuthentication

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder iamAuthentication(Boolean iamAuthentication)
      Whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts.

      Default: false

      Parameters:
      iamAuthentication - Whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts. This parameter is required.
      Returns:
      this
    • instanceIdentifier

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder instanceIdentifier(String instanceIdentifier)
      A name for the DB instance.

      If you specify a name, AWS CloudFormation converts it to lowercase.

      Default: - a CloudFormation generated name

      Parameters:
      instanceIdentifier - A name for the DB instance. This parameter is required.
      Returns:
      this
    • iops

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder iops(Number iops)
      The number of I/O operations per second (IOPS) that the database provisions.

      The value must be equal to or greater than 1000.

      Default: - no provisioned iops

      Parameters:
      iops - The number of I/O operations per second (IOPS) that the database provisions. This parameter is required.
      Returns:
      this
    • maxAllocatedStorage

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder maxAllocatedStorage(Number maxAllocatedStorage)
      Upper limit to which RDS can scale the storage in GiB(Gibibyte).

      Default: - No autoscaling of RDS instance

      Parameters:
      maxAllocatedStorage - Upper limit to which RDS can scale the storage in GiB(Gibibyte). This parameter is required.
      Returns:
      this
      See Also:
    • monitoringInterval

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder monitoringInterval(Duration monitoringInterval)
      The interval, in seconds, between points when Amazon RDS collects enhanced monitoring metrics for the DB instance.

      Default: - no enhanced monitoring

      Parameters:
      monitoringInterval - The interval, in seconds, between points when Amazon RDS collects enhanced monitoring metrics for the DB instance. This parameter is required.
      Returns:
      this
    • monitoringRole

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder monitoringRole(IRole monitoringRole)
      Role that will be used to manage DB instance monitoring.

      Default: - A role is automatically created for you

      Parameters:
      monitoringRole - Role that will be used to manage DB instance monitoring. This parameter is required.
      Returns:
      this
    • multiAz

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder multiAz(Boolean multiAz)
      Specifies if the database instance is a multiple Availability Zone deployment.

      Default: false

      Parameters:
      multiAz - Specifies if the database instance is a multiple Availability Zone deployment. This parameter is required.
      Returns:
      this
    • optionGroup

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder optionGroup(IOptionGroup optionGroup)
      The option group to associate with the instance.

      Default: - no option group

      Parameters:
      optionGroup - The option group to associate with the instance. This parameter is required.
      Returns:
      this
    • parameterGroup

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder parameterGroup(IParameterGroup parameterGroup)
      The DB parameter group to associate with the instance.

      Default: - no parameter group

      Parameters:
      parameterGroup - The DB parameter group to associate with the instance. This parameter is required.
      Returns:
      this
    • performanceInsightEncryptionKey

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder performanceInsightEncryptionKey(IKey performanceInsightEncryptionKey)
      The AWS KMS key for encryption of Performance Insights data.

      Default: - default master key

      Parameters:
      performanceInsightEncryptionKey - The AWS KMS key for encryption of Performance Insights data. This parameter is required.
      Returns:
      this
    • performanceInsightRetention

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder performanceInsightRetention(PerformanceInsightRetention performanceInsightRetention)
      The amount of time, in days, to retain Performance Insights data.

      Default: 7

      Parameters:
      performanceInsightRetention - The amount of time, in days, to retain Performance Insights data. This parameter is required.
      Returns:
      this
    • port

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder port(Number port)
      The port for the instance.

      Default: - the default port for the chosen engine.

      Parameters:
      port - The port for the instance. This parameter is required.
      Returns:
      this
    • preferredBackupWindow

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder preferredBackupWindow(String preferredBackupWindow)
      The daily time range during which automated backups are performed.

      Constraints:

      • Must be in the format hh24:mi-hh24:mi.
      • Must be in Universal Coordinated Time (UTC).
      • Must not conflict with the preferred maintenance window.
      • Must be at least 30 minutes.

      Default: - a 30-minute window selected at random from an 8-hour block of time for each AWS Region. To see the time blocks available, see https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithAutomatedBackups.html#USER_WorkingWithAutomatedBackups.BackupWindow

      Parameters:
      preferredBackupWindow - The daily time range during which automated backups are performed. This parameter is required.
      Returns:
      this
    • preferredMaintenanceWindow

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder preferredMaintenanceWindow(String preferredMaintenanceWindow)
      The weekly time range (in UTC) during which system maintenance can occur.

      Format: ddd:hh24:mi-ddd:hh24:mi Constraint: Minimum 30-minute window

      Default: - a 30-minute window selected at random from an 8-hour block of time for each AWS Region, occurring on a random day of the week. To see the time blocks available, see https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Maintenance.html#Concepts.DBMaintenance

      Parameters:
      preferredMaintenanceWindow - The weekly time range (in UTC) during which system maintenance can occur. This parameter is required.
      Returns:
      this
    • processorFeatures

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder processorFeatures(ProcessorFeatures processorFeatures)
      The number of CPU cores and the number of threads per core.

      Default: - the default number of CPU cores and threads per core for the chosen instance class. See https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html#USER_ConfigureProcessor

      Parameters:
      processorFeatures - The number of CPU cores and the number of threads per core. This parameter is required.
      Returns:
      this
    • publiclyAccessible

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder publiclyAccessible(Boolean publiclyAccessible)
      Indicates whether the DB instance is an internet-facing instance.

      Default: - `true` if `vpcSubnets` is `subnetType: SubnetType.PUBLIC`, `false` otherwise

      Parameters:
      publiclyAccessible - Indicates whether the DB instance is an internet-facing instance. This parameter is required.
      Returns:
      this
    • removalPolicy

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder removalPolicy(RemovalPolicy removalPolicy)
      The CloudFormation policy to apply when the instance is removed from the stack or replaced during an update.

      Default: - RemovalPolicy.SNAPSHOT (remove the resource, but retain a snapshot of the data)

      Parameters:
      removalPolicy - The CloudFormation policy to apply when the instance is removed from the stack or replaced during an update. This parameter is required.
      Returns:
      this
    • s3ExportBuckets

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder s3ExportBuckets(List<? extends IBucket> s3ExportBuckets)
      S3 buckets that you want to load data into.

      This property must not be used if s3ExportRole is used.

      For Microsoft SQL Server:

      Default: - None

      Parameters:
      s3ExportBuckets - S3 buckets that you want to load data into. This parameter is required.
      Returns:
      this
      See Also:
    • s3ExportRole

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder s3ExportRole(IRole s3ExportRole)
      Role that will be associated with this DB instance to enable S3 export.

      This property must not be used if s3ExportBuckets is used.

      For Microsoft SQL Server:

      Default: - New role is created if `s3ExportBuckets` is set, no role is defined otherwise

      Parameters:
      s3ExportRole - Role that will be associated with this DB instance to enable S3 export. This parameter is required.
      Returns:
      this
      See Also:
    • s3ImportBuckets

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder s3ImportBuckets(List<? extends IBucket> s3ImportBuckets)
      S3 buckets that you want to load data from.

      This feature is only supported by the Microsoft SQL Server, Oracle, and PostgreSQL engines.

      This property must not be used if s3ImportRole is used.

      For Microsoft SQL Server:

      Default: - None

      Parameters:
      s3ImportBuckets - S3 buckets that you want to load data from. This parameter is required.
      Returns:
      this
      See Also:
    • s3ImportRole

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder s3ImportRole(IRole s3ImportRole)
      Role that will be associated with this DB instance to enable S3 import.

      This feature is only supported by the Microsoft SQL Server, Oracle, and PostgreSQL engines.

      This property must not be used if s3ImportBuckets is used.

      For Microsoft SQL Server:

      Default: - New role is created if `s3ImportBuckets` is set, no role is defined otherwise

      Parameters:
      s3ImportRole - Role that will be associated with this DB instance to enable S3 import. This parameter is required.
      Returns:
      this
      See Also:
    • securityGroups

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder securityGroups(List<? extends ISecurityGroup> securityGroups)
      The security groups to assign to the DB instance.

      Default: - a new security group is created

      Parameters:
      securityGroups - The security groups to assign to the DB instance. This parameter is required.
      Returns:
      this
    • storageType

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder storageType(StorageType storageType)
      The storage type.

      Storage types supported are gp2, io1, standard.

      Default: GP2

      Parameters:
      storageType - The storage type. This parameter is required.
      Returns:
      this
      See Also:
    • subnetGroup

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder subnetGroup(ISubnetGroup subnetGroup)
      Existing subnet group for the instance.

      Default: - a new subnet group will be created.

      Parameters:
      subnetGroup - Existing subnet group for the instance. This parameter is required.
      Returns:
      this
    • vpcPlacement

      @Stability(Deprecated) @Deprecated public DatabaseInstanceFromSnapshot.Builder vpcPlacement(SubnetSelection vpcPlacement)
      Deprecated.
      use vpcSubnets
      (deprecated) The type of subnets to add to the created DB subnet group.

      Default: - private subnets

      Parameters:
      vpcPlacement - The type of subnets to add to the created DB subnet group. This parameter is required.
      Returns:
      this
    • vpcSubnets

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder vpcSubnets(SubnetSelection vpcSubnets)
      The type of subnets to add to the created DB subnet group.

      Default: - private subnets

      Parameters:
      vpcSubnets - The type of subnets to add to the created DB subnet group. This parameter is required.
      Returns:
      this
    • engine

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder engine(IInstanceEngine engine)
      The database engine.

      Parameters:
      engine - The database engine. This parameter is required.
      Returns:
      this
    • allocatedStorage

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder allocatedStorage(Number allocatedStorage)
      The allocated storage size, specified in gigabytes (GB).

      Default: 100

      Parameters:
      allocatedStorage - The allocated storage size, specified in gigabytes (GB). This parameter is required.
      Returns:
      this
    • allowMajorVersionUpgrade

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder allowMajorVersionUpgrade(Boolean allowMajorVersionUpgrade)
      Whether to allow major version upgrades.

      Default: false

      Parameters:
      allowMajorVersionUpgrade - Whether to allow major version upgrades. This parameter is required.
      Returns:
      this
    • databaseName

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder databaseName(String databaseName)
      The name of the database.

      Default: - no name

      Parameters:
      databaseName - The name of the database. This parameter is required.
      Returns:
      this
    • instanceType

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder instanceType(InstanceType instanceType)
      The name of the compute and memory capacity for the instance.

      Default: - m5.large (or, more specifically, db.m5.large)

      Parameters:
      instanceType - The name of the compute and memory capacity for the instance. This parameter is required.
      Returns:
      this
    • licenseModel

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder licenseModel(LicenseModel licenseModel)
      The license model.

      Default: - RDS default license model

      Parameters:
      licenseModel - The license model. This parameter is required.
      Returns:
      this
    • parameters

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder parameters(Map<String,String> parameters)
      The parameters in the DBParameterGroup to create automatically.

      You can only specify parameterGroup or parameters but not both. You need to use a versioned engine to auto-generate a DBParameterGroup.

      Default: - None

      Parameters:
      parameters - The parameters in the DBParameterGroup to create automatically. This parameter is required.
      Returns:
      this
    • timezone

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder timezone(String timezone)
      The time zone of the instance.

      This is currently supported only by Microsoft Sql Server.

      Default: - RDS default timezone

      Parameters:
      timezone - The time zone of the instance. This parameter is required.
      Returns:
      this
    • snapshotIdentifier

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder snapshotIdentifier(String snapshotIdentifier)
      The name or Amazon Resource Name (ARN) of the DB snapshot that's used to restore the DB instance.

      If you're restoring from a shared manual DB snapshot, you must specify the ARN of the snapshot.

      Parameters:
      snapshotIdentifier - The name or Amazon Resource Name (ARN) of the DB snapshot that's used to restore the DB instance. This parameter is required.
      Returns:
      this
    • credentials

      @Stability(Stable) public DatabaseInstanceFromSnapshot.Builder credentials(SnapshotCredentials credentials)
      Master user credentials.

      Note - It is not possible to change the master username for a snapshot; however, it is possible to provide (or generate) a new password.

      Default: - The existing username and password from the snapshot will be used.

      Parameters:
      credentials - Master user credentials. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public DatabaseInstanceFromSnapshot build()
      Specified by:
      build in interface software.amazon.jsii.Builder<DatabaseInstanceFromSnapshot>
      Returns:
      a newly built instance of DatabaseInstanceFromSnapshot.