1// Code generated by smithy-go-codegen DO NOT EDIT. 2 3package docdb 4 5import ( 6 "context" 7 awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" 8 "github.com/aws/aws-sdk-go-v2/aws/signer/v4" 9 "github.com/aws/aws-sdk-go-v2/service/docdb/types" 10 "github.com/aws/smithy-go/middleware" 11 smithyhttp "github.com/aws/smithy-go/transport/http" 12) 13 14// Modifies settings for an instance. You can change one or more database 15// configuration parameters by specifying these parameters and the new values in 16// the request. 17func (c *Client) ModifyDBInstance(ctx context.Context, params *ModifyDBInstanceInput, optFns ...func(*Options)) (*ModifyDBInstanceOutput, error) { 18 if params == nil { 19 params = &ModifyDBInstanceInput{} 20 } 21 22 result, metadata, err := c.invokeOperation(ctx, "ModifyDBInstance", params, optFns, addOperationModifyDBInstanceMiddlewares) 23 if err != nil { 24 return nil, err 25 } 26 27 out := result.(*ModifyDBInstanceOutput) 28 out.ResultMetadata = metadata 29 return out, nil 30} 31 32// Represents the input to ModifyDBInstance. 33type ModifyDBInstanceInput struct { 34 35 // The instance identifier. This value is stored as a lowercase string. 36 // Constraints: 37 // 38 // * Must match the identifier of an existing DBInstance. 39 // 40 // This member is required. 41 DBInstanceIdentifier *string 42 43 // Specifies whether the modifications in this request and any pending 44 // modifications are asynchronously applied as soon as possible, regardless of the 45 // PreferredMaintenanceWindow setting for the instance. If this parameter is set to 46 // false, changes to the instance are applied during the next maintenance window. 47 // Some parameter changes can cause an outage and are applied on the next reboot. 48 // Default: false 49 ApplyImmediately bool 50 51 // Indicates that minor version upgrades are applied automatically to the instance 52 // during the maintenance window. Changing this parameter doesn't result in an 53 // outage except in the following case, and the change is asynchronously applied as 54 // soon as possible. An outage results if this parameter is set to true during the 55 // maintenance window, and a newer minor version is available, and Amazon 56 // DocumentDB has enabled automatic patching for that engine version. 57 AutoMinorVersionUpgrade *bool 58 59 // Indicates the certificate that needs to be associated with the instance. 60 CACertificateIdentifier *string 61 62 // The new compute and memory capacity of the instance; for example, db.r5.large. 63 // Not all instance classes are available in all AWS Regions. If you modify the 64 // instance class, an outage occurs during the change. The change is applied during 65 // the next maintenance window, unless ApplyImmediately is specified as true for 66 // this request. Default: Uses existing setting. 67 DBInstanceClass *string 68 69 // The new instance identifier for the instance when renaming an instance. When you 70 // change the instance identifier, an instance reboot occurs immediately if you set 71 // Apply Immediately to true. It occurs during the next maintenance window if you 72 // set Apply Immediately to false. This value is stored as a lowercase string. 73 // Constraints: 74 // 75 // * Must contain from 1 to 63 letters, numbers, or hyphens. 76 // 77 // * The 78 // first character must be a letter. 79 // 80 // * Cannot end with a hyphen or contain two 81 // consecutive hyphens. 82 // 83 // Example: mydbinstance 84 NewDBInstanceIdentifier *string 85 86 // The weekly time range (in UTC) during which system maintenance can occur, which 87 // might result in an outage. Changing this parameter doesn't result in an outage 88 // except in the following situation, and the change is asynchronously applied as 89 // soon as possible. If there are pending actions that cause a reboot, and the 90 // maintenance window is changed to include the current time, changing this 91 // parameter causes a reboot of the instance. If you are moving this window to the 92 // current time, there must be at least 30 minutes between the current time and end 93 // of the window to ensure that pending changes are applied. Default: Uses existing 94 // setting. Format: ddd:hh24:mi-ddd:hh24:mi Valid days: Mon, Tue, Wed, Thu, Fri, 95 // Sat, Sun Constraints: Must be at least 30 minutes. 96 PreferredMaintenanceWindow *string 97 98 // A value that specifies the order in which an Amazon DocumentDB replica is 99 // promoted to the primary instance after a failure of the existing primary 100 // instance. Default: 1 Valid values: 0-15 101 PromotionTier *int32 102} 103 104type ModifyDBInstanceOutput struct { 105 106 // Detailed information about an instance. 107 DBInstance *types.DBInstance 108 109 // Metadata pertaining to the operation's result. 110 ResultMetadata middleware.Metadata 111} 112 113func addOperationModifyDBInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { 114 err = stack.Serialize.Add(&awsAwsquery_serializeOpModifyDBInstance{}, middleware.After) 115 if err != nil { 116 return err 117 } 118 err = stack.Deserialize.Add(&awsAwsquery_deserializeOpModifyDBInstance{}, middleware.After) 119 if err != nil { 120 return err 121 } 122 if err = addSetLoggerMiddleware(stack, options); err != nil { 123 return err 124 } 125 if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { 126 return err 127 } 128 if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { 129 return err 130 } 131 if err = addResolveEndpointMiddleware(stack, options); err != nil { 132 return err 133 } 134 if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { 135 return err 136 } 137 if err = addRetryMiddlewares(stack, options); err != nil { 138 return err 139 } 140 if err = addHTTPSignerV4Middleware(stack, options); err != nil { 141 return err 142 } 143 if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { 144 return err 145 } 146 if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { 147 return err 148 } 149 if err = addClientUserAgent(stack); err != nil { 150 return err 151 } 152 if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { 153 return err 154 } 155 if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { 156 return err 157 } 158 if err = addOpModifyDBInstanceValidationMiddleware(stack); err != nil { 159 return err 160 } 161 if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyDBInstance(options.Region), middleware.Before); err != nil { 162 return err 163 } 164 if err = addRequestIDRetrieverMiddleware(stack); err != nil { 165 return err 166 } 167 if err = addResponseErrorMiddleware(stack); err != nil { 168 return err 169 } 170 if err = addRequestResponseLogging(stack, options); err != nil { 171 return err 172 } 173 return nil 174} 175 176func newServiceMetadataMiddleware_opModifyDBInstance(region string) *awsmiddleware.RegisterServiceMetadata { 177 return &awsmiddleware.RegisterServiceMetadata{ 178 Region: region, 179 ServiceID: ServiceID, 180 SigningName: "rds", 181 OperationName: "ModifyDBInstance", 182 } 183} 184