Class AuroraPostgresClusterEngineProps
Creation properties of the Aurora PostgreSQL database cluster engine.
Inheritance
System.Object
AuroraPostgresClusterEngineProps
Implements
Namespace: Amazon.CDK.AWS.RDS
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class AuroraPostgresClusterEngineProps : Object, IAuroraPostgresClusterEngineProps
Syntax (vb)
Public Class AuroraPostgresClusterEngineProps
Inherits Object
Implements IAuroraPostgresClusterEngineProps
Remarks
Used in DatabaseClusterEngine.auroraPostgres
.
ExampleMetadata: infused
Examples
// Build a data source for AppSync to access the database.
GraphqlApi api;
// Create username and password secret for DB Cluster
var secret = new DatabaseSecret(this, "AuroraSecret", new DatabaseSecretProps {
Username = "clusteradmin"
});
// The VPC to place the cluster in
var vpc = new Vpc(this, "AuroraVpc");
// Create the serverless cluster, provide all values needed to customise the database.
var cluster = new DatabaseCluster(this, "AuroraClusterV2", new DatabaseClusterProps {
Engine = DatabaseClusterEngine.AuroraPostgres(new AuroraPostgresClusterEngineProps { Version = AuroraPostgresEngineVersion.VER_15_5 }),
Credentials = new Dictionary<string, string> { { "username", "clusteradmin" } },
ClusterIdentifier = "db-endpoint-test",
Writer = ClusterInstance.ServerlessV2("writer"),
ServerlessV2MinCapacity = 2,
ServerlessV2MaxCapacity = 10,
Vpc = vpc,
DefaultDatabaseName = "demos",
EnableDataApi = true
});
var rdsDS = api.AddRdsDataSourceV2("rds", cluster, secret, "demos");
// Set up a resolver for an RDS query.
rdsDS.CreateResolver("QueryGetDemosRdsResolver", new BaseResolverProps {
TypeName = "Query",
FieldName = "getDemosRds",
RequestMappingTemplate = MappingTemplate.FromString(@"
{
""version"": ""2018-05-29"",
""statements"": [
""SELECT * FROM demos""
]
}
"),
ResponseMappingTemplate = MappingTemplate.FromString(@"
$utils.toJson($utils.rds.toJsonObject($ctx.result)[0])
")
});
// Set up a resolver for an RDS mutation.
rdsDS.CreateResolver("MutationAddDemoRdsResolver", new BaseResolverProps {
TypeName = "Mutation",
FieldName = "addDemoRds",
RequestMappingTemplate = MappingTemplate.FromString(@"
{
""version"": ""2018-05-29"",
""statements"": [
""INSERT INTO demos VALUES (:id, :version)"",
""SELECT * WHERE id = :id""
],
""variableMap"": {
"":id"": $util.toJson($util.autoId()),
"":version"": $util.toJson($ctx.args.version)
}
}
"),
ResponseMappingTemplate = MappingTemplate.FromString(@"
$utils.toJson($utils.rds.toJsonObject($ctx.result)[1][0])
")
});
Synopsis
Constructors
AuroraPostgresClusterEngineProps() |
Properties
Version | The version of the Aurora PostgreSQL cluster engine. |
Constructors
AuroraPostgresClusterEngineProps()
public AuroraPostgresClusterEngineProps()
Properties
Version
The version of the Aurora PostgreSQL cluster engine.
public AuroraPostgresEngineVersion Version { get; set; }
Property Value