in aws-rds-dbcluster/src/main/java/software/amazon/rds/dbcluster/Translator.java [332:386]
public static ResourceModel translateDbClusterFromSdk(
final software.amazon.awssdk.services.rds.model.DBCluster dbCluster
) {
return ResourceModel.builder()
.associatedRoles(
Optional.ofNullable(dbCluster.associatedRoles())
.orElse(Collections.emptyList())
.stream()
.map(Translator::transformDBCusterRoleFromSdk)
.collect(Collectors.toList())
)
.availabilityZones(dbCluster.availabilityZones())
.backtrackWindow(Translator.castToInt(dbCluster.backtrackWindow()))
.backupRetentionPeriod(dbCluster.backupRetentionPeriod())
.copyTagsToSnapshot(dbCluster.copyTagsToSnapshot())
.databaseName(dbCluster.databaseName())
.dBClusterIdentifier(dbCluster.dbClusterIdentifier())
.dBClusterParameterGroupName(dbCluster.dbClusterParameterGroup())
.dBSubnetGroupName(dbCluster.dbSubnetGroup())
.deletionProtection(dbCluster.deletionProtection())
.enableCloudwatchLogsExports(dbCluster.enabledCloudwatchLogsExports())
.enableHttpEndpoint(dbCluster.httpEndpointEnabled())
.enableIAMDatabaseAuthentication(dbCluster.iamDatabaseAuthenticationEnabled())
.endpoint(
Endpoint.builder()
.address(dbCluster.endpoint())
.port(Optional.ofNullable(dbCluster.port()).map(Object::toString).orElse(""))
.build()
)
.engine(dbCluster.engine())
.engineMode(dbCluster.engineMode())
.engineVersion(dbCluster.engineVersion())
.kmsKeyId(dbCluster.kmsKeyId())
.masterUsername(dbCluster.masterUsername())
.port(dbCluster.port())
.preferredBackupWindow(dbCluster.preferredBackupWindow())
.preferredMaintenanceWindow(dbCluster.preferredMaintenanceWindow())
.readEndpoint(
ReadEndpoint.builder()
.address(dbCluster.readerEndpoint())
.build()
)
.replicationSourceIdentifier(dbCluster.replicationSourceIdentifier())
.scalingConfiguration(Translator.translateScalingConfigurationFromSdk(dbCluster.scalingConfigurationInfo()))
.storageEncrypted(dbCluster.storageEncrypted())
.tags(Translator.translateTagsFromSdk(dbCluster.tagList()))
.vpcSecurityGroupIds(
Optional.ofNullable(dbCluster.vpcSecurityGroups())
.orElse(Collections.emptyList())
.stream()
.map(VpcSecurityGroupMembership::vpcSecurityGroupId)
.collect(Collectors.toList())
)
.build();
}