Enum StorageType

java.lang.Object
java.lang.Enum<StorageType>
software.amazon.awscdk.services.rds.StorageType
All Implemented Interfaces:
Serializable, Comparable<StorageType>, java.lang.constant.Constable

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:49.279Z") @Stability(Stable) public enum StorageType extends Enum<StorageType>
The type of storage.

Example:

 // Set open cursors with parameter group
 ParameterGroup parameterGroup = ParameterGroup.Builder.create(this, "ParameterGroup")
         .engine(DatabaseInstanceEngine.oracleSe2(OracleSe2InstanceEngineProps.builder().version(OracleEngineVersion.VER_19_0_0_0_2020_04_R1).build()))
         .parameters(Map.of(
                 "open_cursors", "2500"))
         .build();
 OptionGroup optionGroup = OptionGroup.Builder.create(this, "OptionGroup")
         .engine(DatabaseInstanceEngine.oracleSe2(OracleSe2InstanceEngineProps.builder().version(OracleEngineVersion.VER_19_0_0_0_2020_04_R1).build()))
         .configurations(List.of(OptionConfiguration.builder()
                 .name("LOCATOR")
                 .build(), OptionConfiguration.builder()
                 .name("OEM")
                 .port(1158)
                 .vpc(vpc)
                 .build()))
         .build();
 // Allow connections to OEM
 optionGroup.optionConnections.OEM.connections.allowDefaultPortFromAnyIpv4();
 // Database instance with production values
 DatabaseInstance instance = DatabaseInstance.Builder.create(this, "Instance")
         .engine(DatabaseInstanceEngine.oracleSe2(OracleSe2InstanceEngineProps.builder().version(OracleEngineVersion.VER_19_0_0_0_2020_04_R1).build()))
         .licenseModel(LicenseModel.BRING_YOUR_OWN_LICENSE)
         .instanceType(InstanceType.of(InstanceClass.BURSTABLE3, InstanceSize.MEDIUM))
         .multiAz(true)
         .storageType(StorageType.IO1)
         .credentials(Credentials.fromUsername("syscdk"))
         .vpc(vpc)
         .databaseName("ORCL")
         .storageEncrypted(true)
         .backupRetention(Duration.days(7))
         .monitoringInterval(Duration.seconds(60))
         .enablePerformanceInsights(true)
         .cloudwatchLogsExports(List.of("trace", "audit", "alert", "listener"))
         .cloudwatchLogsRetention(RetentionDays.ONE_MONTH)
         .autoMinorVersionUpgrade(true) // required to be true if LOCATOR is used in the option group
         .optionGroup(optionGroup)
         .parameterGroup(parameterGroup)
         .removalPolicy(RemovalPolicy.DESTROY)
         .build();
 // Allow connections on default port from any IPV4
 instance.connections.allowDefaultPortFromAnyIpv4();
 // Rotate the master user password every 30 days
 instance.addRotationSingleUser();
 // Add alarm for high CPU
 // Add alarm for high CPU
 Alarm.Builder.create(this, "HighCPU")
         .metric(instance.metricCPUUtilization())
         .threshold(90)
         .evaluationPeriods(1)
         .build();
 // Trigger Lambda function on instance availability events
 Function fn = Function.Builder.create(this, "Function")
         .code(Code.fromInline("exports.handler = (event) => console.log(event);"))
         .handler("index.handler")
         .runtime(Runtime.NODEJS_14_X)
         .build();
 Rule availabilityRule = instance.onEvent("Availability", OnEventOptions.builder().target(new LambdaFunction(fn)).build());
 availabilityRule.addEventPattern(EventPattern.builder()
         .detail(Map.of(
                 "EventCategories", List.of("availability")))
         .build());
 
  • Enum Constant Details

    • STANDARD

      @Stability(Stable) public static final StorageType STANDARD
      Standard.
    • GP2

      @Stability(Stable) public static final StorageType GP2
      General purpose (SSD).
    • IO1

      @Stability(Stable) public static final StorageType IO1
      Provisioned IOPS (SSD).
  • Method Details

    • values

      public static StorageType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static StorageType valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null