-
Notifications
You must be signed in to change notification settings - Fork 17
/
AuroraPostgresClusterEngineProps.go
80 lines (77 loc) · 2.98 KB
/
AuroraPostgresClusterEngineProps.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package awsrds
// Creation properties of the Aurora PostgreSQL database cluster engine.
//
// Used in `DatabaseClusterEngine.auroraPostgres`.
//
// Example:
// // Build a data source for AppSync to access the database.
// var api graphqlApi
// // Create username and password secret for DB Cluster
// secret := rds.NewDatabaseSecret(this, jsii.String("AuroraSecret"), &DatabaseSecretProps{
// Username: jsii.String("clusteradmin"),
// })
//
// // The VPC to place the cluster in
// vpc := ec2.NewVpc(this, jsii.String("AuroraVpc"))
//
// // Create the serverless cluster, provide all values needed to customise the database.
// cluster := rds.NewDatabaseCluster(this, jsii.String("AuroraClusterV2"), &DatabaseClusterProps{
// Engine: rds.DatabaseClusterEngine_AuroraPostgres(&AuroraPostgresClusterEngineProps{
// Version: rds.AuroraPostgresEngineVersion_VER_15_5(),
// }),
// Credentials: map[string]*string{
// "username": jsii.String("clusteradmin"),
// },
// ClusterIdentifier: jsii.String("db-endpoint-test"),
// Writer: rds.ClusterInstance_ServerlessV2(jsii.String("writer")),
// ServerlessV2MinCapacity: jsii.Number(2),
// ServerlessV2MaxCapacity: jsii.Number(10),
// Vpc: Vpc,
// DefaultDatabaseName: jsii.String("demos"),
// EnableDataApi: jsii.Boolean(true),
// })
// rdsDS := api.AddRdsDataSourceV2(jsii.String("rds"), cluster, secret, jsii.String("demos"))
//
// // Set up a resolver for an RDS query.
// rdsDS.CreateResolver(jsii.String("QueryGetDemosRdsResolver"), &BaseResolverProps{
// TypeName: jsii.String("Query"),
// FieldName: jsii.String("getDemosRds"),
// RequestMappingTemplate: appsync.MappingTemplate_FromString(jsii.String(`
// {
// "version": "2018-05-29",
// "statements": [
// "SELECT * FROM demos"
// ]
// }
// `)),
// ResponseMappingTemplate: appsync.MappingTemplate_*FromString(jsii.String(`
// $utils.toJson($utils.rds.toJsonObject($ctx.result)[0])
// `)),
// })
//
// // Set up a resolver for an RDS mutation.
// rdsDS.CreateResolver(jsii.String("MutationAddDemoRdsResolver"), &BaseResolverProps{
// TypeName: jsii.String("Mutation"),
// FieldName: jsii.String("addDemoRds"),
// RequestMappingTemplate: appsync.MappingTemplate_*FromString(jsii.String(`
// {
// "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: appsync.MappingTemplate_*FromString(jsii.String(`
// $utils.toJson($utils.rds.toJsonObject($ctx.result)[1][0])
// `)),
// })
//
type AuroraPostgresClusterEngineProps struct {
// The version of the Aurora PostgreSQL cluster engine.
Version AuroraPostgresEngineVersion `field:"required" json:"version" yaml:"version"`
}