diff --git a/.changelog/bf6a91c5048b429eaffe7bc78f6b5d55.json b/.changelog/bf6a91c5048b429eaffe7bc78f6b5d55.json new file mode 100644 index 00000000000..489703521e0 --- /dev/null +++ b/.changelog/bf6a91c5048b429eaffe7bc78f6b5d55.json @@ -0,0 +1,8 @@ +{ + "id": "bf6a91c5-048b-429e-affe-7bc78f6b5d55", + "type": "documentation", + "description": "Documentation updates to reflect service rename - AWS IAM Identity Center (successor to AWS Single Sign-On)", + "modules": [ + "service/ssoadmin" + ] +} \ No newline at end of file diff --git a/.changelog/cca3fd43432c438694c4faf907547e47.json b/.changelog/cca3fd43432c438694c4faf907547e47.json new file mode 100644 index 00000000000..60c917f61ab --- /dev/null +++ b/.changelog/cca3fd43432c438694c4faf907547e47.json @@ -0,0 +1,8 @@ +{ + "id": "cca3fd43-432c-4386-94c4-faf907547e47", + "type": "feature", + "description": "RDS for Oracle supports Oracle Data Guard switchover and read replica backups.", + "modules": [ + "service/rds" + ] +} \ No newline at end of file diff --git a/service/rds/api_op_SwitchoverReadReplica.go b/service/rds/api_op_SwitchoverReadReplica.go new file mode 100644 index 00000000000..5a23d89580b --- /dev/null +++ b/service/rds/api_op_SwitchoverReadReplica.go @@ -0,0 +1,132 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package rds + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Switches over an Oracle standby database in an Oracle Data Guard environment, +// making it the new primary database. Issue this command in the AWS Region that +// hosts the current standby database. +func (c *Client) SwitchoverReadReplica(ctx context.Context, params *SwitchoverReadReplicaInput, optFns ...func(*Options)) (*SwitchoverReadReplicaOutput, error) { + if params == nil { + params = &SwitchoverReadReplicaInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SwitchoverReadReplica", params, optFns, c.addOperationSwitchoverReadReplicaMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SwitchoverReadReplicaOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SwitchoverReadReplicaInput struct { + + // The DB instance identifier of the current standby database. This value is stored + // as a lowercase string. Constraints: + // + // * Must match the identiļ¬er of an existing + // Oracle read replica DB instance. + // + // This member is required. + DBInstanceIdentifier *string + + noSmithyDocumentSerde +} + +type SwitchoverReadReplicaOutput struct { + + // Contains the details of an Amazon RDS DB instance. This data type is used as a + // response element in the operations CreateDBInstance, + // CreateDBInstanceReadReplica, DeleteDBInstance, DescribeDBInstances, + // ModifyDBInstance, PromoteReadReplica, RebootDBInstance, + // RestoreDBInstanceFromDBSnapshot, RestoreDBInstanceFromS3, + // RestoreDBInstanceToPointInTime, StartDBInstance, and StopDBInstance. + DBInstance *types.DBInstance + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSwitchoverReadReplicaMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsquery_serializeOpSwitchoverReadReplica{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsquery_deserializeOpSwitchoverReadReplica{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpSwitchoverReadReplicaValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSwitchoverReadReplica(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSwitchoverReadReplica(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "rds", + OperationName: "SwitchoverReadReplica", + } +} diff --git a/service/rds/deserializers.go b/service/rds/deserializers.go index 9ce146ba2a5..c5fcc4cd763 100644 --- a/service/rds/deserializers.go +++ b/service/rds/deserializers.go @@ -15538,6 +15538,117 @@ func awsAwsquery_deserializeOpErrorStopDBInstanceAutomatedBackupsReplication(res } } +type awsAwsquery_deserializeOpSwitchoverReadReplica struct { +} + +func (*awsAwsquery_deserializeOpSwitchoverReadReplica) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsquery_deserializeOpSwitchoverReadReplica) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsquery_deserializeOpErrorSwitchoverReadReplica(response, &metadata) + } + output := &SwitchoverReadReplicaOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("SwitchoverReadReplicaResult") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsAwsquery_deserializeOpDocumentSwitchoverReadReplicaOutput(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsquery_deserializeOpErrorSwitchoverReadReplica(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("DBInstanceNotFound", errorCode): + return awsAwsquery_deserializeErrorDBInstanceNotFoundFault(response, errorBody) + + case strings.EqualFold("InvalidDBInstanceState", errorCode): + return awsAwsquery_deserializeErrorInvalidDBInstanceStateFault(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + func awsAwsquery_deserializeErrorAuthorizationAlreadyExistsFault(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.AuthorizationAlreadyExistsFault{} var buff [1024]byte @@ -30779,6 +30890,23 @@ func awsAwsquery_deserializeDocumentDBSnapshot(v **types.DBSnapshot, decoder smi sv.SnapshotCreateTime = ptr.Time(t) } + case strings.EqualFold("SnapshotDatabaseTime", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.SnapshotDatabaseTime = ptr.Time(t) + } + case strings.EqualFold("SnapshotTarget", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -51485,3 +51613,45 @@ func awsAwsquery_deserializeOpDocumentStopDBInstanceOutput(v **StopDBInstanceOut *v = sv return nil } + +func awsAwsquery_deserializeOpDocumentSwitchoverReadReplicaOutput(v **SwitchoverReadReplicaOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *SwitchoverReadReplicaOutput + if *v == nil { + sv = &SwitchoverReadReplicaOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBInstance", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentDBInstance(&sv.DBInstance, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} diff --git a/service/rds/generated.json b/service/rds/generated.json index 96429933e68..4b130be8b15 100644 --- a/service/rds/generated.json +++ b/service/rds/generated.json @@ -150,6 +150,7 @@ "api_op_StopDBCluster.go", "api_op_StopDBInstance.go", "api_op_StopDBInstanceAutomatedBackupsReplication.go", + "api_op_SwitchoverReadReplica.go", "deserializers.go", "doc.go", "endpoints.go", diff --git a/service/rds/serializers.go b/service/rds/serializers.go index 7b1ff3a25a5..0c0f14589d7 100644 --- a/service/rds/serializers.go +++ b/service/rds/serializers.go @@ -8716,6 +8716,70 @@ func (m *awsAwsquery_serializeOpStopDBInstanceAutomatedBackupsReplication) Handl return next.HandleSerialize(ctx, in) } + +type awsAwsquery_serializeOpSwitchoverReadReplica struct { +} + +func (*awsAwsquery_serializeOpSwitchoverReadReplica) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsquery_serializeOpSwitchoverReadReplica) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SwitchoverReadReplicaInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("SwitchoverReadReplica") + body.Key("Version").String("2014-10-31") + + if err := awsAwsquery_serializeOpDocumentSwitchoverReadReplicaInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} func awsAwsquery_serializeDocumentAttributeValueList(v []string, value query.Value) error { if len(v) == 0 { return nil @@ -15067,3 +15131,15 @@ func awsAwsquery_serializeOpDocumentStopDBInstanceInput(v *StopDBInstanceInput, return nil } + +func awsAwsquery_serializeOpDocumentSwitchoverReadReplicaInput(v *SwitchoverReadReplicaInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DBInstanceIdentifier != nil { + objectKey := object.Key("DBInstanceIdentifier") + objectKey.String(*v.DBInstanceIdentifier) + } + + return nil +} diff --git a/service/rds/types/types.go b/service/rds/types/types.go index db76a2f96c4..2c82dd89588 100644 --- a/service/rds/types/types.go +++ b/service/rds/types/types.go @@ -2046,6 +2046,16 @@ type DBSnapshot struct { // Changes for the copy when the snapshot is copied. SnapshotCreateTime *time.Time + // The timestamp of the most recent transaction applied to the database that you're + // backing up. Thus, if you restore a snapshot, SnapshotDatabaseTime is the most + // recent transaction in the restored DB instance. In contrast, + // originalSnapshotCreateTime specifies the system time that the snapshot + // completed. If you back up a read replica, you can determine the replica lag by + // comparing SnapshotDatabaseTime with originalSnapshotCreateTime. For example, if + // originalSnapshotCreateTime is two hours later than SnapshotDatabaseTime, then + // the replica lag is two hours. *** REVIEWERS 7/27: Switchover + SnapshotDatabaseTime *time.Time + // Specifies where manual snapshots are stored: Amazon Web Services Outposts or the // Amazon Web Services Region. SnapshotTarget *string diff --git a/service/rds/validators.go b/service/rds/validators.go index ba194c00e1d..a44ea0baaad 100644 --- a/service/rds/validators.go +++ b/service/rds/validators.go @@ -2590,6 +2590,26 @@ func (m *validateOpStopDBInstance) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpSwitchoverReadReplica struct { +} + +func (*validateOpSwitchoverReadReplica) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSwitchoverReadReplica) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SwitchoverReadReplicaInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSwitchoverReadReplicaInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + func addOpAddRoleToDBClusterValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAddRoleToDBCluster{}, middleware.After) } @@ -3106,6 +3126,10 @@ func addOpStopDBInstanceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStopDBInstance{}, middleware.After) } +func addOpSwitchoverReadReplicaValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSwitchoverReadReplica{}, middleware.After) +} + func validateFilter(v *types.Filter) error { if v == nil { return nil @@ -5464,3 +5488,18 @@ func validateOpStopDBInstanceInput(v *StopDBInstanceInput) error { return nil } } + +func validateOpSwitchoverReadReplicaInput(v *SwitchoverReadReplicaInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SwitchoverReadReplicaInput"} + if v.DBInstanceIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("DBInstanceIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/ssoadmin/api_op_CreateAccountAssignment.go b/service/ssoadmin/api_op_CreateAccountAssignment.go index af977bfc193..56244ff7931 100644 --- a/service/ssoadmin/api_op_CreateAccountAssignment.go +++ b/service/ssoadmin/api_op_CreateAccountAssignment.go @@ -19,7 +19,9 @@ import ( // to the IAM role created in Amazon Web Services SSO. If the permission set is // subsequently updated, the corresponding IAM policies attached to roles in your // accounts will not be updated automatically. In this case, you must call -// ProvisionPermissionSet to make these updates. +// ProvisionPermissionSet to make these updates. After a successful response, call +// DescribeAccountAssignmentCreationStatus to describe the status of an assignment +// creation request. func (c *Client) CreateAccountAssignment(ctx context.Context, params *CreateAccountAssignmentInput, optFns ...func(*Options)) (*CreateAccountAssignmentOutput, error) { if params == nil { params = &CreateAccountAssignmentInput{} diff --git a/service/ssoadmin/api_op_CreateInstanceAccessControlAttributeConfiguration.go b/service/ssoadmin/api_op_CreateInstanceAccessControlAttributeConfiguration.go index 5af7b8e0c67..56ba404ecf1 100644 --- a/service/ssoadmin/api_op_CreateInstanceAccessControlAttributeConfiguration.go +++ b/service/ssoadmin/api_op_CreateInstanceAccessControlAttributeConfiguration.go @@ -15,7 +15,9 @@ import ( // Amazon Web Services SSO instance. You can also specify new attributes to add to // your ABAC configuration during the enabling process. For more information about // ABAC, see Attribute-Based Access Control in the Amazon Web Services SSO User -// Guide. +// Guide. After a successful response, call +// DescribeInstanceAccessControlAttributeConfiguration to validate that +// InstanceAccessControlAttributeConfiguration was created. func (c *Client) CreateInstanceAccessControlAttributeConfiguration(ctx context.Context, params *CreateInstanceAccessControlAttributeConfigurationInput, optFns ...func(*Options)) (*CreateInstanceAccessControlAttributeConfigurationOutput, error) { if params == nil { params = &CreateInstanceAccessControlAttributeConfigurationInput{} diff --git a/service/ssoadmin/api_op_DeleteAccountAssignment.go b/service/ssoadmin/api_op_DeleteAccountAssignment.go index 027c6c3700a..4105f56f625 100644 --- a/service/ssoadmin/api_op_DeleteAccountAssignment.go +++ b/service/ssoadmin/api_op_DeleteAccountAssignment.go @@ -12,7 +12,9 @@ import ( ) // Deletes a principal's access from a specified Amazon Web Services account using -// a specified permission set. +// a specified permission set. After a successful response, call +// DescribeAccountAssignmentCreationStatus to describe the status of an assignment +// deletion request. func (c *Client) DeleteAccountAssignment(ctx context.Context, params *DeleteAccountAssignmentInput, optFns ...func(*Options)) (*DeleteAccountAssignmentOutput, error) { if params == nil { params = &DeleteAccountAssignmentInput{} diff --git a/service/ssoadmin/doc.go b/service/ssoadmin/doc.go index e8395f0f97a..c45b67d1e48 100644 --- a/service/ssoadmin/doc.go +++ b/service/ssoadmin/doc.go @@ -2,4 +2,30 @@ // Package ssoadmin provides the API client, operations, and parameter types for // AWS Single Sign-On Admin. +// +// Amazon Web Services Single Sign On helps you securely create, or connect, your +// workforce identities and manage their access centrally across Amazon Web +// Services accounts and applications. Amazon Web Services SSO is the recommended +// approach for workforce authentication and authorization in Amazon Web Services, +// for organizations of any size and type. Although Amazon Web Services Single +// Sign-On was renamed, the sso and identitystore API namespaces will continue to +// retain their original name for backward compatibility purposes. For more +// information, see Amazon Web Services SSO rename +// (https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html#renamed). +// This reference guide provides information on single sign-on operations which +// could be used for access management of Amazon Web Services accounts. For +// information about Amazon Web Services SSO features, see the Amazon Web Services +// SSO User Guide +// (https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html). Many +// operations in the Amazon Web Services SSO APIs rely on identifiers for users and +// groups, known as principals. For more information about how to work with +// principals and principal IDs in Amazon Web Services SSO, see the Identity Store +// API Reference +// (https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/welcome.html). +// Amazon Web Services provides SDKs that consist of libraries and sample code for +// various programming languages and platforms (Java, Ruby, .Net, iOS, Android, and +// more). The SDKs provide a convenient way to create programmatic access to Amazon +// Web Services SSO and other Amazon Web Services services. For more information +// about the Amazon Web Services SDKs, including how to download and install them, +// see Tools for Amazon Web Services (http://aws.amazon.com/tools/). package ssoadmin