-
Notifications
You must be signed in to change notification settings - Fork 17
/
DatabaseInstanceSourceProps.go
403 lines (400 loc) · 18.1 KB
/
DatabaseInstanceSourceProps.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
package awsrds
import (
"github.com/aws/aws-cdk-go/awscdk/v2"
"github.com/aws/aws-cdk-go/awscdk/v2/awsec2"
"github.com/aws/aws-cdk-go/awscdk/v2/awsiam"
"github.com/aws/aws-cdk-go/awscdk/v2/awskms"
"github.com/aws/aws-cdk-go/awscdk/v2/awslogs"
"github.com/aws/aws-cdk-go/awscdk/v2/awss3"
)
// Construction properties for a DatabaseInstanceSource.
//
// Example:
// // The code below shows an example of how to instantiate this type.
// // The values are placeholders you should change.
// import "github.com/aws/aws-cdk-go/awscdk"
// import "github.com/aws/aws-cdk-go/awscdk"
// import "github.com/aws/aws-cdk-go/awscdk"
// import "github.com/aws/aws-cdk-go/awscdk"
// import "github.com/aws/aws-cdk-go/awscdk"
// import "github.com/aws/aws-cdk-go/awscdk"
// import "github.com/aws/aws-cdk-go/awscdk"
//
// var bucket bucket
// var caCertificate caCertificate
// var instanceEngine iInstanceEngine
// var instanceType instanceType
// var key key
// var optionGroup optionGroup
// var parameterGroup parameterGroup
// var role role
// var securityGroup securityGroup
// var subnet subnet
// var subnetFilter subnetFilter
// var subnetGroup subnetGroup
// var vpc vpc
//
// databaseInstanceSourceProps := &DatabaseInstanceSourceProps{
// Engine: instanceEngine,
// Vpc: vpc,
//
// // the properties below are optional
// AllocatedStorage: jsii.Number(123),
// AllowMajorVersionUpgrade: jsii.Boolean(false),
// AutoMinorVersionUpgrade: jsii.Boolean(false),
// AvailabilityZone: jsii.String("availabilityZone"),
// BackupRetention: cdk.Duration_Minutes(jsii.Number(30)),
// CaCertificate: caCertificate,
// CloudwatchLogsExports: []*string{
// jsii.String("cloudwatchLogsExports"),
// },
// CloudwatchLogsRetention: awscdk.Aws_logs.RetentionDays_ONE_DAY,
// CloudwatchLogsRetentionRole: role,
// CopyTagsToSnapshot: jsii.Boolean(false),
// DatabaseName: jsii.String("databaseName"),
// DeleteAutomatedBackups: jsii.Boolean(false),
// DeletionProtection: jsii.Boolean(false),
// Domain: jsii.String("domain"),
// DomainRole: role,
// EnablePerformanceInsights: jsii.Boolean(false),
// IamAuthentication: jsii.Boolean(false),
// InstanceIdentifier: jsii.String("instanceIdentifier"),
// InstanceType: instanceType,
// Iops: jsii.Number(123),
// LicenseModel: awscdk.Aws_rds.LicenseModel_LICENSE_INCLUDED,
// MaxAllocatedStorage: jsii.Number(123),
// MonitoringInterval: cdk.Duration_*Minutes(jsii.Number(30)),
// MonitoringRole: role,
// MultiAz: jsii.Boolean(false),
// NetworkType: awscdk.*Aws_rds.NetworkType_IPV4,
// OptionGroup: optionGroup,
// ParameterGroup: parameterGroup,
// Parameters: map[string]*string{
// "parametersKey": jsii.String("parameters"),
// },
// PerformanceInsightEncryptionKey: key,
// PerformanceInsightRetention: awscdk.*Aws_rds.PerformanceInsightRetention_DEFAULT,
// Port: jsii.Number(123),
// PreferredBackupWindow: jsii.String("preferredBackupWindow"),
// PreferredMaintenanceWindow: jsii.String("preferredMaintenanceWindow"),
// ProcessorFeatures: &ProcessorFeatures{
// CoreCount: jsii.Number(123),
// ThreadsPerCore: jsii.Number(123),
// },
// PubliclyAccessible: jsii.Boolean(false),
// RemovalPolicy: cdk.RemovalPolicy_DESTROY,
// S3ExportBuckets: []iBucket{
// bucket,
// },
// S3ExportRole: role,
// S3ImportBuckets: []*iBucket{
// bucket,
// },
// S3ImportRole: role,
// SecurityGroups: []iSecurityGroup{
// securityGroup,
// },
// StorageThroughput: jsii.Number(123),
// StorageType: awscdk.*Aws_rds.StorageType_STANDARD,
// SubnetGroup: subnetGroup,
// Timezone: jsii.String("timezone"),
// VpcSubnets: &SubnetSelection{
// AvailabilityZones: []*string{
// jsii.String("availabilityZones"),
// },
// OnePerAz: jsii.Boolean(false),
// SubnetFilters: []*subnetFilter{
// subnetFilter,
// },
// SubnetGroupName: jsii.String("subnetGroupName"),
// Subnets: []iSubnet{
// subnet,
// },
// SubnetType: awscdk.Aws_ec2.SubnetType_PRIVATE_ISOLATED,
// },
// }
//
type DatabaseInstanceSourceProps struct {
// The VPC network where the DB subnet group should be created.
Vpc awsec2.IVpc `field:"required" json:"vpc" yaml:"vpc"`
// Indicates that minor engine upgrades are applied automatically to the DB instance during the maintenance window.
// Default: true.
//
AutoMinorVersionUpgrade *bool `field:"optional" json:"autoMinorVersionUpgrade" yaml:"autoMinorVersionUpgrade"`
// The name of the Availability Zone where the DB instance will be located.
// Default: - no preference.
//
AvailabilityZone *string `field:"optional" json:"availabilityZone" yaml:"availabilityZone"`
// The number of days during which automatic DB snapshots are retained.
//
// Set to zero to disable backups.
// When creating a read replica, you must enable automatic backups on the source
// database instance by setting the backup retention to a value other than zero.
// Default: - Duration.days(1) for source instances, disabled for read replicas
//
BackupRetention awscdk.Duration `field:"optional" json:"backupRetention" yaml:"backupRetention"`
// The identifier of the CA certificate for this DB instance.
//
// Specifying or updating this property triggers a reboot.
//
// For RDS DB engines:.
// See: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL-certificate-rotation.html
//
// Default: - RDS will choose a certificate authority.
//
CaCertificate CaCertificate `field:"optional" json:"caCertificate" yaml:"caCertificate"`
// The list of log types that need to be enabled for exporting to CloudWatch Logs.
// Default: - no log exports.
//
CloudwatchLogsExports *[]*string `field:"optional" json:"cloudwatchLogsExports" yaml:"cloudwatchLogsExports"`
// The number of days log events are kept in CloudWatch Logs.
//
// When updating
// this property, unsetting it doesn't remove the log retention policy. To
// remove the retention policy, set the value to `Infinity`.
// Default: - logs never expire.
//
CloudwatchLogsRetention awslogs.RetentionDays `field:"optional" json:"cloudwatchLogsRetention" yaml:"cloudwatchLogsRetention"`
// The IAM role for the Lambda function associated with the custom resource that sets the retention policy.
// Default: - a new role is created.
//
CloudwatchLogsRetentionRole awsiam.IRole `field:"optional" json:"cloudwatchLogsRetentionRole" yaml:"cloudwatchLogsRetentionRole"`
// Indicates whether to copy all of the user-defined tags from the DB instance to snapshots of the DB instance.
// Default: true.
//
CopyTagsToSnapshot *bool `field:"optional" json:"copyTagsToSnapshot" yaml:"copyTagsToSnapshot"`
// Indicates whether automated backups should be deleted or retained when you delete a DB instance.
// Default: true.
//
DeleteAutomatedBackups *bool `field:"optional" json:"deleteAutomatedBackups" yaml:"deleteAutomatedBackups"`
// Indicates whether the DB instance should have deletion protection enabled.
// Default: - true if ``removalPolicy`` is RETAIN, false otherwise.
//
DeletionProtection *bool `field:"optional" json:"deletionProtection" yaml:"deletionProtection"`
// The Active Directory directory ID to create the DB instance in.
// Default: - Do not join domain.
//
Domain *string `field:"optional" json:"domain" yaml:"domain"`
// The IAM role to be used when making API calls to the Directory Service.
//
// The role needs the AWS-managed policy
// AmazonRDSDirectoryServiceAccess or equivalent.
// Default: - The role will be created for you if `DatabaseInstanceNewProps#domain` is specified.
//
DomainRole awsiam.IRole `field:"optional" json:"domainRole" yaml:"domainRole"`
// Whether to enable Performance Insights for the DB instance.
// Default: - false, unless ``performanceInsightRetention`` or ``performanceInsightEncryptionKey`` is set.
//
EnablePerformanceInsights *bool `field:"optional" json:"enablePerformanceInsights" yaml:"enablePerformanceInsights"`
// Whether to enable mapping of AWS Identity and Access Management (IAM) accounts to database accounts.
// Default: false.
//
IamAuthentication *bool `field:"optional" json:"iamAuthentication" yaml:"iamAuthentication"`
// A name for the DB instance.
//
// If you specify a name, AWS CloudFormation
// converts it to lowercase.
// Default: - a CloudFormation generated name.
//
InstanceIdentifier *string `field:"optional" json:"instanceIdentifier" yaml:"instanceIdentifier"`
// The number of I/O operations per second (IOPS) that the database provisions.
//
// The value must be equal to or greater than 1000.
// Default: - no provisioned iops if storage type is not specified. For GP3: 3,000 IOPS if allocated
// storage is less than 400 GiB for MariaDB, MySQL, and PostgreSQL, less than 200 GiB for Oracle and
// less than 20 GiB for SQL Server. 12,000 IOPS otherwise (except for SQL Server where the default is
// always 3,000 IOPS).
//
Iops *float64 `field:"optional" json:"iops" yaml:"iops"`
// Upper limit to which RDS can scale the storage in GiB(Gibibyte).
// See: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PIOPS.StorageTypes.html#USER_PIOPS.Autoscaling
//
// Default: - No autoscaling of RDS instance.
//
MaxAllocatedStorage *float64 `field:"optional" json:"maxAllocatedStorage" yaml:"maxAllocatedStorage"`
// The interval, in seconds, between points when Amazon RDS collects enhanced monitoring metrics for the DB instance.
// Default: - no enhanced monitoring.
//
MonitoringInterval awscdk.Duration `field:"optional" json:"monitoringInterval" yaml:"monitoringInterval"`
// Role that will be used to manage DB instance monitoring.
// Default: - A role is automatically created for you.
//
MonitoringRole awsiam.IRole `field:"optional" json:"monitoringRole" yaml:"monitoringRole"`
// Specifies if the database instance is a multiple Availability Zone deployment.
// Default: false.
//
MultiAz *bool `field:"optional" json:"multiAz" yaml:"multiAz"`
// The network type of the DB instance.
// Default: - IPV4.
//
NetworkType NetworkType `field:"optional" json:"networkType" yaml:"networkType"`
// The option group to associate with the instance.
// Default: - no option group.
//
OptionGroup IOptionGroup `field:"optional" json:"optionGroup" yaml:"optionGroup"`
// The DB parameter group to associate with the instance.
// Default: - no parameter group.
//
ParameterGroup IParameterGroup `field:"optional" json:"parameterGroup" yaml:"parameterGroup"`
// The AWS KMS key for encryption of Performance Insights data.
// Default: - default master key.
//
PerformanceInsightEncryptionKey awskms.IKey `field:"optional" json:"performanceInsightEncryptionKey" yaml:"performanceInsightEncryptionKey"`
// The amount of time, in days, to retain Performance Insights data.
// Default: 7 this is the free tier.
//
PerformanceInsightRetention PerformanceInsightRetention `field:"optional" json:"performanceInsightRetention" yaml:"performanceInsightRetention"`
// The port for the instance.
// Default: - the default port for the chosen engine.
//
Port *float64 `field:"optional" json:"port" yaml:"port"`
// The daily time range during which automated backups are performed.
//
// Constraints:
// - Must be in the format `hh24:mi-hh24:mi`.
// - Must be in Universal Coordinated Time (UTC).
// - Must not conflict with the preferred maintenance window.
// - Must be at least 30 minutes.
// Default: - a 30-minute window selected at random from an 8-hour block of
// time for each AWS Region. To see the time blocks available, see
// https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithAutomatedBackups.html#USER_WorkingWithAutomatedBackups.BackupWindow
//
PreferredBackupWindow *string `field:"optional" json:"preferredBackupWindow" yaml:"preferredBackupWindow"`
// The weekly time range (in UTC) during which system maintenance can occur.
//
// Format: `ddd:hh24:mi-ddd:hh24:mi`
// Constraint: Minimum 30-minute window.
// Default: - a 30-minute window selected at random from an 8-hour block of
// time for each AWS Region, occurring on a random day of the week. To see
// the time blocks available, see https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Maintenance.html#Concepts.DBMaintenance
//
PreferredMaintenanceWindow *string `field:"optional" json:"preferredMaintenanceWindow" yaml:"preferredMaintenanceWindow"`
// The number of CPU cores and the number of threads per core.
// Default: - the default number of CPU cores and threads per core for the
// chosen instance class.
//
// See https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html#USER_ConfigureProcessor
//
ProcessorFeatures *ProcessorFeatures `field:"optional" json:"processorFeatures" yaml:"processorFeatures"`
// Indicates whether the DB instance is an internet-facing instance.
//
// If not specified,
// the instance's vpcSubnets will be used to determine if the instance is internet-facing
// or not.
// Default: - `true` if the instance's `vpcSubnets` is `subnetType: SubnetType.PUBLIC`, `false` otherwise
//
PubliclyAccessible *bool `field:"optional" json:"publiclyAccessible" yaml:"publiclyAccessible"`
// The CloudFormation policy to apply when the instance is removed from the stack or replaced during an update.
// Default: - RemovalPolicy.SNAPSHOT (remove the resource, but retain a snapshot of the data)
//
RemovalPolicy awscdk.RemovalPolicy `field:"optional" json:"removalPolicy" yaml:"removalPolicy"`
// S3 buckets that you want to load data into.
//
// This property must not be used if `s3ExportRole` is used.
//
// For Microsoft SQL Server:.
// See: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/oracle-s3-integration.html
//
// Default: - None.
//
S3ExportBuckets *[]awss3.IBucket `field:"optional" json:"s3ExportBuckets" yaml:"s3ExportBuckets"`
// Role that will be associated with this DB instance to enable S3 export.
//
// This property must not be used if `s3ExportBuckets` is used.
//
// For Microsoft SQL Server:.
// See: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/oracle-s3-integration.html
//
// Default: - New role is created if `s3ExportBuckets` is set, no role is defined otherwise.
//
S3ExportRole awsiam.IRole `field:"optional" json:"s3ExportRole" yaml:"s3ExportRole"`
// S3 buckets that you want to load data from.
//
// This feature is only supported by the Microsoft SQL Server, Oracle, and PostgreSQL engines.
//
// This property must not be used if `s3ImportRole` is used.
//
// For Microsoft SQL Server:.
// See: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/PostgreSQL.Procedural.Importing.html
//
// Default: - None.
//
S3ImportBuckets *[]awss3.IBucket `field:"optional" json:"s3ImportBuckets" yaml:"s3ImportBuckets"`
// Role that will be associated with this DB instance to enable S3 import.
//
// This feature is only supported by the Microsoft SQL Server, Oracle, and PostgreSQL engines.
//
// This property must not be used if `s3ImportBuckets` is used.
//
// For Microsoft SQL Server:.
// See: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/PostgreSQL.Procedural.Importing.html
//
// Default: - New role is created if `s3ImportBuckets` is set, no role is defined otherwise.
//
S3ImportRole awsiam.IRole `field:"optional" json:"s3ImportRole" yaml:"s3ImportRole"`
// The security groups to assign to the DB instance.
// Default: - a new security group is created.
//
SecurityGroups *[]awsec2.ISecurityGroup `field:"optional" json:"securityGroups" yaml:"securityGroups"`
// The storage throughput, specified in mebibytes per second (MiBps).
//
// Only applicable for GP3.
// See: https://docs.aws.amazon.com//AmazonRDS/latest/UserGuide/CHAP_Storage.html#gp3-storage
//
// Default: - 125 MiBps if allocated storage is less than 400 GiB for MariaDB, MySQL, and PostgreSQL,
// less than 200 GiB for Oracle and less than 20 GiB for SQL Server. 500 MiBps otherwise (except for
// SQL Server where the default is always 125 MiBps).
//
StorageThroughput *float64 `field:"optional" json:"storageThroughput" yaml:"storageThroughput"`
// The storage type.
//
// Storage types supported are gp2, io1, standard.
// See: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Storage.html#Concepts.Storage.GeneralSSD
//
// Default: GP2.
//
StorageType StorageType `field:"optional" json:"storageType" yaml:"storageType"`
// Existing subnet group for the instance.
// Default: - a new subnet group will be created.
//
SubnetGroup ISubnetGroup `field:"optional" json:"subnetGroup" yaml:"subnetGroup"`
// The type of subnets to add to the created DB subnet group.
// Default: - private subnets.
//
VpcSubnets *awsec2.SubnetSelection `field:"optional" json:"vpcSubnets" yaml:"vpcSubnets"`
// The database engine.
Engine IInstanceEngine `field:"required" json:"engine" yaml:"engine"`
// The allocated storage size, specified in gibibytes (GiB).
// Default: 100.
//
AllocatedStorage *float64 `field:"optional" json:"allocatedStorage" yaml:"allocatedStorage"`
// Whether to allow major version upgrades.
// Default: false.
//
AllowMajorVersionUpgrade *bool `field:"optional" json:"allowMajorVersionUpgrade" yaml:"allowMajorVersionUpgrade"`
// The name of the database.
// Default: - no name.
//
DatabaseName *string `field:"optional" json:"databaseName" yaml:"databaseName"`
// The name of the compute and memory capacity for the instance.
// Default: - m5.large (or, more specifically, db.m5.large)
//
InstanceType awsec2.InstanceType `field:"optional" json:"instanceType" yaml:"instanceType"`
// The license model.
// Default: - RDS default license model.
//
LicenseModel LicenseModel `field:"optional" json:"licenseModel" yaml:"licenseModel"`
// The parameters in the DBParameterGroup to create automatically.
//
// You can only specify parameterGroup or parameters but not both.
// You need to use a versioned engine to auto-generate a DBParameterGroup.
// Default: - None.
//
Parameters *map[string]*string `field:"optional" json:"parameters" yaml:"parameters"`
// The time zone of the instance.
//
// This is currently supported only by Microsoft Sql Server.
// Default: - RDS default timezone.
//
Timezone *string `field:"optional" json:"timezone" yaml:"timezone"`
}