Interface AuroraPostgresClusterEngineProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
AuroraPostgresClusterEngineProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-11-06T23:25:15.572Z")
@Stability(Stable)
public interface AuroraPostgresClusterEngineProps
extends software.amazon.jsii.JsiiSerializable
Creation properties of the Aurora PostgreSQL database cluster engine.
Used in DatabaseClusterEngine.auroraPostgres.
Example:
// Build a data source for AppSync to access the database.
GraphqlApi api;
// Create username and password secret for DB Cluster
DatabaseSecret secret = DatabaseSecret.Builder.create(this, "AuroraSecret")
.username("clusteradmin")
.build();
// The VPC to place the cluster in
Vpc vpc = new Vpc(this, "AuroraVpc");
// Create the serverless cluster, provide all values needed to customise the database.
DatabaseCluster cluster = DatabaseCluster.Builder.create(this, "AuroraClusterV2")
.engine(DatabaseClusterEngine.auroraPostgres(AuroraPostgresClusterEngineProps.builder().version(AuroraPostgresEngineVersion.VER_15_5).build()))
.credentials(Map.of("username", "clusteradmin"))
.clusterIdentifier("db-endpoint-test")
.writer(ClusterInstance.serverlessV2("writer"))
.serverlessV2MinCapacity(2)
.serverlessV2MaxCapacity(10)
.vpc(vpc)
.defaultDatabaseName("demos")
.enableDataApi(true)
.build();
RdsDataSource rdsDS = api.addRdsDataSourceV2("rds", cluster, secret, "demos");
// Set up a resolver for an RDS query.
rdsDS.createResolver("QueryGetDemosRdsResolver", BaseResolverProps.builder()
.typeName("Query")
.fieldName("getDemosRds")
.requestMappingTemplate(MappingTemplate.fromString("\n {\n \"version\": \"2018-05-29\",\n \"statements\": [\n \"SELECT * FROM demos\"\n ]\n }\n "))
.responseMappingTemplate(MappingTemplate.fromString("\n $utils.toJson($utils.rds.toJsonObject($ctx.result)[0])\n "))
.build());
// Set up a resolver for an RDS mutation.
rdsDS.createResolver("MutationAddDemoRdsResolver", BaseResolverProps.builder()
.typeName("Mutation")
.fieldName("addDemoRds")
.requestMappingTemplate(MappingTemplate.fromString("\n {\n \"version\": \"2018-05-29\",\n \"statements\": [\n \"INSERT INTO demos VALUES (:id, :version)\",\n \"SELECT * WHERE id = :id\"\n ],\n \"variableMap\": {\n \":id\": $util.toJson($util.autoId()),\n \":version\": $util.toJson($ctx.args.version)\n }\n }\n "))
.responseMappingTemplate(MappingTemplate.fromString("\n $utils.toJson($utils.rds.toJsonObject($ctx.result)[1][0])\n "))
.build());
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forAuroraPostgresClusterEnginePropsstatic final classAn implementation forAuroraPostgresClusterEngineProps -
Method Summary
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getVersion
The version of the Aurora PostgreSQL cluster engine. -
builder
-