mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
feat(docdb): add Amazon DocumentDB service emulation (#1341)
* feat(docdb): add DocDbCluster model * feat(docdb): add DocDbInstance model * feat(docdb): add DocDbContainerHandler * feat(docdb): add container manager and service config * feat(docdb): add DocDbService with cluster and instance lifecycle * feat(docdb): add DocDbQueryHandler * feat(docdb): Register the service in ResolvedServiceCatalog and Dispatch in AwsQueryController * test(docdb): add integration test for cluster and instance lifecycle * fix(docdb): probe MongoDB readiness with a TCP connect instead of a Gremlin HTTP request * fix(docdb): stop persisting the cluster master password at rest * fix(docdb): return a generic AWS error envelope for unexpected failures * feat(docdb): add mock mode to return responses without starting a container
This commit is contained in:
1 parent
2536b4ab86
commit
bd96d4e866
11 files changed
+1283
-1
No files matched your search
@@ -365,6 +365,7 @@ public interface EmulatorConfig {
|
||||
AutoScalingServiceConfig autoscaling();
|
||||
BackupServiceConfig backup();
|
||||
NeptuneServiceConfig neptune();
|
||||
DocDbServiceConfig docdb();
|
||||
Route53ServiceConfig route53();
|
||||
TransferServiceConfig transfer();
|
||||
TextractServiceConfig textract();
|
||||
@@ -582,6 +583,19 @@ public interface EmulatorConfig {
|
||||
Optional<String> dockerNetwork();
|
||||
}
|
||||
|
||||
interface DocDbServiceConfig {
|
||||
@WithDefault("true")
|
||||
boolean enabled();
|
||||
|
||||
@WithDefault("false")
|
||||
boolean mock();
|
||||
|
||||
@WithDefault("mongo:7.0")
|
||||
String defaultImage();
|
||||
|
||||
Optional<String> dockerNetwork();
|
||||
}
|
||||
|
||||
interface EventBridgeServiceConfig {
|
||||
@WithDefault("true")
|
||||
boolean enabled();
|
||||
|
||||
@@ -2,6 +2,8 @@ package io.github.hectorvent.floci.core.common;
|
||||
|
||||
import io.github.hectorvent.floci.services.neptune.NeptuneQueryHandler;
|
||||
import io.github.hectorvent.floci.services.neptune.NeptuneService;
|
||||
import io.github.hectorvent.floci.services.docdb.DocDbQueryHandler;
|
||||
import io.github.hectorvent.floci.services.docdb.DocDbService;
|
||||
import io.github.hectorvent.floci.services.autoscaling.AutoScalingQueryHandler;
|
||||
import io.github.hectorvent.floci.services.cloudformation.CloudFormationQueryHandler;
|
||||
import io.github.hectorvent.floci.services.ec2.Ec2QueryHandler;
|
||||
@@ -174,6 +176,8 @@ public class AwsQueryController {
|
||||
private final RdsQueryHandler rdsQueryHandler;
|
||||
private final NeptuneQueryHandler neptuneQueryHandler;
|
||||
private final NeptuneService neptuneService;
|
||||
private final DocDbQueryHandler docDbQueryHandler;
|
||||
private final DocDbService docDbService;
|
||||
private final SqsQueryHandler sqsQueryHandler;
|
||||
private final SnsQueryHandler snsQueryHandler;
|
||||
private final SesQueryHandler sesQueryHandler;
|
||||
@@ -193,6 +197,8 @@ public class AwsQueryController {
|
||||
RdsQueryHandler rdsQueryHandler,
|
||||
NeptuneQueryHandler neptuneQueryHandler,
|
||||
NeptuneService neptuneService,
|
||||
DocDbQueryHandler docDbQueryHandler,
|
||||
DocDbService docDbService,
|
||||
SqsQueryHandler sqsQueryHandler, SnsQueryHandler snsQueryHandler,
|
||||
SesQueryHandler sesQueryHandler,
|
||||
IamQueryHandler iamQueryHandler, StsQueryHandler stsQueryHandler,
|
||||
@@ -208,6 +214,8 @@ public class AwsQueryController {
|
||||
this.rdsQueryHandler = rdsQueryHandler;
|
||||
this.neptuneQueryHandler = neptuneQueryHandler;
|
||||
this.neptuneService = neptuneService;
|
||||
this.docDbQueryHandler = docDbQueryHandler;
|
||||
this.docDbService = docDbService;
|
||||
this.sqsQueryHandler = sqsQueryHandler;
|
||||
this.snsQueryHandler = snsQueryHandler;
|
||||
this.sesQueryHandler = sesQueryHandler;
|
||||
@@ -246,7 +254,7 @@ public class AwsQueryController {
|
||||
case "iam" -> iamQueryHandler.handle(action, formParams);
|
||||
case "sts" -> stsQueryHandler.handle(action, formParams);
|
||||
case "elasticache" -> elastiCacheQueryHandler.handle(action, formParams);
|
||||
case "rds" -> {
|
||||
case "rds" -> {
|
||||
// Neptune signs requests with "rds" credential scope (same wire protocol).
|
||||
// Route to Neptune when Engine=neptune (create ops) or when the cluster/instance
|
||||
// already exists in Neptune storage (describe/modify/delete ops).
|
||||
@@ -258,9 +266,16 @@ public class AwsQueryController {
|
||||
|| neptuneService.hasInstance(instanceId)) {
|
||||
yield neptuneQueryHandler.handle(action, formParams);
|
||||
}
|
||||
|
||||
if ("docdb".equalsIgnoreCase(engine)
|
||||
|| docDbService.hasCluster(clusterId)
|
||||
|| docDbService.hasInstance(instanceId)) {
|
||||
yield docDbQueryHandler.handle(action, formParams);
|
||||
}
|
||||
yield rdsQueryHandler.handle(action, formParams);
|
||||
}
|
||||
case "neptune" -> neptuneQueryHandler.handle(action, formParams);
|
||||
case "docdb" -> docDbQueryHandler.handle(action, formParams);
|
||||
case "email" -> sesQueryHandler.handle(action, formParams, region);
|
||||
case "monitoring" -> cloudWatchMetricsQueryHandler.handle(action, formParams, region);
|
||||
case "cloudformation" -> cloudFormationQueryHandler.handle(action, formParams, region);
|
||||
|
||||
@@ -101,6 +101,12 @@ public class ResolvedServiceCatalog {
|
||||
5000L, AwsNamespaces.RDS, ServiceProtocol.QUERY,
|
||||
protocols(ServiceProtocol.QUERY),
|
||||
Set.of(), Set.of("neptune"), Set.of(), Set.of()),
|
||||
descriptor("docdb", "docdb", config.services().docdb().enabled(), true,
|
||||
"docdb", config.storage().mode(),
|
||||
5000L, AwsNamespaces.RDS, ServiceProtocol.QUERY,
|
||||
protocols(ServiceProtocol.QUERY),
|
||||
Set.of(), Set.of("docdb"), Set.of(), Set.of()),
|
||||
|
||||
descriptor("events", "eventbridge", config.services().eventbridge().enabled(), true,
|
||||
"eventbridge", config.storage().mode(), 5000L, null, ServiceProtocol.JSON,
|
||||
protocols(ServiceProtocol.JSON),
|
||||
|
||||
@@ -0,0 +1,266 @@
|
||||
package io.github.hectorvent.floci.services.docdb;
|
||||
|
||||
import io.github.hectorvent.floci.config.EmulatorConfig;
|
||||
import io.github.hectorvent.floci.core.common.AwsException;
|
||||
import io.github.hectorvent.floci.core.common.AwsNamespaces;
|
||||
import io.github.hectorvent.floci.core.common.AwsQueryResponse;
|
||||
import io.github.hectorvent.floci.core.common.XmlBuilder;
|
||||
import io.github.hectorvent.floci.services.docdb.model.DocDbCluster;
|
||||
import io.github.hectorvent.floci.services.docdb.model.DocDbInstance;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.ws.rs.core.MultivaluedMap;
|
||||
import jakarta.ws.rs.core.Response;
|
||||
import org.jboss.logging.Logger;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
@ApplicationScoped
|
||||
public class DocDbQueryHandler {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(DocDbQueryHandler.class);
|
||||
|
||||
private final DocDbService service;
|
||||
private final EmulatorConfig config;
|
||||
|
||||
@Inject
|
||||
public DocDbQueryHandler(DocDbService service, EmulatorConfig config) {
|
||||
this.service = service;
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
public Response handle(String action, MultivaluedMap<String, String> params) {
|
||||
LOG.infov("DocDB action: {0}", action);
|
||||
try {
|
||||
return switch (action) {
|
||||
case "CreateDBCluster" -> handleCreateDbCluster(params);
|
||||
case "DescribeDBClusters" -> handleDescribeDbClusters(params);
|
||||
case "DeleteDBCluster" -> handleDeleteDbCluster(params);
|
||||
case "ModifyDBCluster" -> handleModifyDbCluster(params);
|
||||
case "CreateDBInstance" -> handleCreateDbInstance(params);
|
||||
case "DescribeDBInstances"-> handleDescribeDbInstances(params);
|
||||
case "DeleteDBInstance" -> handleDeleteDbInstance(params);
|
||||
case "ModifyDBInstance" -> handleModifyDbInstance(params);
|
||||
default -> AwsQueryResponse.error("UnsupportedOperation",
|
||||
"Operation " + action + " is not supported by DocDB.", AwsNamespaces.RDS, 400);
|
||||
};
|
||||
} catch (AwsException e) {
|
||||
return AwsQueryResponse.error(e.getErrorCode(), e.getMessage(), AwsNamespaces.RDS, e.getHttpStatus());
|
||||
} catch (Exception e) {
|
||||
LOG.errorv(e, "Unexpected error in DocDB {0}", action);
|
||||
return AwsQueryResponse.error("InternalFailure",
|
||||
"An internal error occurred while processing the request.",
|
||||
AwsNamespaces.RDS, 500);
|
||||
}
|
||||
}
|
||||
|
||||
// ── Clusters ──────────────────────────────────────────────────────────────
|
||||
|
||||
private Response handleCreateDbCluster(MultivaluedMap<String, String> params) {
|
||||
String id = params.getFirst("DBClusterIdentifier");
|
||||
if (id == null || id.isBlank()) {
|
||||
return AwsQueryResponse.error("InvalidParameterValue",
|
||||
"DBClusterIdentifier is required.", AwsNamespaces.RDS, 400);
|
||||
}
|
||||
String engineVersion = params.getFirst("EngineVersion");
|
||||
String masterUsername = params.getFirst("MasterUsername");
|
||||
String masterPassword = params.getFirst("MasterUserPassword");
|
||||
boolean iamEnabled = "true".equalsIgnoreCase(params.getFirst("EnableIAMDatabaseAuthentication"));
|
||||
|
||||
DocDbCluster cluster = service.createDbCluster(id, engineVersion,
|
||||
masterUsername, masterPassword, iamEnabled);
|
||||
return Response.ok(AwsQueryResponse.envelope("CreateDBCluster", AwsNamespaces.RDS,
|
||||
clusterXml(cluster))).build();
|
||||
}
|
||||
|
||||
private Response handleDescribeDbClusters(MultivaluedMap<String, String> params) {
|
||||
String filterId = params.getFirst("DBClusterIdentifier");
|
||||
if (filterId == null || filterId.isBlank()) {
|
||||
filterId = extractFilterValue(params, "db-cluster-id");
|
||||
}
|
||||
|
||||
// When a specific cluster ID is requested, AWS returns 404 if not found
|
||||
if (filterId != null && !filterId.isBlank()) {
|
||||
service.getDbCluster(filterId); // throws DBClusterNotFoundFault if absent
|
||||
}
|
||||
|
||||
Collection<DocDbCluster> result = service.listDbClusters(filterId);
|
||||
|
||||
XmlBuilder xml = new XmlBuilder().start("DBClusters");
|
||||
for (DocDbCluster c : result) {
|
||||
xml.start("DBCluster").raw(clusterInnerXml(c)).end("DBCluster");
|
||||
}
|
||||
xml.end("DBClusters").start("Marker").end("Marker");
|
||||
return Response.ok(AwsQueryResponse.envelope("DescribeDBClusters", AwsNamespaces.RDS, xml.build())).build();
|
||||
}
|
||||
|
||||
private Response handleDeleteDbCluster(MultivaluedMap<String, String> params) {
|
||||
String id = params.getFirst("DBClusterIdentifier");
|
||||
if (id == null || id.isBlank()) {
|
||||
return AwsQueryResponse.error("InvalidParameterValue",
|
||||
"DBClusterIdentifier is required.", AwsNamespaces.RDS, 400);
|
||||
}
|
||||
DocDbCluster cluster = service.getDbCluster(id);
|
||||
service.deleteDbCluster(id);
|
||||
return Response.ok(AwsQueryResponse.envelope("DeleteDBCluster", AwsNamespaces.RDS,
|
||||
clusterXml(cluster))).build();
|
||||
}
|
||||
|
||||
private Response handleModifyDbCluster(MultivaluedMap<String, String> params) {
|
||||
String id = params.getFirst("DBClusterIdentifier");
|
||||
if (id == null || id.isBlank()) {
|
||||
return AwsQueryResponse.error("InvalidParameterValue",
|
||||
"DBClusterIdentifier is required.", AwsNamespaces.RDS, 400);
|
||||
}
|
||||
String engineVersion = params.getFirst("EngineVersion");
|
||||
String iamStr = params.getFirst("EnableIAMDatabaseAuthentication");
|
||||
Boolean iamEnabled = iamStr != null ? Boolean.parseBoolean(iamStr) : null;
|
||||
|
||||
DocDbCluster cluster = service.modifyDbCluster(id, engineVersion, iamEnabled);
|
||||
return Response.ok(AwsQueryResponse.envelope("ModifyDBCluster", AwsNamespaces.RDS,
|
||||
clusterXml(cluster))).build();
|
||||
}
|
||||
|
||||
// ── Instances ─────────────────────────────────────────────────────────────
|
||||
|
||||
private Response handleCreateDbInstance(MultivaluedMap<String, String> params) {
|
||||
String id = params.getFirst("DBInstanceIdentifier");
|
||||
if (id == null || id.isBlank()) {
|
||||
return AwsQueryResponse.error("InvalidParameterValue",
|
||||
"DBInstanceIdentifier is required.", AwsNamespaces.RDS, 400);
|
||||
}
|
||||
String dbClusterIdentifier = params.getFirst("DBClusterIdentifier");
|
||||
if (dbClusterIdentifier == null || dbClusterIdentifier.isBlank()) {
|
||||
return AwsQueryResponse.error("InvalidParameterValue",
|
||||
"DBClusterIdentifier is required for DocDB instances.", AwsNamespaces.RDS, 400);
|
||||
}
|
||||
String dbInstanceClass = params.getFirst("DBInstanceClass");
|
||||
String engineVersion = params.getFirst("EngineVersion");
|
||||
boolean iamEnabled = "true".equalsIgnoreCase(params.getFirst("EnableIAMDatabaseAuthentication"));
|
||||
|
||||
DocDbInstance instance = service.createDbInstance(id, dbClusterIdentifier,
|
||||
dbInstanceClass, engineVersion, iamEnabled);
|
||||
return Response.ok(AwsQueryResponse.envelope("CreateDBInstance", AwsNamespaces.RDS,
|
||||
instanceXml(instance))).build();
|
||||
}
|
||||
|
||||
private Response handleDescribeDbInstances(MultivaluedMap<String, String> params) {
|
||||
String filterId = params.getFirst("DBInstanceIdentifier");
|
||||
if (filterId == null || filterId.isBlank()) {
|
||||
filterId = extractFilterValue(params, "db-instance-id");
|
||||
}
|
||||
|
||||
if (filterId != null && !filterId.isBlank()) {
|
||||
service.getDbInstance(filterId); // throws DBInstanceNotFound if absent
|
||||
}
|
||||
|
||||
Collection<DocDbInstance> result = service.listDbInstances(filterId);
|
||||
|
||||
XmlBuilder xml = new XmlBuilder().start("DBInstances");
|
||||
for (DocDbInstance i : result) {
|
||||
xml.start("DBInstance").raw(instanceInnerXml(i)).end("DBInstance");
|
||||
}
|
||||
xml.end("DBInstances").start("Marker").end("Marker");
|
||||
return Response.ok(AwsQueryResponse.envelope("DescribeDBInstances", AwsNamespaces.RDS, xml.build())).build();
|
||||
}
|
||||
|
||||
private Response handleDeleteDbInstance(MultivaluedMap<String, String> params) {
|
||||
String id = params.getFirst("DBInstanceIdentifier");
|
||||
if (id == null || id.isBlank()) {
|
||||
return AwsQueryResponse.error("InvalidParameterValue",
|
||||
"DBInstanceIdentifier is required.", AwsNamespaces.RDS, 400);
|
||||
}
|
||||
DocDbInstance instance = service.getDbInstance(id);
|
||||
service.deleteDbInstance(id);
|
||||
return Response.ok(AwsQueryResponse.envelope("DeleteDBInstance", AwsNamespaces.RDS,
|
||||
instanceXml(instance))).build();
|
||||
}
|
||||
|
||||
private Response handleModifyDbInstance(MultivaluedMap<String, String> params) {
|
||||
String id = params.getFirst("DBInstanceIdentifier");
|
||||
if (id == null || id.isBlank()) {
|
||||
return AwsQueryResponse.error("InvalidParameterValue",
|
||||
"DBInstanceIdentifier is required.", AwsNamespaces.RDS, 400);
|
||||
}
|
||||
String dbInstanceClass = params.getFirst("DBInstanceClass");
|
||||
String iamStr = params.getFirst("EnableIAMDatabaseAuthentication");
|
||||
Boolean iamEnabled = iamStr != null ? Boolean.parseBoolean(iamStr) : null;
|
||||
|
||||
DocDbInstance instance = service.modifyDbInstance(id, dbInstanceClass, iamEnabled);
|
||||
return Response.ok(AwsQueryResponse.envelope("ModifyDBInstance", AwsNamespaces.RDS,
|
||||
instanceXml(instance))).build();
|
||||
}
|
||||
|
||||
// ── XML builders ──────────────────────────────────────────────────────────
|
||||
|
||||
private String clusterXml(DocDbCluster c) {
|
||||
return new XmlBuilder().start("DBCluster").raw(clusterInnerXml(c)).end("DBCluster").build();
|
||||
}
|
||||
|
||||
private String clusterInnerXml(DocDbCluster c) {
|
||||
XmlBuilder xml = new XmlBuilder()
|
||||
.elem("DBClusterIdentifier", c.getDbClusterIdentifier())
|
||||
.elem("Status", c.getStatus())
|
||||
.elem("Engine", "docdb")
|
||||
.elem("EngineVersion", c.getEngineVersion())
|
||||
.elem("Endpoint", c.getEndpoint())
|
||||
.elem("ReaderEndpoint", c.getReaderEndpoint())
|
||||
.elem("Port", c.getPort())
|
||||
.elem("MasterUsername", c.getMasterUsername())
|
||||
.elem("IAMDatabaseAuthenticationEnabled", c.isIamDatabaseAuthenticationEnabled())
|
||||
.elem("MultiAZ", false)
|
||||
.elem("StorageEncrypted", true)
|
||||
.elem("AvailabilityZone", config.defaultAvailabilityZone())
|
||||
.elem("DbClusterResourceId", c.getDbClusterResourceId())
|
||||
.elem("DBClusterArn", c.getDbClusterArn())
|
||||
.start("DBClusterMembers");
|
||||
if (c.getDbClusterMembers() != null) {
|
||||
for (String memberId : c.getDbClusterMembers()) {
|
||||
xml.start("member")
|
||||
.elem("DBInstanceIdentifier", memberId)
|
||||
.elem("IsClusterWriter", true)
|
||||
.end("member");
|
||||
}
|
||||
}
|
||||
xml.end("DBClusterMembers");
|
||||
return xml.build();
|
||||
}
|
||||
|
||||
private String instanceXml(DocDbInstance i) {
|
||||
return new XmlBuilder().start("DBInstance").raw(instanceInnerXml(i)).end("DBInstance").build();
|
||||
}
|
||||
|
||||
private String instanceInnerXml(DocDbInstance i) {
|
||||
return new XmlBuilder()
|
||||
.elem("DBInstanceIdentifier", i.getDbInstanceIdentifier())
|
||||
.elem("DBClusterIdentifier", i.getDbClusterIdentifier())
|
||||
.elem("DBInstanceClass", i.getDbInstanceClass())
|
||||
.elem("DBInstanceStatus", i.getStatus())
|
||||
.elem("Engine", "docdb")
|
||||
.elem("EngineVersion", i.getEngineVersion())
|
||||
.start("Endpoint")
|
||||
.elem("Address", i.getEndpoint())
|
||||
.elem("Port", i.getPort())
|
||||
.end("Endpoint")
|
||||
.elem("IAMDatabaseAuthenticationEnabled", i.isIamDatabaseAuthenticationEnabled())
|
||||
.elem("MultiAZ", false)
|
||||
.elem("StorageEncrypted", true)
|
||||
.elem("AvailabilityZone", config.defaultAvailabilityZone())
|
||||
.elem("DbiResourceId", i.getDbiResourceId())
|
||||
.elem("DBInstanceArn", i.getDbInstanceArn())
|
||||
.build();
|
||||
}
|
||||
|
||||
private static String extractFilterValue(MultivaluedMap<String, String> params, String filterName) {
|
||||
for (int i = 1; ; i++) {
|
||||
String name = params.getFirst("Filters.Filter." + i + ".Name");
|
||||
if (name == null) {
|
||||
break;
|
||||
}
|
||||
if (filterName.equals(name)) {
|
||||
return params.getFirst("Filters.Filter." + i + ".Values.Value.1");
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,242 @@
|
||||
package io.github.hectorvent.floci.services.docdb;
|
||||
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import io.github.hectorvent.floci.config.EmulatorConfig;
|
||||
import io.github.hectorvent.floci.core.common.AwsException;
|
||||
import io.github.hectorvent.floci.core.common.RegionResolver;
|
||||
import io.github.hectorvent.floci.core.storage.StorageBackend;
|
||||
import io.github.hectorvent.floci.core.storage.StorageFactory;
|
||||
import io.github.hectorvent.floci.services.docdb.container.DocDbContainerHandle;
|
||||
import io.github.hectorvent.floci.services.docdb.container.DocDbContainerManager;
|
||||
import io.github.hectorvent.floci.services.docdb.model.DocDbCluster;
|
||||
import io.github.hectorvent.floci.services.docdb.model.DocDbInstance;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.inject.Inject;
|
||||
import org.jboss.logging.Logger;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
@ApplicationScoped
|
||||
public class DocDbService {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(DocDbService.class);
|
||||
private static final String ENGINE_VERSION_DEFAULT = "5.0.0";
|
||||
private static final int MONGO_PORT = 27017;
|
||||
|
||||
private final StorageBackend<String, DocDbCluster> clusters;
|
||||
private final StorageBackend<String, DocDbInstance> instances;
|
||||
private final EmulatorConfig config;
|
||||
private final RegionResolver regionResolver;
|
||||
private final DocDbContainerManager containerManager;
|
||||
|
||||
@Inject
|
||||
public DocDbService(EmulatorConfig config,
|
||||
RegionResolver regionResolver,
|
||||
DocDbContainerManager containerManager,
|
||||
StorageFactory storageFactory) {
|
||||
this.config = config;
|
||||
this.regionResolver = regionResolver;
|
||||
this.containerManager = containerManager;
|
||||
this.clusters = storageFactory.create("docdb", "docdb-clusters.json",
|
||||
new TypeReference<Map<String, DocDbCluster>>() {});
|
||||
this.instances = storageFactory.create("docdb", "docdb-instances.json",
|
||||
new TypeReference<Map<String, DocDbInstance>>() {});
|
||||
}
|
||||
|
||||
// ── Clusters ──────────────────────────────────────────────────────────────
|
||||
|
||||
public DocDbCluster createDbCluster(String id, String engineVersion,
|
||||
String masterUsername, String masterPassword,
|
||||
boolean iamEnabled) {
|
||||
if (clusters.get(id).isPresent()) {
|
||||
throw new AwsException("DBClusterAlreadyExistsFault",
|
||||
"DocDB cluster " + id + " already exists.", 400);
|
||||
}
|
||||
|
||||
String region = regionResolver.getDefaultRegion();
|
||||
|
||||
DocDbCluster cluster = new DocDbCluster();
|
||||
cluster.setDbClusterIdentifier(id);
|
||||
cluster.setStatus("available");
|
||||
cluster.setEngineVersion(engineVersion != null ? engineVersion : ENGINE_VERSION_DEFAULT);
|
||||
cluster.setMasterUsername(masterUsername);
|
||||
cluster.setIamDatabaseAuthenticationEnabled(iamEnabled);
|
||||
cluster.setDbClusterArn(regionResolver.buildArn("rds", region, "cluster:" + id));
|
||||
cluster.setDbClusterResourceId("cluster-" + UUID.randomUUID().toString()
|
||||
.replace("-", "").substring(0, 24).toUpperCase());
|
||||
cluster.setCreatedAt(Instant.now());
|
||||
cluster.setDbClusterMembers(new ArrayList<>());
|
||||
|
||||
if (config.services().docdb().mock()) {
|
||||
LOG.infov("Creating DocDB cluster {0} in mock mode (no container)", id);
|
||||
cluster.setEndpoint("localhost");
|
||||
cluster.setReaderEndpoint("localhost");
|
||||
cluster.setPort(MONGO_PORT);
|
||||
} else {
|
||||
String image = config.services().docdb().defaultImage();
|
||||
LOG.infov("Creating DocDB cluster {0}, image={1}", id, image);
|
||||
DocDbContainerHandle handle = containerManager.start(id, image, masterUsername, masterPassword);
|
||||
cluster.setEndpoint(handle.getHost());
|
||||
cluster.setReaderEndpoint(handle.getHost());
|
||||
cluster.setPort(handle.getPort());
|
||||
cluster.setContainerId(handle.getContainerId());
|
||||
cluster.setContainerHost(handle.getHost());
|
||||
cluster.setContainerPort(handle.getPort());
|
||||
}
|
||||
|
||||
clusters.put(id, cluster);
|
||||
LOG.infov("DocDB cluster {0} created, endpoint={1}:{2}",
|
||||
id, cluster.getEndpoint(), String.valueOf(cluster.getPort()));
|
||||
return cluster;
|
||||
}
|
||||
|
||||
public DocDbCluster getDbCluster(String id) {
|
||||
return clusters.get(id).orElseThrow(() ->
|
||||
new AwsException("DBClusterNotFoundFault",
|
||||
"DocDB cluster " + id + " not found.", 404));
|
||||
}
|
||||
|
||||
public boolean hasCluster(String id) {
|
||||
if (id == null || id.isBlank()) {
|
||||
return false;
|
||||
}
|
||||
return clusters.get(id).isPresent();
|
||||
}
|
||||
|
||||
public boolean hasInstance(String id) {
|
||||
if (id == null || id.isBlank()) {
|
||||
return false;
|
||||
}
|
||||
return instances.get(id).isPresent();
|
||||
}
|
||||
|
||||
public Collection<DocDbCluster> listDbClusters(String filterId) {
|
||||
if (filterId != null && !filterId.isBlank()) {
|
||||
return clusters.scan(k -> k.equalsIgnoreCase(filterId));
|
||||
}
|
||||
return clusters.scan(k -> true);
|
||||
}
|
||||
|
||||
public DocDbCluster modifyDbCluster(String id, String engineVersion, Boolean iamEnabled) {
|
||||
DocDbCluster cluster = getDbCluster(id);
|
||||
if (engineVersion != null && !engineVersion.isBlank()) {
|
||||
cluster.setEngineVersion(engineVersion);
|
||||
}
|
||||
if (iamEnabled != null) {
|
||||
cluster.setIamDatabaseAuthenticationEnabled(iamEnabled);
|
||||
}
|
||||
clusters.put(id, cluster);
|
||||
LOG.infov("DocDB cluster {0} modified", id);
|
||||
return cluster;
|
||||
}
|
||||
|
||||
public void deleteDbCluster(String id) {
|
||||
DocDbCluster cluster = clusters.get(id).orElseThrow(() ->
|
||||
new AwsException("DBClusterNotFoundFault",
|
||||
"DocDB cluster " + id + " not found.", 404));
|
||||
|
||||
if (cluster.getDbClusterMembers() != null && !cluster.getDbClusterMembers().isEmpty()) {
|
||||
throw new AwsException("InvalidDBClusterStateFault",
|
||||
"Cannot delete DocDB cluster " + id + " — it still has DB instances.", 400);
|
||||
}
|
||||
|
||||
cluster.setStatus("deleting");
|
||||
clusters.put(id, cluster);
|
||||
|
||||
if (cluster.getContainerId() != null) {
|
||||
containerManager.stop(new DocDbContainerHandle(
|
||||
cluster.getContainerId(), id,
|
||||
cluster.getContainerHost(), cluster.getContainerPort()));
|
||||
}
|
||||
|
||||
clusters.delete(id);
|
||||
LOG.infov("DocDB cluster {0} deleted", id);
|
||||
}
|
||||
|
||||
// ── Instances ─────────────────────────────────────────────────────────────
|
||||
|
||||
public DocDbInstance createDbInstance(String id, String dbClusterIdentifier,
|
||||
String dbInstanceClass, String engineVersion,
|
||||
boolean iamEnabled) {
|
||||
if (instances.get(id).isPresent()) {
|
||||
throw new AwsException("DBInstanceAlreadyExists",
|
||||
"DocDB instance " + id + " already exists.", 400);
|
||||
}
|
||||
|
||||
DocDbCluster cluster = getDbCluster(dbClusterIdentifier);
|
||||
String region = regionResolver.getDefaultRegion();
|
||||
|
||||
DocDbInstance instance = new DocDbInstance();
|
||||
instance.setDbInstanceIdentifier(id);
|
||||
instance.setDbClusterIdentifier(dbClusterIdentifier);
|
||||
instance.setDbInstanceClass(dbInstanceClass != null ? dbInstanceClass : "db.r5.large");
|
||||
instance.setEngineVersion(engineVersion != null ? engineVersion : cluster.getEngineVersion());
|
||||
instance.setStatus("available");
|
||||
instance.setEndpoint(cluster.getEndpoint());
|
||||
instance.setPort(cluster.getPort());
|
||||
instance.setIamDatabaseAuthenticationEnabled(iamEnabled);
|
||||
instance.setDbInstanceArn(regionResolver.buildArn("rds", region, "db:" + id));
|
||||
instance.setDbiResourceId("db-" + UUID.randomUUID().toString()
|
||||
.replace("-", "").substring(0, 24).toUpperCase());
|
||||
instance.setCreatedAt(Instant.now());
|
||||
|
||||
cluster.getDbClusterMembers().add(id);
|
||||
clusters.put(dbClusterIdentifier, cluster);
|
||||
|
||||
instances.put(id, instance);
|
||||
LOG.infov("DocDB instance {0} created in cluster {1}", id, dbClusterIdentifier);
|
||||
return instance;
|
||||
}
|
||||
|
||||
public DocDbInstance getDbInstance(String id) {
|
||||
return instances.get(id).orElseThrow(() ->
|
||||
new AwsException("DBInstanceNotFound",
|
||||
"DocDB instance " + id + " not found.", 404));
|
||||
}
|
||||
|
||||
public Collection<DocDbInstance> listDbInstances(String filterId) {
|
||||
if (filterId != null && !filterId.isBlank()) {
|
||||
return instances.scan(k -> k.equalsIgnoreCase(filterId));
|
||||
}
|
||||
return instances.scan(k -> true);
|
||||
}
|
||||
|
||||
public DocDbInstance modifyDbInstance(String id, String dbInstanceClass, Boolean iamEnabled) {
|
||||
DocDbInstance instance = getDbInstance(id);
|
||||
if (dbInstanceClass != null && !dbInstanceClass.isBlank()) {
|
||||
instance.setDbInstanceClass(dbInstanceClass);
|
||||
}
|
||||
if (iamEnabled != null) {
|
||||
instance.setIamDatabaseAuthenticationEnabled(iamEnabled);
|
||||
}
|
||||
instances.put(id, instance);
|
||||
LOG.infov("DocDB instance {0} modified", id);
|
||||
return instance;
|
||||
}
|
||||
|
||||
public void deleteDbInstance(String id) {
|
||||
DocDbInstance instance = instances.get(id).orElseThrow(() ->
|
||||
new AwsException("DBInstanceNotFound",
|
||||
"DocDB instance " + id + " not found.", 404));
|
||||
|
||||
String clusterId = instance.getDbClusterIdentifier();
|
||||
DocDbCluster cluster = clusters.get(clusterId).orElse(null);
|
||||
if (cluster != null) {
|
||||
cluster.getDbClusterMembers().remove(id);
|
||||
clusters.put(clusterId, cluster);
|
||||
}
|
||||
|
||||
instances.delete(id);
|
||||
LOG.infov("DocDB instance {0} deleted", id);
|
||||
}
|
||||
|
||||
// ── Helpers ───────────────────────────────────────────────────────────────
|
||||
|
||||
private String resolveEndpointHost() {
|
||||
return config.hostname().orElse("localhost");
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package io.github.hectorvent.floci.services.docdb.container;
|
||||
|
||||
import java.io.Closeable;
|
||||
|
||||
public class DocDbContainerHandle {
|
||||
|
||||
private final String containerId;
|
||||
private final String clusterId;
|
||||
private final String host;
|
||||
private final int port;
|
||||
private Closeable logStream;
|
||||
|
||||
public DocDbContainerHandle(String containerId, String clusterId, String host, int port) {
|
||||
this.containerId = containerId;
|
||||
this.clusterId = clusterId;
|
||||
this.host = host;
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public String getContainerId() { return containerId; }
|
||||
public String getClusterId() { return clusterId; }
|
||||
public String getHost() { return host; }
|
||||
public int getPort() { return port; }
|
||||
public Closeable getLogStream() { return logStream; }
|
||||
public void setLogStream(Closeable logStream) { this.logStream = logStream; }
|
||||
}
|
||||
+156
@@ -0,0 +1,156 @@
|
||||
package io.github.hectorvent.floci.services.docdb.container;
|
||||
|
||||
|
||||
import io.github.hectorvent.floci.config.EmulatorConfig;
|
||||
import io.github.hectorvent.floci.core.common.RegionResolver;
|
||||
import io.github.hectorvent.floci.core.common.docker.ContainerBuilder;
|
||||
import io.github.hectorvent.floci.core.common.docker.ContainerDetector;
|
||||
import io.github.hectorvent.floci.core.common.docker.ContainerLifecycleManager;
|
||||
import io.github.hectorvent.floci.core.common.docker.ContainerLifecycleManager.ContainerInfo;
|
||||
import io.github.hectorvent.floci.core.common.docker.ContainerLifecycleManager.EndpointInfo;
|
||||
import io.github.hectorvent.floci.core.common.docker.ContainerLogStreamer;
|
||||
import io.github.hectorvent.floci.core.common.docker.ContainerSpec;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.inject.Inject;
|
||||
import org.jboss.logging.Logger;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.Socket;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@ApplicationScoped
|
||||
public class DocDbContainerManager {
|
||||
|
||||
private static final Logger LOG = Logger.getLogger(DocDbContainerManager.class);
|
||||
private static final int MONGO_PORT = 27017;
|
||||
private static final int BACKEND_READY_DEADLINE_MS = 60_000;
|
||||
private static final int BACKEND_READY_RETRY_MS = 200;
|
||||
private static final int BACKEND_PROBE_CONNECT_MS = 2_000;
|
||||
|
||||
private final ContainerBuilder containerBuilder;
|
||||
private final ContainerLifecycleManager lifecycleManager;
|
||||
private final ContainerLogStreamer logStreamer;
|
||||
private final ContainerDetector containerDetector;
|
||||
private final EmulatorConfig config;
|
||||
private final RegionResolver regionResolver;
|
||||
private final Map<String, DocDbContainerHandle> activeContainers = new ConcurrentHashMap<>();
|
||||
|
||||
@Inject
|
||||
public DocDbContainerManager(ContainerBuilder containerBuilder,
|
||||
ContainerLifecycleManager lifecycleManager,
|
||||
ContainerLogStreamer logStreamer,
|
||||
ContainerDetector containerDetector,
|
||||
EmulatorConfig config,
|
||||
RegionResolver regionResolver) {
|
||||
this.containerBuilder = containerBuilder;
|
||||
this.lifecycleManager = lifecycleManager;
|
||||
this.logStreamer = logStreamer;
|
||||
this.containerDetector = containerDetector;
|
||||
this.config = config;
|
||||
this.regionResolver = regionResolver;
|
||||
}
|
||||
|
||||
public DocDbContainerHandle start(String clusterId, String image, String masterUsername, String masterPassword) {
|
||||
LOG.infov("Starting DocumentDB container for cluster: {0}", clusterId);
|
||||
|
||||
String containerName = "floci-docdb-" + clusterId;
|
||||
lifecycleManager.removeIfExists(containerName);
|
||||
|
||||
List<String> envVars = List.of(
|
||||
"MONGO_INITDB_ROOT_USERNAME=" + masterUsername,
|
||||
"MONGO_INITDB_ROOT_PASSWORD=" + masterPassword
|
||||
);
|
||||
|
||||
ContainerBuilder.Builder specBuilder = containerBuilder.newContainer(image)
|
||||
.withName(containerName)
|
||||
.withDockerNetwork(config.services().docdb().dockerNetwork())
|
||||
.withLogRotation()
|
||||
.withEnv(envVars);
|
||||
|
||||
if (!containerDetector.isRunningInContainer()) {
|
||||
specBuilder.withDynamicPort(MONGO_PORT);
|
||||
} else {
|
||||
specBuilder.withExposedPort(MONGO_PORT);
|
||||
}
|
||||
|
||||
|
||||
ContainerSpec spec = specBuilder.build();
|
||||
ContainerInfo info = lifecycleManager.createAndStart(spec);
|
||||
EndpointInfo endpoint = info.getEndpoint(MONGO_PORT);
|
||||
|
||||
LOG.infov("DocumentDB container for cluster {0}: {1}", clusterId, endpoint);
|
||||
|
||||
DocDbContainerHandle handle = new DocDbContainerHandle(
|
||||
info.containerId(), clusterId, endpoint.host(), endpoint.port());
|
||||
activeContainers.put(clusterId, handle);
|
||||
|
||||
String shortId = info.containerId().length() >= 8
|
||||
? info.containerId().substring(0, 8)
|
||||
: info.containerId();
|
||||
String logGroup = "/aws/docdb/cluster/" + clusterId + "/audit";
|
||||
String logStream = logStreamer.generateLogStreamName(shortId);
|
||||
String region = regionResolver.getDefaultRegion();
|
||||
|
||||
Closeable logHandle = logStreamer.attach(
|
||||
info.containerId(), logGroup, logStream, region, "docdb:" + clusterId);
|
||||
handle.setLogStream(logHandle);
|
||||
|
||||
waitForBackendReady(clusterId, endpoint.host(), endpoint.port());
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
public void stop(DocDbContainerHandle handle) {
|
||||
if (handle == null) {
|
||||
return;
|
||||
}
|
||||
activeContainers.remove(handle.getClusterId());
|
||||
lifecycleManager.stopAndRemove(handle.getContainerId(), handle.getLogStream());
|
||||
}
|
||||
|
||||
public void stopAll() {
|
||||
List<DocDbContainerHandle> handles = new ArrayList<>(activeContainers.values());
|
||||
if (!handles.isEmpty()) {
|
||||
LOG.infov("Stopping {0} DocumentDB container(s) on shutdown", handles.size());
|
||||
}
|
||||
for (DocDbContainerHandle handle : handles) {
|
||||
stop(handle);
|
||||
}
|
||||
}
|
||||
|
||||
private static void waitForBackendReady(String clusterId, String host, int port) {
|
||||
long deadline = System.currentTimeMillis() + BACKEND_READY_DEADLINE_MS;
|
||||
int attempt = 0;
|
||||
while (System.currentTimeMillis() < deadline) {
|
||||
attempt++;
|
||||
try (Socket s = new Socket()) {
|
||||
s.connect(new InetSocketAddress(host, port), BACKEND_PROBE_CONNECT_MS);
|
||||
if (attempt > 1) {
|
||||
LOG.infov("MongoDB backend ready for cluster {0} after {1} probe attempt(s)",
|
||||
clusterId, attempt);
|
||||
}
|
||||
return;
|
||||
} catch (IOException e) {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debugv("MongoDB probe for cluster {0} attempt {1}: {2}",
|
||||
clusterId, attempt, e.getMessage());
|
||||
}
|
||||
}
|
||||
try {
|
||||
Thread.sleep(BACKEND_READY_RETRY_MS);
|
||||
} catch (InterruptedException ie) {
|
||||
Thread.currentThread().interrupt();
|
||||
throw new RuntimeException(
|
||||
"Interrupted while waiting for MongoDB backend " + clusterId, ie);
|
||||
}
|
||||
}
|
||||
throw new RuntimeException(
|
||||
"MongoDB backend for cluster " + clusterId + " did not become ready on "
|
||||
+ host + ":" + port + " within " + BACKEND_READY_DEADLINE_MS + "ms");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package io.github.hectorvent.floci.services.docdb.model;
|
||||
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@RegisterForReflection
|
||||
public class DocDbCluster {
|
||||
private String masterUsername;
|
||||
|
||||
private String dbClusterIdentifier;
|
||||
private String status;
|
||||
private String engineVersion;
|
||||
private String endpoint;
|
||||
private int port;
|
||||
private String readerEndpoint;
|
||||
private boolean iamDatabaseAuthenticationEnabled;
|
||||
private String dbClusterArn;
|
||||
private String dbClusterResourceId;
|
||||
private List<String> dbClusterMembers = new ArrayList<>();
|
||||
private Instant createdAt;
|
||||
|
||||
// Docker / proxy runtime fields — persisted so cleanup works across restarts
|
||||
private String containerId;
|
||||
private String containerHost;
|
||||
private int containerPort;
|
||||
|
||||
public DocDbCluster (){}
|
||||
|
||||
public String getMasterUsername(){return masterUsername;}
|
||||
public void setMasterUsername(String masterUsername){this.masterUsername = masterUsername;}
|
||||
|
||||
public String getDbClusterIdentifier() { return dbClusterIdentifier; }
|
||||
public void setDbClusterIdentifier(String dbClusterIdentifier) { this.dbClusterIdentifier = dbClusterIdentifier; }
|
||||
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
|
||||
public String getEngineVersion() { return engineVersion; }
|
||||
public void setEngineVersion(String engineVersion) { this.engineVersion = engineVersion; }
|
||||
|
||||
public String getEndpoint() { return endpoint; }
|
||||
public void setEndpoint(String endpoint) { this.endpoint = endpoint; }
|
||||
|
||||
public int getPort() { return port; }
|
||||
public void setPort(int port) { this.port = port; }
|
||||
|
||||
public String getReaderEndpoint() { return readerEndpoint; }
|
||||
public void setReaderEndpoint(String readerEndpoint) { this.readerEndpoint = readerEndpoint; }
|
||||
|
||||
public boolean isIamDatabaseAuthenticationEnabled() { return iamDatabaseAuthenticationEnabled; }
|
||||
public void setIamDatabaseAuthenticationEnabled(boolean iamDatabaseAuthenticationEnabled) {
|
||||
this.iamDatabaseAuthenticationEnabled = iamDatabaseAuthenticationEnabled;
|
||||
}
|
||||
|
||||
public String getDbClusterArn() { return dbClusterArn; }
|
||||
public void setDbClusterArn(String dbClusterArn) { this.dbClusterArn = dbClusterArn; }
|
||||
|
||||
public String getDbClusterResourceId() { return dbClusterResourceId; }
|
||||
public void setDbClusterResourceId(String dbClusterResourceId) { this.dbClusterResourceId = dbClusterResourceId; }
|
||||
|
||||
public List<String> getDbClusterMembers() { return dbClusterMembers; }
|
||||
public void setDbClusterMembers(List<String> dbClusterMembers) {
|
||||
this.dbClusterMembers = dbClusterMembers != null ? new ArrayList<>(dbClusterMembers) : new ArrayList<>();
|
||||
}
|
||||
|
||||
public Instant getCreatedAt() { return createdAt; }
|
||||
public void setCreatedAt(Instant createdAt) { this.createdAt = createdAt; }
|
||||
|
||||
public String getContainerId() { return containerId; }
|
||||
public void setContainerId(String containerId) { this.containerId = containerId; }
|
||||
|
||||
public String getContainerHost() { return containerHost; }
|
||||
public void setContainerHost(String containerHost) { this.containerHost = containerHost; }
|
||||
|
||||
public int getContainerPort() { return containerPort; }
|
||||
public void setContainerPort(int containerPort) { this.containerPort = containerPort; }
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package io.github.hectorvent.floci.services.docdb.model;
|
||||
import io.quarkus.runtime.annotations.RegisterForReflection;
|
||||
|
||||
import java.time.Instant;
|
||||
@RegisterForReflection
|
||||
public class DocDbInstance {
|
||||
|
||||
private String dbInstanceIdentifier;
|
||||
private String dbClusterIdentifier;
|
||||
private String dbInstanceClass;
|
||||
private String engineVersion;
|
||||
private String status;
|
||||
private String endpoint;
|
||||
private int port;
|
||||
private boolean iamDatabaseAuthenticationEnabled;
|
||||
private String dbInstanceArn;
|
||||
private String dbiResourceId;
|
||||
private Instant createdAt;
|
||||
|
||||
public DocDbInstance(){}
|
||||
|
||||
public String getDbInstanceIdentifier() { return dbInstanceIdentifier; }
|
||||
public void setDbInstanceIdentifier(String dbInstanceIdentifier) { this.dbInstanceIdentifier = dbInstanceIdentifier; }
|
||||
|
||||
public String getDbClusterIdentifier() { return dbClusterIdentifier; }
|
||||
public void setDbClusterIdentifier(String dbClusterIdentifier) { this.dbClusterIdentifier = dbClusterIdentifier; }
|
||||
|
||||
public String getDbInstanceClass() { return dbInstanceClass; }
|
||||
public void setDbInstanceClass(String dbInstanceClass) { this.dbInstanceClass = dbInstanceClass; }
|
||||
|
||||
public String getEngineVersion() { return engineVersion; }
|
||||
public void setEngineVersion(String engineVersion) { this.engineVersion = engineVersion; }
|
||||
|
||||
public String getStatus() { return status; }
|
||||
public void setStatus(String status) { this.status = status; }
|
||||
|
||||
public String getEndpoint() { return endpoint; }
|
||||
public void setEndpoint(String endpoint) { this.endpoint = endpoint; }
|
||||
|
||||
public int getPort() { return port; }
|
||||
public void setPort(int port) { this.port = port; }
|
||||
|
||||
public boolean isIamDatabaseAuthenticationEnabled() { return iamDatabaseAuthenticationEnabled; }
|
||||
public void setIamDatabaseAuthenticationEnabled(boolean iamDatabaseAuthenticationEnabled) {
|
||||
this.iamDatabaseAuthenticationEnabled = iamDatabaseAuthenticationEnabled;
|
||||
}
|
||||
|
||||
public String getDbInstanceArn() { return dbInstanceArn; }
|
||||
public void setDbInstanceArn(String dbInstanceArn) { this.dbInstanceArn = dbInstanceArn; }
|
||||
|
||||
public String getDbiResourceId() { return dbiResourceId; }
|
||||
public void setDbiResourceId(String dbiResourceId) { this.dbiResourceId = dbiResourceId; }
|
||||
|
||||
public Instant getCreatedAt() { return createdAt; }
|
||||
public void setCreatedAt(Instant createdAt) { this.createdAt = createdAt; }
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user