1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package rds
4
5import (
6	"context"
7	"fmt"
8	awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
9	"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
10	presignedurlcust "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url"
11	"github.com/aws/aws-sdk-go-v2/service/rds/types"
12	"github.com/aws/smithy-go/middleware"
13	smithyhttp "github.com/aws/smithy-go/transport/http"
14)
15
16// Creates a new DB instance that acts as a read replica for an existing source DB
17// instance. You can create a read replica for a DB instance running MySQL,
18// MariaDB, Oracle, PostgreSQL, or SQL Server. For more information, see Working
19// with Read Replicas
20// (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReadRepl.html) in
21// the Amazon RDS User Guide. Amazon Aurora doesn't support this action. Call the
22// CreateDBInstance action to create a DB instance for an Aurora DB cluster. All
23// read replica DB instances are created with backups disabled. All other DB
24// instance attributes (including DB security groups and DB parameter groups) are
25// inherited from the source DB instance, except as specified. Your source DB
26// instance must have backup retention enabled.
27func (c *Client) CreateDBInstanceReadReplica(ctx context.Context, params *CreateDBInstanceReadReplicaInput, optFns ...func(*Options)) (*CreateDBInstanceReadReplicaOutput, error) {
28	if params == nil {
29		params = &CreateDBInstanceReadReplicaInput{}
30	}
31
32	result, metadata, err := c.invokeOperation(ctx, "CreateDBInstanceReadReplica", params, optFns, addOperationCreateDBInstanceReadReplicaMiddlewares)
33	if err != nil {
34		return nil, err
35	}
36
37	out := result.(*CreateDBInstanceReadReplicaOutput)
38	out.ResultMetadata = metadata
39	return out, nil
40}
41
42type CreateDBInstanceReadReplicaInput struct {
43
44	// The DB instance identifier of the read replica. This identifier is the unique
45	// key that identifies a DB instance. This parameter is stored as a lowercase
46	// string.
47	//
48	// This member is required.
49	DBInstanceIdentifier *string
50
51	// The identifier of the DB instance that will act as the source for the read
52	// replica. Each DB instance can have up to five read replicas. Constraints:
53	//
54	// *
55	// Must be the identifier of an existing MySQL, MariaDB, Oracle, PostgreSQL, or SQL
56	// Server DB instance.
57	//
58	// * Can specify a DB instance that is a MySQL read replica
59	// only if the source is running MySQL 5.6 or later.
60	//
61	// * For the limitations of
62	// Oracle read replicas, see Read Replica Limitations with Oracle
63	// (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/oracle-read-replicas.html)
64	// in the Amazon RDS User Guide.
65	//
66	// * For the limitations of SQL Server read
67	// replicas, see Read Replica Limitations with Microsoft SQL Server
68	// (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/SQLServer.ReadReplicas.Limitations.html)
69	// in the Amazon RDS User Guide.
70	//
71	// * Can specify a PostgreSQL DB instance only if
72	// the source is running PostgreSQL 9.3.5 or later (9.4.7 and higher for
73	// cross-region replication).
74	//
75	// * The specified DB instance must have automatic
76	// backups enabled, that is, its backup retention period must be greater than 0.
77	//
78	// *
79	// If the source DB instance is in the same AWS Region as the read replica, specify
80	// a valid DB instance identifier.
81	//
82	// * If the source DB instance is in a different
83	// AWS Region from the read replica, specify a valid DB instance ARN. For more
84	// information, see Constructing an ARN for Amazon RDS
85	// (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.ARN.html#USER_Tagging.ARN.Constructing)
86	// in the Amazon RDS User Guide. This doesn't apply to SQL Server, which doesn't
87	// support cross-region replicas.
88	//
89	// This member is required.
90	SourceDBInstanceIdentifier *string
91
92	// A value that indicates whether minor engine upgrades are applied automatically
93	// to the read replica during the maintenance window. Default: Inherits from the
94	// source DB instance
95	AutoMinorVersionUpgrade *bool
96
97	// The Availability Zone (AZ) where the read replica will be created. Default: A
98	// random, system-chosen Availability Zone in the endpoint's AWS Region. Example:
99	// us-east-1d
100	AvailabilityZone *string
101
102	// A value that indicates whether to copy all tags from the read replica to
103	// snapshots of the read replica. By default, tags are not copied.
104	CopyTagsToSnapshot *bool
105
106	// The compute and memory capacity of the read replica, for example, db.m4.large.
107	// Not all DB instance classes are available in all AWS Regions, or for all
108	// database engines. For the full list of DB instance classes, and availability for
109	// your engine, see DB Instance Class
110	// (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html)
111	// in the Amazon RDS User Guide. Default: Inherits from the source DB instance.
112	DBInstanceClass *string
113
114	// The name of the DB parameter group to associate with this DB instance. If you do
115	// not specify a value for DBParameterGroupName, then Amazon RDS uses the
116	// DBParameterGroup of source DB instance for a same region read replica, or the
117	// default DBParameterGroup for the specified DB engine for a cross region read
118	// replica. Currently, specifying a parameter group for this operation is only
119	// supported for Oracle DB instances. Constraints:
120	//
121	// * Must be 1 to 255 letters,
122	// numbers, or hyphens.
123	//
124	// * First character must be a letter
125	//
126	// * Can't end with a
127	// hyphen or contain two consecutive hyphens
128	DBParameterGroupName *string
129
130	// Specifies a DB subnet group for the DB instance. The new DB instance is created
131	// in the VPC associated with the DB subnet group. If no DB subnet group is
132	// specified, then the new DB instance isn't created in a VPC. Constraints:
133	//
134	// * Can
135	// only be specified if the source DB instance identifier specifies a DB instance
136	// in another AWS Region.
137	//
138	// * If supplied, must match the name of an existing
139	// DBSubnetGroup.
140	//
141	// * The specified DB subnet group must be in the same AWS Region
142	// in which the operation is running.
143	//
144	// * All read replicas in one AWS Region that
145	// are created from the same source DB instance must either:>
146	//
147	// * Specify DB subnet
148	// groups from the same VPC. All these read replicas are created in the same
149	// VPC.
150	//
151	// * Not specify a DB subnet group. All these read replicas are created
152	// outside of any VPC.
153	//
154	// Example: mySubnetgroup
155	DBSubnetGroupName *string
156
157	// A value that indicates whether the DB instance has deletion protection enabled.
158	// The database can't be deleted when deletion protection is enabled. By default,
159	// deletion protection is disabled. For more information, see  Deleting a DB
160	// Instance
161	// (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DeleteInstance.html).
162	DeletionProtection *bool
163
164	// The Active Directory directory ID to create the DB instance in. Currently, only
165	// MySQL, Microsoft SQL Server, Oracle, and PostgreSQL DB instances can be created
166	// in an Active Directory Domain. For more information, see  Kerberos
167	// Authentication
168	// (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/kerberos-authentication.html)
169	// in the Amazon RDS User Guide.
170	Domain *string
171
172	// Specify the name of the IAM role to be used when making API calls to the
173	// Directory Service.
174	DomainIAMRoleName *string
175
176	// The list of logs that the new DB instance is to export to CloudWatch Logs. The
177	// values in the list depend on the DB engine being used. For more information, see
178	// Publishing Database Logs to Amazon CloudWatch Logs
179	// (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch)
180	// in the Amazon RDS User Guide.
181	EnableCloudwatchLogsExports []string
182
183	// A value that indicates whether to enable mapping of AWS Identity and Access
184	// Management (IAM) accounts to database accounts. By default, mapping is disabled.
185	// For more information about IAM database authentication, see  IAM Database
186	// Authentication for MySQL and PostgreSQL
187	// (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.IAMDBAuth.html)
188	// in the Amazon RDS User Guide.
189	EnableIAMDatabaseAuthentication *bool
190
191	// A value that indicates whether to enable Performance Insights for the read
192	// replica. For more information, see Using Amazon Performance Insights
193	// (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PerfInsights.html)
194	// in the Amazon RDS User Guide.
195	EnablePerformanceInsights *bool
196
197	// The amount of Provisioned IOPS (input/output operations per second) to be
198	// initially allocated for the DB instance.
199	Iops *int32
200
201	// The AWS KMS key identifier for an encrypted read replica. The AWS KMS key
202	// identifier is the key ARN, key ID, alias ARN, or alias name for the AWS KMS CMK.
203	// If you create an encrypted read replica in the same AWS Region as the source DB
204	// instance, then do not specify a value for this parameter. A read replica in the
205	// same Region is always encrypted with the same AWS KMS CMK as the source DB
206	// instance. If you create an encrypted read replica in a different AWS Region,
207	// then you must specify a AWS KMS key identifier for the destination AWS Region.
208	// AWS KMS CMKs are specific to the AWS Region that they are created in, and you
209	// can't use CMKs from one AWS Region in another AWS Region. You can't create an
210	// encrypted read replica from an unencrypted DB instance.
211	KmsKeyId *string
212
213	// The upper limit to which Amazon RDS can automatically scale the storage of the
214	// DB instance. For more information about this setting, including limitations that
215	// apply to it, see  Managing capacity automatically with Amazon RDS storage
216	// autoscaling
217	// (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_PIOPS.StorageTypes.html#USER_PIOPS.Autoscaling)
218	// in the Amazon RDS User Guide.
219	MaxAllocatedStorage *int32
220
221	// The interval, in seconds, between points when Enhanced Monitoring metrics are
222	// collected for the read replica. To disable collecting Enhanced Monitoring
223	// metrics, specify 0. The default is 0. If MonitoringRoleArn is specified, then
224	// you must also set MonitoringInterval to a value other than 0. Valid Values: 0,
225	// 1, 5, 10, 15, 30, 60
226	MonitoringInterval *int32
227
228	// The ARN for the IAM role that permits RDS to send enhanced monitoring metrics to
229	// Amazon CloudWatch Logs. For example, arn:aws:iam:123456789012:role/emaccess. For
230	// information on creating a monitoring role, go to To create an IAM role for
231	// Amazon RDS Enhanced Monitoring
232	// (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Monitoring.html#USER_Monitoring.OS.IAMRole)
233	// in the Amazon RDS User Guide. If MonitoringInterval is set to a value other than
234	// 0, then you must supply a MonitoringRoleArn value.
235	MonitoringRoleArn *string
236
237	// A value that indicates whether the read replica is in a Multi-AZ deployment. You
238	// can create a read replica as a Multi-AZ DB instance. RDS creates a standby of
239	// your replica in another Availability Zone for failover support for the replica.
240	// Creating your read replica as a Multi-AZ DB instance is independent of whether
241	// the source database is a Multi-AZ DB instance.
242	MultiAZ *bool
243
244	// The option group the DB instance is associated with. If omitted, the option
245	// group associated with the source instance is used. For SQL Server, you must use
246	// the option group associated with the source instance.
247	OptionGroupName *string
248
249	// The AWS KMS key identifier for encryption of Performance Insights data. The AWS
250	// KMS key identifier is the key ARN, key ID, alias ARN, or alias name for the AWS
251	// KMS customer master key (CMK). If you do not specify a value for
252	// PerformanceInsightsKMSKeyId, then Amazon RDS uses your default CMK. There is a
253	// default CMK for your AWS account. Your AWS account has a different default CMK
254	// for each AWS Region.
255	PerformanceInsightsKMSKeyId *string
256
257	// The amount of time, in days, to retain Performance Insights data. Valid values
258	// are 7 or 731 (2 years).
259	PerformanceInsightsRetentionPeriod *int32
260
261	// The port number that the DB instance uses for connections. Default: Inherits
262	// from the source DB instance Valid Values: 1150-65535
263	Port *int32
264
265	// The URL that contains a Signature Version 4 signed request for the
266	// CreateDBInstanceReadReplica API action in the source AWS Region that contains
267	// the source DB instance. You must specify this parameter when you create an
268	// encrypted read replica from another AWS Region by using the Amazon RDS API.
269	// Don't specify PreSignedUrl when you are creating an encrypted read replica in
270	// the same AWS Region. The presigned URL must be a valid request for the
271	// CreateDBInstanceReadReplica API action that can be executed in the source AWS
272	// Region that contains the encrypted source DB instance. The presigned URL request
273	// must contain the following parameter values:
274	//
275	// * DestinationRegion - The AWS
276	// Region that the encrypted read replica is created in. This AWS Region is the
277	// same one where the CreateDBInstanceReadReplica action is called that contains
278	// this presigned URL. For example, if you create an encrypted DB instance in the
279	// us-west-1 AWS Region, from a source DB instance in the us-east-2 AWS Region,
280	// then you call the CreateDBInstanceReadReplica action in the us-east-1 AWS Region
281	// and provide a presigned URL that contains a call to the
282	// CreateDBInstanceReadReplica action in the us-west-2 AWS Region. For this
283	// example, the DestinationRegion in the presigned URL must be set to the us-east-1
284	// AWS Region.
285	//
286	// * KmsKeyId - The AWS KMS key identifier for the key to use to
287	// encrypt the read replica in the destination AWS Region. This is the same
288	// identifier for both the CreateDBInstanceReadReplica action that is called in the
289	// destination AWS Region, and the action contained in the presigned URL.
290	//
291	// *
292	// SourceDBInstanceIdentifier - The DB instance identifier for the encrypted DB
293	// instance to be replicated. This identifier must be in the Amazon Resource Name
294	// (ARN) format for the source AWS Region. For example, if you are creating an
295	// encrypted read replica from a DB instance in the us-west-2 AWS Region, then your
296	// SourceDBInstanceIdentifier looks like the following example:
297	// arn:aws:rds:us-west-2:123456789012:instance:mysql-instance1-20161115.
298	//
299	// To learn
300	// how to generate a Signature Version 4 signed request, see Authenticating
301	// Requests: Using Query Parameters (AWS Signature Version 4)
302	// (https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html)
303	// and Signature Version 4 Signing Process
304	// (https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). If you
305	// are using an AWS SDK tool or the AWS CLI, you can specify SourceRegion (or
306	// --source-region for the AWS CLI) instead of specifying PreSignedUrl manually.
307	// Specifying SourceRegion autogenerates a presigned URL that is a valid request
308	// for the operation that can be executed in the source AWS Region. SourceRegion
309	// isn't supported for SQL Server, because SQL Server on Amazon RDS doesn't support
310	// cross-region read replicas.
311	PreSignedUrl *string
312
313	// The number of CPU cores and the number of threads per core for the DB instance
314	// class of the DB instance.
315	ProcessorFeatures []types.ProcessorFeature
316
317	// A value that indicates whether the DB instance is publicly accessible. When the
318	// DB instance is publicly accessible, its DNS endpoint resolves to the private IP
319	// address from within the DB instance's VPC, and to the public IP address from
320	// outside of the DB instance's VPC. Access to the DB instance is ultimately
321	// controlled by the security group it uses, and that public access is not
322	// permitted if the security group assigned to the DB instance doesn't permit it.
323	// When the DB instance isn't publicly accessible, it is an internal DB instance
324	// with a DNS name that resolves to a private IP address. For more information, see
325	// CreateDBInstance.
326	PubliclyAccessible *bool
327
328	// The open mode of the replica database: mounted or read-only. This parameter is
329	// only supported for Oracle DB instances. Mounted DB replicas are included in
330	// Oracle Enterprise Edition. The main use case for mounted replicas is
331	// cross-Region disaster recovery. The primary database doesn't use Active Data
332	// Guard to transmit information to the mounted replica. Because it doesn't accept
333	// user connections, a mounted replica can't serve a read-only workload. You can
334	// create a combination of mounted and read-only DB replicas for the same primary
335	// DB instance. For more information, see Working with Oracle Read Replicas for
336	// Amazon RDS
337	// (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/oracle-read-replicas.html)
338	// in the Amazon RDS User Guide.
339	ReplicaMode types.ReplicaMode
340
341	// The AWS region the resource is in. The presigned URL will be created with this
342	// region, if the PresignURL member is empty set.
343	SourceRegion *string
344
345	// Specifies the storage type to be associated with the read replica. Valid values:
346	// standard | gp2 | io1 If you specify io1, you must also include a value for the
347	// Iops parameter. Default: io1 if the Iops parameter is specified, otherwise gp2
348	StorageType *string
349
350	// A list of tags. For more information, see Tagging Amazon RDS Resources
351	// (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html) in
352	// the Amazon RDS User Guide.
353	Tags []types.Tag
354
355	// A value that indicates whether the DB instance class of the DB instance uses its
356	// default processor features.
357	UseDefaultProcessorFeatures *bool
358
359	// A list of EC2 VPC security groups to associate with the read replica. Default:
360	// The default EC2 VPC security group for the DB subnet group's VPC.
361	VpcSecurityGroupIds []string
362
363	// Used by the SDK's PresignURL autofill customization to specify the region the of
364	// the client's request.
365	destinationRegion *string
366}
367
368type CreateDBInstanceReadReplicaOutput struct {
369
370	// Contains the details of an Amazon RDS DB instance. This data type is used as a
371	// response element in the DescribeDBInstances action.
372	DBInstance *types.DBInstance
373
374	// Metadata pertaining to the operation's result.
375	ResultMetadata middleware.Metadata
376}
377
378func addOperationCreateDBInstanceReadReplicaMiddlewares(stack *middleware.Stack, options Options) (err error) {
379	err = stack.Serialize.Add(&awsAwsquery_serializeOpCreateDBInstanceReadReplica{}, middleware.After)
380	if err != nil {
381		return err
382	}
383	err = stack.Deserialize.Add(&awsAwsquery_deserializeOpCreateDBInstanceReadReplica{}, middleware.After)
384	if err != nil {
385		return err
386	}
387	if err = addSetLoggerMiddleware(stack, options); err != nil {
388		return err
389	}
390	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
391		return err
392	}
393	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
394		return err
395	}
396	if err = addResolveEndpointMiddleware(stack, options); err != nil {
397		return err
398	}
399	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
400		return err
401	}
402	if err = addRetryMiddlewares(stack, options); err != nil {
403		return err
404	}
405	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
406		return err
407	}
408	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
409		return err
410	}
411	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
412		return err
413	}
414	if err = addClientUserAgent(stack); err != nil {
415		return err
416	}
417	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
418		return err
419	}
420	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
421		return err
422	}
423	if err = addCreateDBInstanceReadReplicaPresignURLMiddleware(stack, options); err != nil {
424		return err
425	}
426	if err = addOpCreateDBInstanceReadReplicaValidationMiddleware(stack); err != nil {
427		return err
428	}
429	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDBInstanceReadReplica(options.Region), middleware.Before); err != nil {
430		return err
431	}
432	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
433		return err
434	}
435	if err = addResponseErrorMiddleware(stack); err != nil {
436		return err
437	}
438	if err = addRequestResponseLogging(stack, options); err != nil {
439		return err
440	}
441	return nil
442}
443
444func copyCreateDBInstanceReadReplicaInputForPresign(params interface{}) (interface{}, error) {
445	input, ok := params.(*CreateDBInstanceReadReplicaInput)
446	if !ok {
447		return nil, fmt.Errorf("expect *CreateDBInstanceReadReplicaInput type, got %T", params)
448	}
449	cpy := *input
450	return &cpy, nil
451}
452func getCreateDBInstanceReadReplicaPreSignedUrl(params interface{}) (string, bool, error) {
453	input, ok := params.(*CreateDBInstanceReadReplicaInput)
454	if !ok {
455		return ``, false, fmt.Errorf("expect *CreateDBInstanceReadReplicaInput type, got %T", params)
456	}
457	if input.PreSignedUrl == nil || len(*input.PreSignedUrl) == 0 {
458		return ``, false, nil
459	}
460	return *input.PreSignedUrl, true, nil
461}
462func getCreateDBInstanceReadReplicaSourceRegion(params interface{}) (string, bool, error) {
463	input, ok := params.(*CreateDBInstanceReadReplicaInput)
464	if !ok {
465		return ``, false, fmt.Errorf("expect *CreateDBInstanceReadReplicaInput type, got %T", params)
466	}
467	if input.SourceRegion == nil || len(*input.SourceRegion) == 0 {
468		return ``, false, nil
469	}
470	return *input.SourceRegion, true, nil
471}
472func setCreateDBInstanceReadReplicaPreSignedUrl(params interface{}, value string) error {
473	input, ok := params.(*CreateDBInstanceReadReplicaInput)
474	if !ok {
475		return fmt.Errorf("expect *CreateDBInstanceReadReplicaInput type, got %T", params)
476	}
477	input.PreSignedUrl = &value
478	return nil
479}
480func setCreateDBInstanceReadReplicadestinationRegion(params interface{}, value string) error {
481	input, ok := params.(*CreateDBInstanceReadReplicaInput)
482	if !ok {
483		return fmt.Errorf("expect *CreateDBInstanceReadReplicaInput type, got %T", params)
484	}
485	input.destinationRegion = &value
486	return nil
487}
488func addCreateDBInstanceReadReplicaPresignURLMiddleware(stack *middleware.Stack, options Options) error {
489	return presignedurlcust.AddMiddleware(stack, presignedurlcust.Options{
490		Accessor: presignedurlcust.ParameterAccessor{
491			GetPresignedURL: getCreateDBInstanceReadReplicaPreSignedUrl,
492
493			GetSourceRegion: getCreateDBInstanceReadReplicaSourceRegion,
494
495			CopyInput: copyCreateDBInstanceReadReplicaInputForPresign,
496
497			SetDestinationRegion: setCreateDBInstanceReadReplicadestinationRegion,
498
499			SetPresignedURL: setCreateDBInstanceReadReplicaPreSignedUrl,
500		},
501		Presigner: &presignAutoFillCreateDBInstanceReadReplicaClient{client: NewPresignClient(New(options))},
502	})
503}
504
505type presignAutoFillCreateDBInstanceReadReplicaClient struct {
506	client *PresignClient
507}
508
509// PresignURL is a middleware accessor that satisfies URLPresigner interface.
510func (c *presignAutoFillCreateDBInstanceReadReplicaClient) PresignURL(ctx context.Context, srcRegion string, params interface{}) (*v4.PresignedHTTPRequest, error) {
511	input, ok := params.(*CreateDBInstanceReadReplicaInput)
512	if !ok {
513		return nil, fmt.Errorf("expect *CreateDBInstanceReadReplicaInput type, got %T", params)
514	}
515	optFn := func(o *Options) {
516		o.Region = srcRegion
517		o.APIOptions = append(o.APIOptions, presignedurlcust.RemoveMiddleware)
518	}
519	presignOptFn := WithPresignClientFromClientOptions(optFn)
520	return c.client.PresignCreateDBInstanceReadReplica(ctx, input, presignOptFn)
521}
522
523func newServiceMetadataMiddleware_opCreateDBInstanceReadReplica(region string) *awsmiddleware.RegisterServiceMetadata {
524	return &awsmiddleware.RegisterServiceMetadata{
525		Region:        region,
526		ServiceID:     ServiceID,
527		SigningName:   "rds",
528		OperationName: "CreateDBInstanceReadReplica",
529	}
530}
531
532// PresignCreateDBInstanceReadReplica is used to generate a presigned HTTP Request
533// which contains presigned URL, signed headers and HTTP method used.
534func (c *PresignClient) PresignCreateDBInstanceReadReplica(ctx context.Context, params *CreateDBInstanceReadReplicaInput, optFns ...func(*PresignOptions)) (*v4.PresignedHTTPRequest, error) {
535	if params == nil {
536		params = &CreateDBInstanceReadReplicaInput{}
537	}
538	options := c.options.copy()
539	for _, fn := range optFns {
540		fn(&options)
541	}
542	clientOptFns := append(options.ClientOptions, withNopHTTPClientAPIOption)
543
544	result, _, err := c.client.invokeOperation(ctx, "CreateDBInstanceReadReplica", params, clientOptFns,
545		addOperationCreateDBInstanceReadReplicaMiddlewares,
546		presignConverter(options).convertToPresignMiddleware,
547	)
548	if err != nil {
549		return nil, err
550	}
551
552	out := result.(*v4.PresignedHTTPRequest)
553	return out, nil
554}
555