// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"). You may
// not use this file except in compliance with the License. A copy of the
// License is located at
//
//     http://aws.amazon.com/apache2.0/
//
// or in the "license" file accompanying this file. This file is distributed
// on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
// express or implied. See the License for the specific language governing
// permissions and limitations under the License.

// Code generated by ack-generate. DO NOT EDIT.

package db_cluster

import (
	"context"
	"errors"
	"fmt"
	"math"
	"reflect"
	"strings"

	ackv1alpha1 "github.com/aws-controllers-k8s/runtime/apis/core/v1alpha1"
	ackcompare "github.com/aws-controllers-k8s/runtime/pkg/compare"
	ackcondition "github.com/aws-controllers-k8s/runtime/pkg/condition"
	ackerr "github.com/aws-controllers-k8s/runtime/pkg/errors"
	ackrequeue "github.com/aws-controllers-k8s/runtime/pkg/requeue"
	ackrtlog "github.com/aws-controllers-k8s/runtime/pkg/runtime/log"
	"github.com/aws/aws-sdk-go-v2/aws"
	svcsdk "github.com/aws/aws-sdk-go-v2/service/rds"
	svcsdktypes "github.com/aws/aws-sdk-go-v2/service/rds/types"
	smithy "github.com/aws/smithy-go"
	corev1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

	svcapitypes "github.com/aws-controllers-k8s/rds-controller/apis/v1alpha1"
)

// Hack to avoid import errors during build...
var (
	_ = &metav1.Time{}
	_ = strings.ToLower("")
	_ = &svcsdk.Client{}
	_ = &svcapitypes.DBCluster{}
	_ = ackv1alpha1.AWSAccountID("")
	_ = &ackerr.NotFound
	_ = &ackcondition.NotManagedMessage
	_ = &reflect.Value{}
	_ = fmt.Sprintf("")
	_ = &ackrequeue.NoRequeue{}
	_ = &aws.Config{}
)

// sdkFind returns SDK-specific information about a supplied resource
func (rm *resourceManager) sdkFind(
	ctx context.Context,
	r *resource,
) (latest *resource, err error) {
	rlog := ackrtlog.FromContext(ctx)
	exit := rlog.Trace("rm.sdkFind")
	defer func() {
		exit(err)
	}()
	// If any required fields in the input shape are missing, AWS resource is
	// not created yet. Return NotFound here to indicate to callers that the
	// resource isn't yet created.
	if rm.requiredFieldsMissingFromReadManyInput(r) {
		return nil, ackerr.NotFound
	}

	input, err := rm.newListRequestPayload(r)
	if err != nil {
		return nil, err
	}
	var resp *svcsdk.DescribeDBClustersOutput
	resp, err = rm.sdkapi.DescribeDBClusters(ctx, input)
	rm.metrics.RecordAPICall("READ_MANY", "DescribeDBClusters", err)
	if err != nil {
		var awsErr smithy.APIError
		if errors.As(err, &awsErr) && awsErr.ErrorCode() == "DBClusterNotFoundFault" {
			return nil, ackerr.NotFound
		}
		return nil, err
	}

	// Merge in the information we read from the API call above to the copy of
	// the original Kubernetes object we passed to the function
	ko := r.ko.DeepCopy()

	found := false
	for _, elem := range resp.DBClusters {
		if elem.ActivityStreamKinesisStreamName != nil {
			ko.Status.ActivityStreamKinesisStreamName = elem.ActivityStreamKinesisStreamName
		} else {
			ko.Status.ActivityStreamKinesisStreamName = nil
		}
		if elem.ActivityStreamKmsKeyId != nil {
			ko.Status.ActivityStreamKMSKeyID = elem.ActivityStreamKmsKeyId
		} else {
			ko.Status.ActivityStreamKMSKeyID = nil
		}
		if elem.ActivityStreamMode != "" {
			ko.Status.ActivityStreamMode = aws.String(string(elem.ActivityStreamMode))
		} else {
			ko.Status.ActivityStreamMode = nil
		}
		if elem.ActivityStreamStatus != "" {
			ko.Status.ActivityStreamStatus = aws.String(string(elem.ActivityStreamStatus))
		} else {
			ko.Status.ActivityStreamStatus = nil
		}
		if elem.AllocatedStorage != nil {
			allocatedStorageCopy := int64(*elem.AllocatedStorage)
			ko.Spec.AllocatedStorage = &allocatedStorageCopy
		} else {
			ko.Spec.AllocatedStorage = nil
		}
		if elem.AssociatedRoles != nil {
			f5 := []*svcapitypes.DBClusterRole{}
			for _, f5iter := range elem.AssociatedRoles {
				f5elem := &svcapitypes.DBClusterRole{}
				if f5iter.FeatureName != nil {
					f5elem.FeatureName = f5iter.FeatureName
				}
				if f5iter.RoleArn != nil {
					f5elem.RoleARN = f5iter.RoleArn
				}
				if f5iter.Status != nil {
					f5elem.Status = f5iter.Status
				}
				f5 = append(f5, f5elem)
			}
			ko.Status.AssociatedRoles = f5
		} else {
			ko.Status.AssociatedRoles = nil
		}
		if elem.AutoMinorVersionUpgrade != nil {
			ko.Spec.AutoMinorVersionUpgrade = elem.AutoMinorVersionUpgrade
		} else {
			ko.Spec.AutoMinorVersionUpgrade = nil
		}
		if elem.AutomaticRestartTime != nil {
			ko.Status.AutomaticRestartTime = &metav1.Time{*elem.AutomaticRestartTime}
		} else {
			ko.Status.AutomaticRestartTime = nil
		}
		if elem.AvailabilityZones != nil {
			ko.Spec.AvailabilityZones = aws.StringSlice(elem.AvailabilityZones)
		} else {
			ko.Spec.AvailabilityZones = nil
		}
		if elem.BacktrackConsumedChangeRecords != nil {
			ko.Status.BacktrackConsumedChangeRecords = elem.BacktrackConsumedChangeRecords
		} else {
			ko.Status.BacktrackConsumedChangeRecords = nil
		}
		if elem.BacktrackWindow != nil {
			ko.Spec.BacktrackWindow = elem.BacktrackWindow
		} else {
			ko.Spec.BacktrackWindow = nil
		}
		if elem.BackupRetentionPeriod != nil {
			backupRetentionPeriodCopy := int64(*elem.BackupRetentionPeriod)
			ko.Spec.BackupRetentionPeriod = &backupRetentionPeriodCopy
		} else {
			ko.Spec.BackupRetentionPeriod = nil
		}
		if elem.Capacity != nil {
			capacityCopy := int64(*elem.Capacity)
			ko.Status.Capacity = &capacityCopy
		} else {
			ko.Status.Capacity = nil
		}
		if elem.CharacterSetName != nil {
			ko.Spec.CharacterSetName = elem.CharacterSetName
		} else {
			ko.Spec.CharacterSetName = nil
		}
		if elem.CloneGroupId != nil {
			ko.Status.CloneGroupID = elem.CloneGroupId
		} else {
			ko.Status.CloneGroupID = nil
		}
		if elem.ClusterCreateTime != nil {
			ko.Status.ClusterCreateTime = &metav1.Time{*elem.ClusterCreateTime}
		} else {
			ko.Status.ClusterCreateTime = nil
		}
		if elem.CopyTagsToSnapshot != nil {
			ko.Spec.CopyTagsToSnapshot = elem.CopyTagsToSnapshot
		} else {
			ko.Spec.CopyTagsToSnapshot = nil
		}
		if elem.CrossAccountClone != nil {
			ko.Status.CrossAccountClone = elem.CrossAccountClone
		} else {
			ko.Status.CrossAccountClone = nil
		}
		if elem.CustomEndpoints != nil {
			ko.Status.CustomEndpoints = aws.StringSlice(elem.CustomEndpoints)
		} else {
			ko.Status.CustomEndpoints = nil
		}
		if elem.DBClusterArn != nil {
			if ko.Status.ACKResourceMetadata == nil {
				ko.Status.ACKResourceMetadata = &ackv1alpha1.ResourceMetadata{}
			}
			tmpARN := ackv1alpha1.AWSResourceName(*elem.DBClusterArn)
			ko.Status.ACKResourceMetadata.ARN = &tmpARN
		}
		if elem.DBClusterIdentifier != nil {
			ko.Spec.DBClusterIdentifier = elem.DBClusterIdentifier
		} else {
			ko.Spec.DBClusterIdentifier = nil
		}
		if elem.DBClusterInstanceClass != nil {
			ko.Spec.DBClusterInstanceClass = elem.DBClusterInstanceClass
		} else {
			ko.Spec.DBClusterInstanceClass = nil
		}
		if elem.DBClusterMembers != nil {
			f22 := []*svcapitypes.DBClusterMember{}
			for _, f22iter := range elem.DBClusterMembers {
				f22elem := &svcapitypes.DBClusterMember{}
				if f22iter.DBClusterParameterGroupStatus != nil {
					f22elem.DBClusterParameterGroupStatus = f22iter.DBClusterParameterGroupStatus
				}
				if f22iter.DBInstanceIdentifier != nil {
					f22elem.DBInstanceIdentifier = f22iter.DBInstanceIdentifier
				}
				if f22iter.IsClusterWriter != nil {
					f22elem.IsClusterWriter = f22iter.IsClusterWriter
				}
				if f22iter.PromotionTier != nil {
					promotionTierCopy := int64(*f22iter.PromotionTier)
					f22elem.PromotionTier = &promotionTierCopy
				}
				f22 = append(f22, f22elem)
			}
			ko.Status.DBClusterMembers = f22
		} else {
			ko.Status.DBClusterMembers = nil
		}
		if elem.DBClusterOptionGroupMemberships != nil {
			f23 := []*svcapitypes.DBClusterOptionGroupStatus{}
			for _, f23iter := range elem.DBClusterOptionGroupMemberships {
				f23elem := &svcapitypes.DBClusterOptionGroupStatus{}
				if f23iter.DBClusterOptionGroupName != nil {
					f23elem.DBClusterOptionGroupName = f23iter.DBClusterOptionGroupName
				}
				if f23iter.Status != nil {
					f23elem.Status = f23iter.Status
				}
				f23 = append(f23, f23elem)
			}
			ko.Status.DBClusterOptionGroupMemberships = f23
		} else {
			ko.Status.DBClusterOptionGroupMemberships = nil
		}
		if elem.DBClusterParameterGroup != nil {
			ko.Status.DBClusterParameterGroup = elem.DBClusterParameterGroup
		} else {
			ko.Status.DBClusterParameterGroup = nil
		}
		if elem.DBSubnetGroup != nil {
			ko.Status.DBSubnetGroup = elem.DBSubnetGroup
		} else {
			ko.Status.DBSubnetGroup = nil
		}
		if elem.DBSystemId != nil {
			ko.Spec.DBSystemID = elem.DBSystemId
		} else {
			ko.Spec.DBSystemID = nil
		}
		if elem.DatabaseInsightsMode != "" {
			ko.Spec.DatabaseInsightsMode = aws.String(string(elem.DatabaseInsightsMode))
		} else {
			ko.Spec.DatabaseInsightsMode = nil
		}
		if elem.DatabaseName != nil {
			ko.Spec.DatabaseName = elem.DatabaseName
		} else {
			ko.Spec.DatabaseName = nil
		}
		if elem.DbClusterResourceId != nil {
			ko.Status.DBClusterResourceID = elem.DbClusterResourceId
		} else {
			ko.Status.DBClusterResourceID = nil
		}
		if elem.DeletionProtection != nil {
			ko.Spec.DeletionProtection = elem.DeletionProtection
		} else {
			ko.Spec.DeletionProtection = nil
		}
		if elem.DomainMemberships != nil {
			f31 := []*svcapitypes.DomainMembership{}
			for _, f31iter := range elem.DomainMemberships {
				f31elem := &svcapitypes.DomainMembership{}
				if f31iter.Domain != nil {
					f31elem.Domain = f31iter.Domain
				}
				if f31iter.FQDN != nil {
					f31elem.FQDN = f31iter.FQDN
				}
				if f31iter.IAMRoleName != nil {
					f31elem.IAMRoleName = f31iter.IAMRoleName
				}
				if f31iter.Status != nil {
					f31elem.Status = f31iter.Status
				}
				f31 = append(f31, f31elem)
			}
			ko.Status.DomainMemberships = f31
		} else {
			ko.Status.DomainMemberships = nil
		}
		if elem.EarliestBacktrackTime != nil {
			ko.Status.EarliestBacktrackTime = &metav1.Time{*elem.EarliestBacktrackTime}
		} else {
			ko.Status.EarliestBacktrackTime = nil
		}
		if elem.EarliestRestorableTime != nil {
			ko.Status.EarliestRestorableTime = &metav1.Time{*elem.EarliestRestorableTime}
		} else {
			ko.Status.EarliestRestorableTime = nil
		}
		if elem.EnabledCloudwatchLogsExports != nil {
			ko.Status.EnabledCloudwatchLogsExports = aws.StringSlice(elem.EnabledCloudwatchLogsExports)
		} else {
			ko.Status.EnabledCloudwatchLogsExports = nil
		}
		if elem.Endpoint != nil {
			ko.Status.Endpoint = elem.Endpoint
		} else {
			ko.Status.Endpoint = nil
		}
		if elem.Engine != nil {
			ko.Spec.Engine = elem.Engine
		} else {
			ko.Spec.Engine = nil
		}
		if elem.EngineMode != nil {
			ko.Spec.EngineMode = elem.EngineMode
		} else {
			ko.Spec.EngineMode = nil
		}
		if elem.EngineVersion != nil {
			ko.Spec.EngineVersion = elem.EngineVersion
		} else {
			ko.Spec.EngineVersion = nil
		}
		if elem.GlobalWriteForwardingRequested != nil {
			ko.Status.GlobalWriteForwardingRequested = elem.GlobalWriteForwardingRequested
		} else {
			ko.Status.GlobalWriteForwardingRequested = nil
		}
		if elem.GlobalWriteForwardingStatus != "" {
			ko.Status.GlobalWriteForwardingStatus = aws.String(string(elem.GlobalWriteForwardingStatus))
		} else {
			ko.Status.GlobalWriteForwardingStatus = nil
		}
		if elem.HostedZoneId != nil {
			ko.Status.HostedZoneID = elem.HostedZoneId
		} else {
			ko.Status.HostedZoneID = nil
		}
		if elem.HttpEndpointEnabled != nil {
			ko.Status.HTTPEndpointEnabled = elem.HttpEndpointEnabled
		} else {
			ko.Status.HTTPEndpointEnabled = nil
		}
		if elem.IAMDatabaseAuthenticationEnabled != nil {
			ko.Status.IAMDatabaseAuthenticationEnabled = elem.IAMDatabaseAuthenticationEnabled
		} else {
			ko.Status.IAMDatabaseAuthenticationEnabled = nil
		}
		if elem.Iops != nil {
			iopsCopy := int64(*elem.Iops)
			ko.Spec.IOPS = &iopsCopy
		} else {
			ko.Spec.IOPS = nil
		}
		if elem.KmsKeyId != nil {
			ko.Spec.KMSKeyID = elem.KmsKeyId
		} else {
			ko.Spec.KMSKeyID = nil
		}
		if elem.LatestRestorableTime != nil {
			ko.Status.LatestRestorableTime = &metav1.Time{*elem.LatestRestorableTime}
		} else {
			ko.Status.LatestRestorableTime = nil
		}
		if elem.MasterUserSecret != nil {
			f47 := &svcapitypes.MasterUserSecret{}
			if elem.MasterUserSecret.KmsKeyId != nil {
				f47.KMSKeyID = elem.MasterUserSecret.KmsKeyId
			}
			if elem.MasterUserSecret.SecretArn != nil {
				f47.SecretARN = elem.MasterUserSecret.SecretArn
			}
			if elem.MasterUserSecret.SecretStatus != nil {
				f47.SecretStatus = elem.MasterUserSecret.SecretStatus
			}
			ko.Status.MasterUserSecret = f47
		} else {
			ko.Status.MasterUserSecret = nil
		}
		if elem.MasterUsername != nil {
			ko.Spec.MasterUsername = elem.MasterUsername
		} else {
			ko.Spec.MasterUsername = nil
		}
		if elem.MonitoringInterval != nil {
			monitoringIntervalCopy := int64(*elem.MonitoringInterval)
			ko.Spec.MonitoringInterval = &monitoringIntervalCopy
		} else {
			ko.Spec.MonitoringInterval = nil
		}
		if elem.MonitoringRoleArn != nil {
			ko.Spec.MonitoringRoleARN = elem.MonitoringRoleArn
		} else {
			ko.Spec.MonitoringRoleARN = nil
		}
		if elem.MultiAZ != nil {
			ko.Status.MultiAZ = elem.MultiAZ
		} else {
			ko.Status.MultiAZ = nil
		}
		if elem.NetworkType != nil {
			ko.Spec.NetworkType = elem.NetworkType
		} else {
			ko.Spec.NetworkType = nil
		}
		if elem.PendingModifiedValues != nil {
			f53 := &svcapitypes.ClusterPendingModifiedValues{}
			if elem.PendingModifiedValues.AllocatedStorage != nil {
				allocatedStorageCopy := int64(*elem.PendingModifiedValues.AllocatedStorage)
				f53.AllocatedStorage = &allocatedStorageCopy
			}
			if elem.PendingModifiedValues.BackupRetentionPeriod != nil {
				backupRetentionPeriodCopy := int64(*elem.PendingModifiedValues.BackupRetentionPeriod)
				f53.BackupRetentionPeriod = &backupRetentionPeriodCopy
			}
			if elem.PendingModifiedValues.DBClusterIdentifier != nil {
				f53.DBClusterIdentifier = elem.PendingModifiedValues.DBClusterIdentifier
			}
			if elem.PendingModifiedValues.EngineVersion != nil {
				f53.EngineVersion = elem.PendingModifiedValues.EngineVersion
			}
			if elem.PendingModifiedValues.IAMDatabaseAuthenticationEnabled != nil {
				f53.IAMDatabaseAuthenticationEnabled = elem.PendingModifiedValues.IAMDatabaseAuthenticationEnabled
			}
			if elem.PendingModifiedValues.Iops != nil {
				iopsCopy := int64(*elem.PendingModifiedValues.Iops)
				f53.IOPS = &iopsCopy
			}
			if elem.PendingModifiedValues.MasterUserPassword != nil {
				f53.MasterUserPassword = elem.PendingModifiedValues.MasterUserPassword
			}
			if elem.PendingModifiedValues.PendingCloudwatchLogsExports != nil {
				f53f7 := &svcapitypes.PendingCloudwatchLogsExports{}
				if elem.PendingModifiedValues.PendingCloudwatchLogsExports.LogTypesToDisable != nil {
					f53f7.LogTypesToDisable = aws.StringSlice(elem.PendingModifiedValues.PendingCloudwatchLogsExports.LogTypesToDisable)
				}
				if elem.PendingModifiedValues.PendingCloudwatchLogsExports.LogTypesToEnable != nil {
					f53f7.LogTypesToEnable = aws.StringSlice(elem.PendingModifiedValues.PendingCloudwatchLogsExports.LogTypesToEnable)
				}
				f53.PendingCloudwatchLogsExports = f53f7
			}
			ko.Status.PendingModifiedValues = f53
		} else {
			ko.Status.PendingModifiedValues = nil
		}
		if elem.PercentProgress != nil {
			ko.Status.PercentProgress = elem.PercentProgress
		} else {
			ko.Status.PercentProgress = nil
		}
		if elem.PerformanceInsightsEnabled != nil {
			ko.Status.PerformanceInsightsEnabled = elem.PerformanceInsightsEnabled
		} else {
			ko.Status.PerformanceInsightsEnabled = nil
		}
		if elem.PerformanceInsightsKMSKeyId != nil {
			ko.Spec.PerformanceInsightsKMSKeyID = elem.PerformanceInsightsKMSKeyId
		} else {
			ko.Spec.PerformanceInsightsKMSKeyID = nil
		}
		if elem.PerformanceInsightsRetentionPeriod != nil {
			performanceInsightsRetentionPeriodCopy := int64(*elem.PerformanceInsightsRetentionPeriod)
			ko.Spec.PerformanceInsightsRetentionPeriod = &performanceInsightsRetentionPeriodCopy
		} else {
			ko.Spec.PerformanceInsightsRetentionPeriod = nil
		}
		if elem.Port != nil {
			portCopy := int64(*elem.Port)
			ko.Spec.Port = &portCopy
		} else {
			ko.Spec.Port = nil
		}
		if elem.PreferredBackupWindow != nil {
			ko.Spec.PreferredBackupWindow = elem.PreferredBackupWindow
		} else {
			ko.Spec.PreferredBackupWindow = nil
		}
		if elem.PreferredMaintenanceWindow != nil {
			ko.Spec.PreferredMaintenanceWindow = elem.PreferredMaintenanceWindow
		} else {
			ko.Spec.PreferredMaintenanceWindow = nil
		}
		if elem.PubliclyAccessible != nil {
			ko.Spec.PubliclyAccessible = elem.PubliclyAccessible
		} else {
			ko.Spec.PubliclyAccessible = nil
		}
		if elem.ReadReplicaIdentifiers != nil {
			ko.Status.ReadReplicaIdentifiers = aws.StringSlice(elem.ReadReplicaIdentifiers)
		} else {
			ko.Status.ReadReplicaIdentifiers = nil
		}
		if elem.ReaderEndpoint != nil {
			ko.Status.ReaderEndpoint = elem.ReaderEndpoint
		} else {
			ko.Status.ReaderEndpoint = nil
		}
		if elem.ReplicationSourceIdentifier != nil {
			ko.Spec.ReplicationSourceIdentifier = elem.ReplicationSourceIdentifier
		} else {
			ko.Spec.ReplicationSourceIdentifier = nil
		}
		if elem.ServerlessV2ScalingConfiguration != nil {
			f66 := &svcapitypes.ServerlessV2ScalingConfiguration{}
			if elem.ServerlessV2ScalingConfiguration.MaxCapacity != nil {
				f66.MaxCapacity = elem.ServerlessV2ScalingConfiguration.MaxCapacity
			}
			if elem.ServerlessV2ScalingConfiguration.MinCapacity != nil {
				f66.MinCapacity = elem.ServerlessV2ScalingConfiguration.MinCapacity
			}
			if elem.ServerlessV2ScalingConfiguration.SecondsUntilAutoPause != nil {
				secondsUntilAutoPauseCopy := int64(*elem.ServerlessV2ScalingConfiguration.SecondsUntilAutoPause)
				f66.SecondsUntilAutoPause = &secondsUntilAutoPauseCopy
			}
			ko.Spec.ServerlessV2ScalingConfiguration = f66
		} else {
			ko.Spec.ServerlessV2ScalingConfiguration = nil
		}
		if elem.Status != nil {
			ko.Status.Status = elem.Status
		} else {
			ko.Status.Status = nil
		}
		if elem.StorageEncrypted != nil {
			ko.Spec.StorageEncrypted = elem.StorageEncrypted
		} else {
			ko.Spec.StorageEncrypted = nil
		}
		if elem.StorageType != nil {
			ko.Spec.StorageType = elem.StorageType
		} else {
			ko.Spec.StorageType = nil
		}
		if elem.TagList != nil {
			f70 := []*svcapitypes.Tag{}
			for _, f70iter := range elem.TagList {
				f70elem := &svcapitypes.Tag{}
				if f70iter.Key != nil {
					f70elem.Key = f70iter.Key
				}
				if f70iter.Value != nil {
					f70elem.Value = f70iter.Value
				}
				f70 = append(f70, f70elem)
			}
			ko.Status.TagList = f70
		} else {
			ko.Status.TagList = nil
		}
		if elem.VpcSecurityGroups != nil {
			f71 := []*svcapitypes.VPCSecurityGroupMembership{}
			for _, f71iter := range elem.VpcSecurityGroups {
				f71elem := &svcapitypes.VPCSecurityGroupMembership{}
				if f71iter.Status != nil {
					f71elem.Status = f71iter.Status
				}
				if f71iter.VpcSecurityGroupId != nil {
					f71elem.VPCSecurityGroupID = f71iter.VpcSecurityGroupId
				}
				f71 = append(f71, f71elem)
			}
			ko.Status.VPCSecurityGroups = f71
		} else {
			ko.Status.VPCSecurityGroups = nil
		}
		found = true
		break
	}
	if !found {
		return nil, ackerr.NotFound
	}

	rm.setStatusDefaults(ko)
	if ko.Status.ACKResourceMetadata != nil && ko.Status.ACKResourceMetadata.ARN != nil {
		resourceARN := (*string)(ko.Status.ACKResourceMetadata.ARN)
		tags, err := rm.getTags(ctx, *resourceARN)
		if err != nil {
			return nil, err
		}
		ko.Spec.Tags = tags
	}
	if !clusterAvailable(&resource{ko}) {
		// Setting resource synced condition to false will trigger a requeue of
		// the resource. No need to return a requeue error here.
		ackcondition.SetSynced(&resource{ko}, corev1.ConditionFalse, nil, nil)
	} else {
		ackcondition.SetSynced(&resource{ko}, corev1.ConditionTrue, nil, nil)
	}
	if len(r.ko.Spec.VPCSecurityGroupIDs) > 0 {
		// If the desired resource has security groups specified then update the spec of the latest resource with the
		// value from the status. This is done so that when a cluster is created without security groups and gets a
		// default security group attached to it, it is not overwritten with empty security groups from the
		// desired resource.
		sgIDs := make([]*string, len(ko.Status.VPCSecurityGroups))
		for i, sg := range ko.Status.VPCSecurityGroups {
			id := *sg.VPCSecurityGroupID
			sgIDs[i] = &id
		}
		ko.Spec.VPCSecurityGroupIDs = sgIDs
	}
	if r.ko.Spec.DBClusterParameterGroupName != nil {
		// If the desired resource has db cluster parameter group name specified then update the spec of the latest
		// resource with the value from the status.
		ko.Spec.DBClusterParameterGroupName = ko.Status.DBClusterParameterGroup
	}

	if r.ko.Spec.EnableIAMDatabaseAuthentication != nil {
		// If the desired resource has IAM authentication explicitly enabled or disabled then update the spec of the
		// latest resource with the value from the status.
		ko.Spec.EnableIAMDatabaseAuthentication = ko.Status.IAMDatabaseAuthenticationEnabled
	}

	ko.Spec.EnableCloudwatchLogsExports = ko.Status.EnabledCloudwatchLogsExports

	return &resource{ko}, nil
}

// requiredFieldsMissingFromReadManyInput returns true if there are any fields
// for the ReadMany Input shape that are required but not present in the
// resource's Spec or Status
func (rm *resourceManager) requiredFieldsMissingFromReadManyInput(
	r *resource,
) bool {
	return false
}

// newListRequestPayload returns SDK-specific struct for the HTTP request
// payload of the List API call for the resource
func (rm *resourceManager) newListRequestPayload(
	r *resource,
) (*svcsdk.DescribeDBClustersInput, error) {
	res := &svcsdk.DescribeDBClustersInput{}

	if r.ko.Spec.DBClusterIdentifier != nil {
		res.DBClusterIdentifier = r.ko.Spec.DBClusterIdentifier
	}

	return res, nil
}

// sdkCreate creates the supplied resource in the backend AWS service API and
// returns a copy of the resource with resource fields (in both Spec and
// Status) filled in with values from the CREATE API operation's Output shape.
func (rm *resourceManager) sdkCreate(
	ctx context.Context,
	desired *resource,
) (created *resource, err error) {
	rlog := ackrtlog.FromContext(ctx)
	exit := rlog.Trace("rm.sdkCreate")
	defer func() {
		exit(err)
	}()
	// if request has SnapshotIdentifier spec, create request will call RestoreDBClusterFromSnapshotWithContext
	// instead of normal create api
	if desired.ko.Spec.SnapshotIdentifier != nil {
		return rm.restoreDbClusterFromSnapshot(ctx, desired)
	}

	// if request has SourceDBClusterIdentifier spec, create request will call RestoreDBClusterToPointInTimeWithContext
	// instead of normal create api
	if desired.ko.Spec.SourceDBClusterIdentifier != nil {
		return rm.restoreDbClusterToPointInTime(ctx, desired)
	}

	input, err := rm.newCreateRequestPayload(ctx, desired)
	if err != nil {
		return nil, err
	}

	var resp *svcsdk.CreateDBClusterOutput
	_ = resp
	resp, err = rm.sdkapi.CreateDBCluster(ctx, input)
	rm.metrics.RecordAPICall("CREATE", "CreateDBCluster", err)
	if err != nil {
		return nil, err
	}
	// Merge in the information we read from the API call above to the copy of
	// the original Kubernetes object we passed to the function
	ko := desired.ko.DeepCopy()

	if resp.DBCluster.ActivityStreamKinesisStreamName != nil {
		ko.Status.ActivityStreamKinesisStreamName = resp.DBCluster.ActivityStreamKinesisStreamName
	} else {
		ko.Status.ActivityStreamKinesisStreamName = nil
	}
	if resp.DBCluster.ActivityStreamKmsKeyId != nil {
		ko.Status.ActivityStreamKMSKeyID = resp.DBCluster.ActivityStreamKmsKeyId
	} else {
		ko.Status.ActivityStreamKMSKeyID = nil
	}
	if resp.DBCluster.ActivityStreamMode != "" {
		ko.Status.ActivityStreamMode = aws.String(string(resp.DBCluster.ActivityStreamMode))
	} else {
		ko.Status.ActivityStreamMode = nil
	}
	if resp.DBCluster.ActivityStreamStatus != "" {
		ko.Status.ActivityStreamStatus = aws.String(string(resp.DBCluster.ActivityStreamStatus))
	} else {
		ko.Status.ActivityStreamStatus = nil
	}
	if resp.DBCluster.AllocatedStorage != nil {
		allocatedStorageCopy := int64(*resp.DBCluster.AllocatedStorage)
		ko.Spec.AllocatedStorage = &allocatedStorageCopy
	} else {
		ko.Spec.AllocatedStorage = nil
	}
	if resp.DBCluster.AssociatedRoles != nil {
		f5 := []*svcapitypes.DBClusterRole{}
		for _, f5iter := range resp.DBCluster.AssociatedRoles {
			f5elem := &svcapitypes.DBClusterRole{}
			if f5iter.FeatureName != nil {
				f5elem.FeatureName = f5iter.FeatureName
			}
			if f5iter.RoleArn != nil {
				f5elem.RoleARN = f5iter.RoleArn
			}
			if f5iter.Status != nil {
				f5elem.Status = f5iter.Status
			}
			f5 = append(f5, f5elem)
		}
		ko.Status.AssociatedRoles = f5
	} else {
		ko.Status.AssociatedRoles = nil
	}
	if resp.DBCluster.AutoMinorVersionUpgrade != nil {
		ko.Spec.AutoMinorVersionUpgrade = resp.DBCluster.AutoMinorVersionUpgrade
	} else {
		ko.Spec.AutoMinorVersionUpgrade = nil
	}
	if resp.DBCluster.AutomaticRestartTime != nil {
		ko.Status.AutomaticRestartTime = &metav1.Time{*resp.DBCluster.AutomaticRestartTime}
	} else {
		ko.Status.AutomaticRestartTime = nil
	}
	if resp.DBCluster.AvailabilityZones != nil {
		ko.Spec.AvailabilityZones = aws.StringSlice(resp.DBCluster.AvailabilityZones)
	} else {
		ko.Spec.AvailabilityZones = nil
	}
	if resp.DBCluster.BacktrackConsumedChangeRecords != nil {
		ko.Status.BacktrackConsumedChangeRecords = resp.DBCluster.BacktrackConsumedChangeRecords
	} else {
		ko.Status.BacktrackConsumedChangeRecords = nil
	}
	if resp.DBCluster.BacktrackWindow != nil {
		ko.Spec.BacktrackWindow = resp.DBCluster.BacktrackWindow
	} else {
		ko.Spec.BacktrackWindow = nil
	}
	if resp.DBCluster.BackupRetentionPeriod != nil {
		backupRetentionPeriodCopy := int64(*resp.DBCluster.BackupRetentionPeriod)
		ko.Spec.BackupRetentionPeriod = &backupRetentionPeriodCopy
	} else {
		ko.Spec.BackupRetentionPeriod = nil
	}
	if resp.DBCluster.Capacity != nil {
		capacityCopy := int64(*resp.DBCluster.Capacity)
		ko.Status.Capacity = &capacityCopy
	} else {
		ko.Status.Capacity = nil
	}
	if resp.DBCluster.CharacterSetName != nil {
		ko.Spec.CharacterSetName = resp.DBCluster.CharacterSetName
	} else {
		ko.Spec.CharacterSetName = nil
	}
	if resp.DBCluster.CloneGroupId != nil {
		ko.Status.CloneGroupID = resp.DBCluster.CloneGroupId
	} else {
		ko.Status.CloneGroupID = nil
	}
	if resp.DBCluster.ClusterCreateTime != nil {
		ko.Status.ClusterCreateTime = &metav1.Time{*resp.DBCluster.ClusterCreateTime}
	} else {
		ko.Status.ClusterCreateTime = nil
	}
	if resp.DBCluster.CopyTagsToSnapshot != nil {
		ko.Spec.CopyTagsToSnapshot = resp.DBCluster.CopyTagsToSnapshot
	} else {
		ko.Spec.CopyTagsToSnapshot = nil
	}
	if resp.DBCluster.CrossAccountClone != nil {
		ko.Status.CrossAccountClone = resp.DBCluster.CrossAccountClone
	} else {
		ko.Status.CrossAccountClone = nil
	}
	if resp.DBCluster.CustomEndpoints != nil {
		ko.Status.CustomEndpoints = aws.StringSlice(resp.DBCluster.CustomEndpoints)
	} else {
		ko.Status.CustomEndpoints = nil
	}
	if ko.Status.ACKResourceMetadata == nil {
		ko.Status.ACKResourceMetadata = &ackv1alpha1.ResourceMetadata{}
	}
	if resp.DBCluster.DBClusterArn != nil {
		arn := ackv1alpha1.AWSResourceName(*resp.DBCluster.DBClusterArn)
		ko.Status.ACKResourceMetadata.ARN = &arn
	}
	if resp.DBCluster.DBClusterIdentifier != nil {
		ko.Spec.DBClusterIdentifier = resp.DBCluster.DBClusterIdentifier
	} else {
		ko.Spec.DBClusterIdentifier = nil
	}
	if resp.DBCluster.DBClusterInstanceClass != nil {
		ko.Spec.DBClusterInstanceClass = resp.DBCluster.DBClusterInstanceClass
	} else {
		ko.Spec.DBClusterInstanceClass = nil
	}
	if resp.DBCluster.DBClusterMembers != nil {
		f22 := []*svcapitypes.DBClusterMember{}
		for _, f22iter := range resp.DBCluster.DBClusterMembers {
			f22elem := &svcapitypes.DBClusterMember{}
			if f22iter.DBClusterParameterGroupStatus != nil {
				f22elem.DBClusterParameterGroupStatus = f22iter.DBClusterParameterGroupStatus
			}
			if f22iter.DBInstanceIdentifier != nil {
				f22elem.DBInstanceIdentifier = f22iter.DBInstanceIdentifier
			}
			if f22iter.IsClusterWriter != nil {
				f22elem.IsClusterWriter = f22iter.IsClusterWriter
			}
			if f22iter.PromotionTier != nil {
				promotionTierCopy := int64(*f22iter.PromotionTier)
				f22elem.PromotionTier = &promotionTierCopy
			}
			f22 = append(f22, f22elem)
		}
		ko.Status.DBClusterMembers = f22
	} else {
		ko.Status.DBClusterMembers = nil
	}
	if resp.DBCluster.DBClusterOptionGroupMemberships != nil {
		f23 := []*svcapitypes.DBClusterOptionGroupStatus{}
		for _, f23iter := range resp.DBCluster.DBClusterOptionGroupMemberships {
			f23elem := &svcapitypes.DBClusterOptionGroupStatus{}
			if f23iter.DBClusterOptionGroupName != nil {
				f23elem.DBClusterOptionGroupName = f23iter.DBClusterOptionGroupName
			}
			if f23iter.Status != nil {
				f23elem.Status = f23iter.Status
			}
			f23 = append(f23, f23elem)
		}
		ko.Status.DBClusterOptionGroupMemberships = f23
	} else {
		ko.Status.DBClusterOptionGroupMemberships = nil
	}
	if resp.DBCluster.DBClusterParameterGroup != nil {
		ko.Status.DBClusterParameterGroup = resp.DBCluster.DBClusterParameterGroup
	} else {
		ko.Status.DBClusterParameterGroup = nil
	}
	if resp.DBCluster.DBSubnetGroup != nil {
		ko.Status.DBSubnetGroup = resp.DBCluster.DBSubnetGroup
	} else {
		ko.Status.DBSubnetGroup = nil
	}
	if resp.DBCluster.DBSystemId != nil {
		ko.Spec.DBSystemID = resp.DBCluster.DBSystemId
	} else {
		ko.Spec.DBSystemID = nil
	}
	if resp.DBCluster.DatabaseInsightsMode != "" {
		ko.Spec.DatabaseInsightsMode = aws.String(string(resp.DBCluster.DatabaseInsightsMode))
	} else {
		ko.Spec.DatabaseInsightsMode = nil
	}
	if resp.DBCluster.DatabaseName != nil {
		ko.Spec.DatabaseName = resp.DBCluster.DatabaseName
	} else {
		ko.Spec.DatabaseName = nil
	}
	if resp.DBCluster.DbClusterResourceId != nil {
		ko.Status.DBClusterResourceID = resp.DBCluster.DbClusterResourceId
	} else {
		ko.Status.DBClusterResourceID = nil
	}
	if resp.DBCluster.DeletionProtection != nil {
		ko.Spec.DeletionProtection = resp.DBCluster.DeletionProtection
	} else {
		ko.Spec.DeletionProtection = nil
	}
	if resp.DBCluster.DomainMemberships != nil {
		f31 := []*svcapitypes.DomainMembership{}
		for _, f31iter := range resp.DBCluster.DomainMemberships {
			f31elem := &svcapitypes.DomainMembership{}
			if f31iter.Domain != nil {
				f31elem.Domain = f31iter.Domain
			}
			if f31iter.FQDN != nil {
				f31elem.FQDN = f31iter.FQDN
			}
			if f31iter.IAMRoleName != nil {
				f31elem.IAMRoleName = f31iter.IAMRoleName
			}
			if f31iter.Status != nil {
				f31elem.Status = f31iter.Status
			}
			f31 = append(f31, f31elem)
		}
		ko.Status.DomainMemberships = f31
	} else {
		ko.Status.DomainMemberships = nil
	}
	if resp.DBCluster.EarliestBacktrackTime != nil {
		ko.Status.EarliestBacktrackTime = &metav1.Time{*resp.DBCluster.EarliestBacktrackTime}
	} else {
		ko.Status.EarliestBacktrackTime = nil
	}
	if resp.DBCluster.EarliestRestorableTime != nil {
		ko.Status.EarliestRestorableTime = &metav1.Time{*resp.DBCluster.EarliestRestorableTime}
	} else {
		ko.Status.EarliestRestorableTime = nil
	}
	if resp.DBCluster.EnabledCloudwatchLogsExports != nil {
		ko.Status.EnabledCloudwatchLogsExports = aws.StringSlice(resp.DBCluster.EnabledCloudwatchLogsExports)
	} else {
		ko.Status.EnabledCloudwatchLogsExports = nil
	}
	if resp.DBCluster.Endpoint != nil {
		ko.Status.Endpoint = resp.DBCluster.Endpoint
	} else {
		ko.Status.Endpoint = nil
	}
	if resp.DBCluster.Engine != nil {
		ko.Spec.Engine = resp.DBCluster.Engine
	} else {
		ko.Spec.Engine = nil
	}
	if resp.DBCluster.EngineMode != nil {
		ko.Spec.EngineMode = resp.DBCluster.EngineMode
	} else {
		ko.Spec.EngineMode = nil
	}
	if resp.DBCluster.EngineVersion != nil {
		ko.Spec.EngineVersion = resp.DBCluster.EngineVersion
	} else {
		ko.Spec.EngineVersion = nil
	}
	if resp.DBCluster.GlobalWriteForwardingRequested != nil {
		ko.Status.GlobalWriteForwardingRequested = resp.DBCluster.GlobalWriteForwardingRequested
	} else {
		ko.Status.GlobalWriteForwardingRequested = nil
	}
	if resp.DBCluster.GlobalWriteForwardingStatus != "" {
		ko.Status.GlobalWriteForwardingStatus = aws.String(string(resp.DBCluster.GlobalWriteForwardingStatus))
	} else {
		ko.Status.GlobalWriteForwardingStatus = nil
	}
	if resp.DBCluster.HostedZoneId != nil {
		ko.Status.HostedZoneID = resp.DBCluster.HostedZoneId
	} else {
		ko.Status.HostedZoneID = nil
	}
	if resp.DBCluster.HttpEndpointEnabled != nil {
		ko.Status.HTTPEndpointEnabled = resp.DBCluster.HttpEndpointEnabled
	} else {
		ko.Status.HTTPEndpointEnabled = nil
	}
	if resp.DBCluster.IAMDatabaseAuthenticationEnabled != nil {
		ko.Status.IAMDatabaseAuthenticationEnabled = resp.DBCluster.IAMDatabaseAuthenticationEnabled
	} else {
		ko.Status.IAMDatabaseAuthenticationEnabled = nil
	}
	if resp.DBCluster.Iops != nil {
		iopsCopy := int64(*resp.DBCluster.Iops)
		ko.Spec.IOPS = &iopsCopy
	} else {
		ko.Spec.IOPS = nil
	}
	if resp.DBCluster.KmsKeyId != nil {
		ko.Spec.KMSKeyID = resp.DBCluster.KmsKeyId
	} else {
		ko.Spec.KMSKeyID = nil
	}
	if resp.DBCluster.LatestRestorableTime != nil {
		ko.Status.LatestRestorableTime = &metav1.Time{*resp.DBCluster.LatestRestorableTime}
	} else {
		ko.Status.LatestRestorableTime = nil
	}
	if resp.DBCluster.MasterUserSecret != nil {
		f47 := &svcapitypes.MasterUserSecret{}
		if resp.DBCluster.MasterUserSecret.KmsKeyId != nil {
			f47.KMSKeyID = resp.DBCluster.MasterUserSecret.KmsKeyId
		}
		if resp.DBCluster.MasterUserSecret.SecretArn != nil {
			f47.SecretARN = resp.DBCluster.MasterUserSecret.SecretArn
		}
		if resp.DBCluster.MasterUserSecret.SecretStatus != nil {
			f47.SecretStatus = resp.DBCluster.MasterUserSecret.SecretStatus
		}
		ko.Status.MasterUserSecret = f47
	} else {
		ko.Status.MasterUserSecret = nil
	}
	if resp.DBCluster.MasterUsername != nil {
		ko.Spec.MasterUsername = resp.DBCluster.MasterUsername
	} else {
		ko.Spec.MasterUsername = nil
	}
	if resp.DBCluster.MonitoringInterval != nil {
		monitoringIntervalCopy := int64(*resp.DBCluster.MonitoringInterval)
		ko.Spec.MonitoringInterval = &monitoringIntervalCopy
	} else {
		ko.Spec.MonitoringInterval = nil
	}
	if resp.DBCluster.MonitoringRoleArn != nil {
		ko.Spec.MonitoringRoleARN = resp.DBCluster.MonitoringRoleArn
	} else {
		ko.Spec.MonitoringRoleARN = nil
	}
	if resp.DBCluster.MultiAZ != nil {
		ko.Status.MultiAZ = resp.DBCluster.MultiAZ
	} else {
		ko.Status.MultiAZ = nil
	}
	if resp.DBCluster.NetworkType != nil {
		ko.Spec.NetworkType = resp.DBCluster.NetworkType
	} else {
		ko.Spec.NetworkType = nil
	}
	if resp.DBCluster.PendingModifiedValues != nil {
		f53 := &svcapitypes.ClusterPendingModifiedValues{}
		if resp.DBCluster.PendingModifiedValues.AllocatedStorage != nil {
			allocatedStorageCopy := int64(*resp.DBCluster.PendingModifiedValues.AllocatedStorage)
			f53.AllocatedStorage = &allocatedStorageCopy
		}
		if resp.DBCluster.PendingModifiedValues.BackupRetentionPeriod != nil {
			backupRetentionPeriodCopy := int64(*resp.DBCluster.PendingModifiedValues.BackupRetentionPeriod)
			f53.BackupRetentionPeriod = &backupRetentionPeriodCopy
		}
		if resp.DBCluster.PendingModifiedValues.DBClusterIdentifier != nil {
			f53.DBClusterIdentifier = resp.DBCluster.PendingModifiedValues.DBClusterIdentifier
		}
		if resp.DBCluster.PendingModifiedValues.EngineVersion != nil {
			f53.EngineVersion = resp.DBCluster.PendingModifiedValues.EngineVersion
		}
		if resp.DBCluster.PendingModifiedValues.IAMDatabaseAuthenticationEnabled != nil {
			f53.IAMDatabaseAuthenticationEnabled = resp.DBCluster.PendingModifiedValues.IAMDatabaseAuthenticationEnabled
		}
		if resp.DBCluster.PendingModifiedValues.Iops != nil {
			iopsCopy := int64(*resp.DBCluster.PendingModifiedValues.Iops)
			f53.IOPS = &iopsCopy
		}
		if resp.DBCluster.PendingModifiedValues.MasterUserPassword != nil {
			f53.MasterUserPassword = resp.DBCluster.PendingModifiedValues.MasterUserPassword
		}
		if resp.DBCluster.PendingModifiedValues.PendingCloudwatchLogsExports != nil {
			f53f7 := &svcapitypes.PendingCloudwatchLogsExports{}
			if resp.DBCluster.PendingModifiedValues.PendingCloudwatchLogsExports.LogTypesToDisable != nil {
				f53f7.LogTypesToDisable = aws.StringSlice(resp.DBCluster.PendingModifiedValues.PendingCloudwatchLogsExports.LogTypesToDisable)
			}
			if resp.DBCluster.PendingModifiedValues.PendingCloudwatchLogsExports.LogTypesToEnable != nil {
				f53f7.LogTypesToEnable = aws.StringSlice(resp.DBCluster.PendingModifiedValues.PendingCloudwatchLogsExports.LogTypesToEnable)
			}
			f53.PendingCloudwatchLogsExports = f53f7
		}
		ko.Status.PendingModifiedValues = f53
	} else {
		ko.Status.PendingModifiedValues = nil
	}
	if resp.DBCluster.PercentProgress != nil {
		ko.Status.PercentProgress = resp.DBCluster.PercentProgress
	} else {
		ko.Status.PercentProgress = nil
	}
	if resp.DBCluster.PerformanceInsightsEnabled != nil {
		ko.Status.PerformanceInsightsEnabled = resp.DBCluster.PerformanceInsightsEnabled
	} else {
		ko.Status.PerformanceInsightsEnabled = nil
	}
	if resp.DBCluster.PerformanceInsightsKMSKeyId != nil {
		ko.Spec.PerformanceInsightsKMSKeyID = resp.DBCluster.PerformanceInsightsKMSKeyId
	} else {
		ko.Spec.PerformanceInsightsKMSKeyID = nil
	}
	if resp.DBCluster.PerformanceInsightsRetentionPeriod != nil {
		performanceInsightsRetentionPeriodCopy := int64(*resp.DBCluster.PerformanceInsightsRetentionPeriod)
		ko.Spec.PerformanceInsightsRetentionPeriod = &performanceInsightsRetentionPeriodCopy
	} else {
		ko.Spec.PerformanceInsightsRetentionPeriod = nil
	}
	if resp.DBCluster.Port != nil {
		portCopy := int64(*resp.DBCluster.Port)
		ko.Spec.Port = &portCopy
	} else {
		ko.Spec.Port = nil
	}
	if resp.DBCluster.PreferredBackupWindow != nil {
		ko.Spec.PreferredBackupWindow = resp.DBCluster.PreferredBackupWindow
	} else {
		ko.Spec.PreferredBackupWindow = nil
	}
	if resp.DBCluster.PreferredMaintenanceWindow != nil {
		ko.Spec.PreferredMaintenanceWindow = resp.DBCluster.PreferredMaintenanceWindow
	} else {
		ko.Spec.PreferredMaintenanceWindow = nil
	}
	if resp.DBCluster.PubliclyAccessible != nil {
		ko.Spec.PubliclyAccessible = resp.DBCluster.PubliclyAccessible
	} else {
		ko.Spec.PubliclyAccessible = nil
	}
	if resp.DBCluster.ReadReplicaIdentifiers != nil {
		ko.Status.ReadReplicaIdentifiers = aws.StringSlice(resp.DBCluster.ReadReplicaIdentifiers)
	} else {
		ko.Status.ReadReplicaIdentifiers = nil
	}
	if resp.DBCluster.ReaderEndpoint != nil {
		ko.Status.ReaderEndpoint = resp.DBCluster.ReaderEndpoint
	} else {
		ko.Status.ReaderEndpoint = nil
	}
	if resp.DBCluster.ReplicationSourceIdentifier != nil {
		ko.Spec.ReplicationSourceIdentifier = resp.DBCluster.ReplicationSourceIdentifier
	} else {
		ko.Spec.ReplicationSourceIdentifier = nil
	}
	if resp.DBCluster.ScalingConfigurationInfo != nil {
		f65 := &svcapitypes.ScalingConfiguration{}
		if resp.DBCluster.ScalingConfigurationInfo.AutoPause != nil {
			f65.AutoPause = resp.DBCluster.ScalingConfigurationInfo.AutoPause
		}
		if resp.DBCluster.ScalingConfigurationInfo.MaxCapacity != nil {
			maxCapacityCopy := int64(*resp.DBCluster.ScalingConfigurationInfo.MaxCapacity)
			f65.MaxCapacity = &maxCapacityCopy
		}
		if resp.DBCluster.ScalingConfigurationInfo.MinCapacity != nil {
			minCapacityCopy := int64(*resp.DBCluster.ScalingConfigurationInfo.MinCapacity)
			f65.MinCapacity = &minCapacityCopy
		}
		if resp.DBCluster.ScalingConfigurationInfo.SecondsBeforeTimeout != nil {
			secondsBeforeTimeoutCopy := int64(*resp.DBCluster.ScalingConfigurationInfo.SecondsBeforeTimeout)
			f65.SecondsBeforeTimeout = &secondsBeforeTimeoutCopy
		}
		if resp.DBCluster.ScalingConfigurationInfo.SecondsUntilAutoPause != nil {
			secondsUntilAutoPauseCopy := int64(*resp.DBCluster.ScalingConfigurationInfo.SecondsUntilAutoPause)
			f65.SecondsUntilAutoPause = &secondsUntilAutoPauseCopy
		}
		if resp.DBCluster.ScalingConfigurationInfo.TimeoutAction != nil {
			f65.TimeoutAction = resp.DBCluster.ScalingConfigurationInfo.TimeoutAction
		}
		ko.Spec.ScalingConfiguration = f65
	} else {
		ko.Spec.ScalingConfiguration = nil
	}
	if resp.DBCluster.ServerlessV2ScalingConfiguration != nil {
		f66 := &svcapitypes.ServerlessV2ScalingConfiguration{}
		if resp.DBCluster.ServerlessV2ScalingConfiguration.MaxCapacity != nil {
			f66.MaxCapacity = resp.DBCluster.ServerlessV2ScalingConfiguration.MaxCapacity
		}
		if resp.DBCluster.ServerlessV2ScalingConfiguration.MinCapacity != nil {
			f66.MinCapacity = resp.DBCluster.ServerlessV2ScalingConfiguration.MinCapacity
		}
		if resp.DBCluster.ServerlessV2ScalingConfiguration.SecondsUntilAutoPause != nil {
			secondsUntilAutoPauseCopy := int64(*resp.DBCluster.ServerlessV2ScalingConfiguration.SecondsUntilAutoPause)
			f66.SecondsUntilAutoPause = &secondsUntilAutoPauseCopy
		}
		ko.Spec.ServerlessV2ScalingConfiguration = f66
	} else {
		ko.Spec.ServerlessV2ScalingConfiguration = nil
	}
	if resp.DBCluster.Status != nil {
		ko.Status.Status = resp.DBCluster.Status
	} else {
		ko.Status.Status = nil
	}
	if resp.DBCluster.StorageEncrypted != nil {
		ko.Spec.StorageEncrypted = resp.DBCluster.StorageEncrypted
	} else {
		ko.Spec.StorageEncrypted = nil
	}
	if resp.DBCluster.StorageType != nil {
		ko.Spec.StorageType = resp.DBCluster.StorageType
	} else {
		ko.Spec.StorageType = nil
	}
	if resp.DBCluster.TagList != nil {
		f70 := []*svcapitypes.Tag{}
		for _, f70iter := range resp.DBCluster.TagList {
			f70elem := &svcapitypes.Tag{}
			if f70iter.Key != nil {
				f70elem.Key = f70iter.Key
			}
			if f70iter.Value != nil {
				f70elem.Value = f70iter.Value
			}
			f70 = append(f70, f70elem)
		}
		ko.Status.TagList = f70
	} else {
		ko.Status.TagList = nil
	}
	if resp.DBCluster.VpcSecurityGroups != nil {
		f71 := []*svcapitypes.VPCSecurityGroupMembership{}
		for _, f71iter := range resp.DBCluster.VpcSecurityGroups {
			f71elem := &svcapitypes.VPCSecurityGroupMembership{}
			if f71iter.Status != nil {
				f71elem.Status = f71iter.Status
			}
			if f71iter.VpcSecurityGroupId != nil {
				f71elem.VPCSecurityGroupID = f71iter.VpcSecurityGroupId
			}
			f71 = append(f71, f71elem)
		}
		ko.Status.VPCSecurityGroups = f71
	} else {
		ko.Status.VPCSecurityGroups = nil
	}

	rm.setStatusDefaults(ko)
	// set the last-applied-secret-reference annotation on the DB instance
	// resource.
	r := &resource{ko}
	setLastAppliedSecretReferenceAnnotation(r)
	// We expect the DB cluster to be in 'creating' status since we just
	// issued the call to create it, but I suppose it doesn't hurt to check
	// here.
	if clusterCreating(r) {
		// Setting resource synced condition to false will trigger a requeue of
		// the resource. No need to return a requeue error here.
		ackcondition.SetSynced(r, corev1.ConditionFalse, nil, nil)
		return r, nil
	}

	return &resource{ko}, nil
}

// newCreateRequestPayload returns an SDK-specific struct for the HTTP request
// payload of the Create API call for the resource
func (rm *resourceManager) newCreateRequestPayload(
	ctx context.Context,
	r *resource,
) (*svcsdk.CreateDBClusterInput, error) {
	res := &svcsdk.CreateDBClusterInput{}

	if r.ko.Spec.AllocatedStorage != nil {
		allocatedStorageCopy0 := *r.ko.Spec.AllocatedStorage
		if allocatedStorageCopy0 > math.MaxInt32 || allocatedStorageCopy0 < math.MinInt32 {
			return nil, fmt.Errorf("error: field AllocatedStorage is of type int32")
		}
		allocatedStorageCopy := int32(allocatedStorageCopy0)
		res.AllocatedStorage = &allocatedStorageCopy
	}
	if r.ko.Spec.AutoMinorVersionUpgrade != nil {
		res.AutoMinorVersionUpgrade = r.ko.Spec.AutoMinorVersionUpgrade
	}
	if r.ko.Spec.AvailabilityZones != nil {
		res.AvailabilityZones = aws.ToStringSlice(r.ko.Spec.AvailabilityZones)
	}
	if r.ko.Spec.BacktrackWindow != nil {
		res.BacktrackWindow = r.ko.Spec.BacktrackWindow
	}
	if r.ko.Spec.BackupRetentionPeriod != nil {
		backupRetentionPeriodCopy0 := *r.ko.Spec.BackupRetentionPeriod
		if backupRetentionPeriodCopy0 > math.MaxInt32 || backupRetentionPeriodCopy0 < math.MinInt32 {
			return nil, fmt.Errorf("error: field BackupRetentionPeriod is of type int32")
		}
		backupRetentionPeriodCopy := int32(backupRetentionPeriodCopy0)
		res.BackupRetentionPeriod = &backupRetentionPeriodCopy
	}
	if r.ko.Spec.CharacterSetName != nil {
		res.CharacterSetName = r.ko.Spec.CharacterSetName
	}
	if r.ko.Spec.CopyTagsToSnapshot != nil {
		res.CopyTagsToSnapshot = r.ko.Spec.CopyTagsToSnapshot
	}
	if r.ko.Spec.DBClusterIdentifier != nil {
		res.DBClusterIdentifier = r.ko.Spec.DBClusterIdentifier
	}
	if r.ko.Spec.DBClusterInstanceClass != nil {
		res.DBClusterInstanceClass = r.ko.Spec.DBClusterInstanceClass
	}
	if r.ko.Spec.DBClusterParameterGroupName != nil {
		res.DBClusterParameterGroupName = r.ko.Spec.DBClusterParameterGroupName
	}
	if r.ko.Spec.DBSubnetGroupName != nil {
		res.DBSubnetGroupName = r.ko.Spec.DBSubnetGroupName
	}
	if r.ko.Spec.DBSystemID != nil {
		res.DBSystemId = r.ko.Spec.DBSystemID
	}
	if r.ko.Spec.DatabaseInsightsMode != nil {
		res.DatabaseInsightsMode = svcsdktypes.DatabaseInsightsMode(*r.ko.Spec.DatabaseInsightsMode)
	}
	if r.ko.Spec.DatabaseName != nil {
		res.DatabaseName = r.ko.Spec.DatabaseName
	}
	if r.ko.Spec.DeletionProtection != nil {
		res.DeletionProtection = r.ko.Spec.DeletionProtection
	}
	if r.ko.Spec.Domain != nil {
		res.Domain = r.ko.Spec.Domain
	}
	if r.ko.Spec.DomainIAMRoleName != nil {
		res.DomainIAMRoleName = r.ko.Spec.DomainIAMRoleName
	}
	if r.ko.Spec.EnableCloudwatchLogsExports != nil {
		res.EnableCloudwatchLogsExports = aws.ToStringSlice(r.ko.Spec.EnableCloudwatchLogsExports)
	}
	if r.ko.Spec.EnableGlobalWriteForwarding != nil {
		res.EnableGlobalWriteForwarding = r.ko.Spec.EnableGlobalWriteForwarding
	}
	if r.ko.Spec.EnableHTTPEndpoint != nil {
		res.EnableHttpEndpoint = r.ko.Spec.EnableHTTPEndpoint
	}
	if r.ko.Spec.EnableIAMDatabaseAuthentication != nil {
		res.EnableIAMDatabaseAuthentication = r.ko.Spec.EnableIAMDatabaseAuthentication
	}
	if r.ko.Spec.EnablePerformanceInsights != nil {
		res.EnablePerformanceInsights = r.ko.Spec.EnablePerformanceInsights
	}
	if r.ko.Spec.Engine != nil {
		res.Engine = r.ko.Spec.Engine
	}
	if r.ko.Spec.EngineMode != nil {
		res.EngineMode = r.ko.Spec.EngineMode
	}
	if r.ko.Spec.EngineVersion != nil {
		res.EngineVersion = r.ko.Spec.EngineVersion
	}
	if r.ko.Spec.GlobalClusterIdentifier != nil {
		res.GlobalClusterIdentifier = r.ko.Spec.GlobalClusterIdentifier
	}
	if r.ko.Spec.IOPS != nil {
		iopsCopy0 := *r.ko.Spec.IOPS
		if iopsCopy0 > math.MaxInt32 || iopsCopy0 < math.MinInt32 {
			return nil, fmt.Errorf("error: field Iops is of type int32")
		}
		iopsCopy := int32(iopsCopy0)
		res.Iops = &iopsCopy
	}
	if r.ko.Spec.KMSKeyID != nil {
		res.KmsKeyId = r.ko.Spec.KMSKeyID
	}
	if r.ko.Spec.ManageMasterUserPassword != nil {
		res.ManageMasterUserPassword = r.ko.Spec.ManageMasterUserPassword
	}
	if r.ko.Spec.MasterUserPassword != nil {
		tmpSecret, err := rm.rr.SecretValueFromReference(ctx, r.ko.Spec.MasterUserPassword)
		if err != nil {
			return nil, ackrequeue.Needed(err)
		}
		if tmpSecret != "" {
			res.MasterUserPassword = aws.String(tmpSecret)
		}
	}
	if r.ko.Spec.MasterUserSecretKMSKeyID != nil {
		res.MasterUserSecretKmsKeyId = r.ko.Spec.MasterUserSecretKMSKeyID
	}
	if r.ko.Spec.MasterUsername != nil {
		res.MasterUsername = r.ko.Spec.MasterUsername
	}
	if r.ko.Spec.MonitoringInterval != nil {
		monitoringIntervalCopy0 := *r.ko.Spec.MonitoringInterval
		if monitoringIntervalCopy0 > math.MaxInt32 || monitoringIntervalCopy0 < math.MinInt32 {
			return nil, fmt.Errorf("error: field MonitoringInterval is of type int32")
		}
		monitoringIntervalCopy := int32(monitoringIntervalCopy0)
		res.MonitoringInterval = &monitoringIntervalCopy
	}
	if r.ko.Spec.MonitoringRoleARN != nil {
		res.MonitoringRoleArn = r.ko.Spec.MonitoringRoleARN
	}
	if r.ko.Spec.NetworkType != nil {
		res.NetworkType = r.ko.Spec.NetworkType
	}
	if r.ko.Spec.OptionGroupName != nil {
		res.OptionGroupName = r.ko.Spec.OptionGroupName
	}
	if r.ko.Spec.PerformanceInsightsKMSKeyID != nil {
		res.PerformanceInsightsKMSKeyId = r.ko.Spec.PerformanceInsightsKMSKeyID
	}
	if r.ko.Spec.PerformanceInsightsRetentionPeriod != nil {
		performanceInsightsRetentionPeriodCopy0 := *r.ko.Spec.PerformanceInsightsRetentionPeriod
		if performanceInsightsRetentionPeriodCopy0 > math.MaxInt32 || performanceInsightsRetentionPeriodCopy0 < math.MinInt32 {
			return nil, fmt.Errorf("error: field PerformanceInsightsRetentionPeriod is of type int32")
		}
		performanceInsightsRetentionPeriodCopy := int32(performanceInsightsRetentionPeriodCopy0)
		res.PerformanceInsightsRetentionPeriod = &performanceInsightsRetentionPeriodCopy
	}
	if r.ko.Spec.Port != nil {
		portCopy0 := *r.ko.Spec.Port
		if portCopy0 > math.MaxInt32 || portCopy0 < math.MinInt32 {
			return nil, fmt.Errorf("error: field Port is of type int32")
		}
		portCopy := int32(portCopy0)
		res.Port = &portCopy
	}
	if r.ko.Spec.PreSignedURL != nil {
		res.PreSignedUrl = r.ko.Spec.PreSignedURL
	}
	if r.ko.Spec.PreferredBackupWindow != nil {
		res.PreferredBackupWindow = r.ko.Spec.PreferredBackupWindow
	}
	if r.ko.Spec.PreferredMaintenanceWindow != nil {
		res.PreferredMaintenanceWindow = r.ko.Spec.PreferredMaintenanceWindow
	}
	if r.ko.Spec.PubliclyAccessible != nil {
		res.PubliclyAccessible = r.ko.Spec.PubliclyAccessible
	}
	if r.ko.Spec.ReplicationSourceIdentifier != nil {
		res.ReplicationSourceIdentifier = r.ko.Spec.ReplicationSourceIdentifier
	}
	if r.ko.Spec.ScalingConfiguration != nil {
		f45 := &svcsdktypes.ScalingConfiguration{}
		if r.ko.Spec.ScalingConfiguration.AutoPause != nil {
			f45.AutoPause = r.ko.Spec.ScalingConfiguration.AutoPause
		}
		if r.ko.Spec.ScalingConfiguration.MaxCapacity != nil {
			maxCapacityCopy0 := *r.ko.Spec.ScalingConfiguration.MaxCapacity
			if maxCapacityCopy0 > math.MaxInt32 || maxCapacityCopy0 < math.MinInt32 {
				return nil, fmt.Errorf("error: field MaxCapacity is of type int32")
			}
			maxCapacityCopy := int32(maxCapacityCopy0)
			f45.MaxCapacity = &maxCapacityCopy
		}
		if r.ko.Spec.ScalingConfiguration.MinCapacity != nil {
			minCapacityCopy0 := *r.ko.Spec.ScalingConfiguration.MinCapacity
			if minCapacityCopy0 > math.MaxInt32 || minCapacityCopy0 < math.MinInt32 {
				return nil, fmt.Errorf("error: field MinCapacity is of type int32")
			}
			minCapacityCopy := int32(minCapacityCopy0)
			f45.MinCapacity = &minCapacityCopy
		}
		if r.ko.Spec.ScalingConfiguration.SecondsBeforeTimeout != nil {
			secondsBeforeTimeoutCopy0 := *r.ko.Spec.ScalingConfiguration.SecondsBeforeTimeout
			if secondsBeforeTimeoutCopy0 > math.MaxInt32 || secondsBeforeTimeoutCopy0 < math.MinInt32 {
				return nil, fmt.Errorf("error: field SecondsBeforeTimeout is of type int32")
			}
			secondsBeforeTimeoutCopy := int32(secondsBeforeTimeoutCopy0)
			f45.SecondsBeforeTimeout = &secondsBeforeTimeoutCopy
		}
		if r.ko.Spec.ScalingConfiguration.SecondsUntilAutoPause != nil {
			secondsUntilAutoPauseCopy0 := *r.ko.Spec.ScalingConfiguration.SecondsUntilAutoPause
			if secondsUntilAutoPauseCopy0 > math.MaxInt32 || secondsUntilAutoPauseCopy0 < math.MinInt32 {
				return nil, fmt.Errorf("error: field SecondsUntilAutoPause is of type int32")
			}
			secondsUntilAutoPauseCopy := int32(secondsUntilAutoPauseCopy0)
			f45.SecondsUntilAutoPause = &secondsUntilAutoPauseCopy
		}
		if r.ko.Spec.ScalingConfiguration.TimeoutAction != nil {
			f45.TimeoutAction = r.ko.Spec.ScalingConfiguration.TimeoutAction
		}
		res.ScalingConfiguration = f45
	}
	if r.ko.Spec.ServerlessV2ScalingConfiguration != nil {
		f46 := &svcsdktypes.ServerlessV2ScalingConfiguration{}
		if r.ko.Spec.ServerlessV2ScalingConfiguration.MaxCapacity != nil {
			f46.MaxCapacity = r.ko.Spec.ServerlessV2ScalingConfiguration.MaxCapacity
		}
		if r.ko.Spec.ServerlessV2ScalingConfiguration.MinCapacity != nil {
			f46.MinCapacity = r.ko.Spec.ServerlessV2ScalingConfiguration.MinCapacity
		}
		if r.ko.Spec.ServerlessV2ScalingConfiguration.SecondsUntilAutoPause != nil {
			secondsUntilAutoPauseCopy0 := *r.ko.Spec.ServerlessV2ScalingConfiguration.SecondsUntilAutoPause
			if secondsUntilAutoPauseCopy0 > math.MaxInt32 || secondsUntilAutoPauseCopy0 < math.MinInt32 {
				return nil, fmt.Errorf("error: field SecondsUntilAutoPause is of type int32")
			}
			secondsUntilAutoPauseCopy := int32(secondsUntilAutoPauseCopy0)
			f46.SecondsUntilAutoPause = &secondsUntilAutoPauseCopy
		}
		res.ServerlessV2ScalingConfiguration = f46
	}
	if r.ko.Spec.SourceRegion != nil {
		res.SourceRegion = r.ko.Spec.SourceRegion
	}
	if r.ko.Spec.StorageEncrypted != nil {
		res.StorageEncrypted = r.ko.Spec.StorageEncrypted
	}
	if r.ko.Spec.StorageType != nil {
		res.StorageType = r.ko.Spec.StorageType
	}
	if r.ko.Spec.Tags != nil {
		f50 := []svcsdktypes.Tag{}
		for _, f50iter := range r.ko.Spec.Tags {
			f50elem := &svcsdktypes.Tag{}
			if f50iter.Key != nil {
				f50elem.Key = f50iter.Key
			}
			if f50iter.Value != nil {
				f50elem.Value = f50iter.Value
			}
			f50 = append(f50, *f50elem)
		}
		res.Tags = f50
	}
	if r.ko.Spec.VPCSecurityGroupIDs != nil {
		res.VpcSecurityGroupIds = aws.ToStringSlice(r.ko.Spec.VPCSecurityGroupIDs)
	}

	return res, nil
}

// sdkUpdate patches the supplied resource in the backend AWS service API and
// returns a new resource with updated fields.
func (rm *resourceManager) sdkUpdate(
	ctx context.Context,
	desired *resource,
	latest *resource,
	delta *ackcompare.Delta,
) (*resource, error) {
	return rm.customUpdate(ctx, desired, latest, delta)
}

// sdkDelete deletes the supplied resource in the backend AWS service API
func (rm *resourceManager) sdkDelete(
	ctx context.Context,
	r *resource,
) (latest *resource, err error) {
	rlog := ackrtlog.FromContext(ctx)
	exit := rlog.Trace("rm.sdkDelete")
	defer func() {
		exit(err)
	}()
	if clusterDeleting(r) {
		return r, requeueWaitWhileDeleting
	}

	input, err := rm.newDeleteRequestPayload(r)
	if err != nil {
		return nil, err
	}
	err = setDeleteDBClusterInput(r, input)
	if err != nil {
		return nil, err
	}

	var resp *svcsdk.DeleteDBClusterOutput
	_ = resp
	resp, err = rm.sdkapi.DeleteDBCluster(ctx, input)
	rm.metrics.RecordAPICall("DELETE", "DeleteDBCluster", err)
	return nil, err
}

// newDeleteRequestPayload returns an SDK-specific struct for the HTTP request
// payload of the Delete API call for the resource
func (rm *resourceManager) newDeleteRequestPayload(
	r *resource,
) (*svcsdk.DeleteDBClusterInput, error) {
	res := &svcsdk.DeleteDBClusterInput{}

	if r.ko.Spec.DBClusterIdentifier != nil {
		res.DBClusterIdentifier = r.ko.Spec.DBClusterIdentifier
	}

	return res, nil
}

// setStatusDefaults sets default properties into supplied custom resource
func (rm *resourceManager) setStatusDefaults(
	ko *svcapitypes.DBCluster,
) {
	if ko.Status.ACKResourceMetadata == nil {
		ko.Status.ACKResourceMetadata = &ackv1alpha1.ResourceMetadata{}
	}
	if ko.Status.ACKResourceMetadata.Region == nil {
		ko.Status.ACKResourceMetadata.Region = &rm.awsRegion
	}
	if ko.Status.ACKResourceMetadata.OwnerAccountID == nil {
		ko.Status.ACKResourceMetadata.OwnerAccountID = &rm.awsAccountID
	}
	if ko.Status.Conditions == nil {
		ko.Status.Conditions = []*ackv1alpha1.Condition{}
	}
}

// updateConditions returns updated resource, true; if conditions were updated
// else it returns nil, false
func (rm *resourceManager) updateConditions(
	r *resource,
	onSuccess bool,
	err error,
) (*resource, bool) {
	ko := r.ko.DeepCopy()
	rm.setStatusDefaults(ko)

	// Terminal condition
	var terminalCondition *ackv1alpha1.Condition = nil
	var recoverableCondition *ackv1alpha1.Condition = nil
	var syncCondition *ackv1alpha1.Condition = nil
	for _, condition := range ko.Status.Conditions {
		if condition.Type == ackv1alpha1.ConditionTypeTerminal {
			terminalCondition = condition
		}
		if condition.Type == ackv1alpha1.ConditionTypeRecoverable {
			recoverableCondition = condition
		}
		if condition.Type == ackv1alpha1.ConditionTypeResourceSynced {
			syncCondition = condition
		}
	}
	var termError *ackerr.TerminalError
	if rm.terminalAWSError(err) || err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound || errors.As(err, &termError) {
		if terminalCondition == nil {
			terminalCondition = &ackv1alpha1.Condition{
				Type: ackv1alpha1.ConditionTypeTerminal,
			}
			ko.Status.Conditions = append(ko.Status.Conditions, terminalCondition)
		}
		var errorMessage = ""
		if err == ackerr.SecretTypeNotSupported || err == ackerr.SecretNotFound || errors.As(err, &termError) {
			errorMessage = err.Error()
		} else {
			awsErr, _ := ackerr.AWSError(err)
			errorMessage = awsErr.Error()
		}
		terminalCondition.Status = corev1.ConditionTrue
		terminalCondition.Message = &errorMessage
	} else {
		// Clear the terminal condition if no longer present
		if terminalCondition != nil {
			terminalCondition.Status = corev1.ConditionFalse
			terminalCondition.Message = nil
		}
		// Handling Recoverable Conditions
		if err != nil {
			if recoverableCondition == nil {
				// Add a new Condition containing a non-terminal error
				recoverableCondition = &ackv1alpha1.Condition{
					Type: ackv1alpha1.ConditionTypeRecoverable,
				}
				ko.Status.Conditions = append(ko.Status.Conditions, recoverableCondition)
			}
			recoverableCondition.Status = corev1.ConditionTrue
			awsErr, _ := ackerr.AWSError(err)
			errorMessage := err.Error()
			if awsErr != nil {
				errorMessage = awsErr.Error()
			}
			recoverableCondition.Message = &errorMessage
		} else if recoverableCondition != nil {
			recoverableCondition.Status = corev1.ConditionFalse
			recoverableCondition.Message = nil
		}
	}
	// Required to avoid the "declared but not used" error in the default case
	_ = syncCondition
	if terminalCondition != nil || recoverableCondition != nil || syncCondition != nil {
		return &resource{ko}, true // updated
	}
	return nil, false // not updated
}

// terminalAWSError returns awserr, true; if the supplied error is an aws Error type
// and if the exception indicates that it is a Terminal exception
// 'Terminal' exception are specified in generator configuration
func (rm *resourceManager) terminalAWSError(err error) bool {
	if err == nil {
		return false
	}

	var terminalErr smithy.APIError
	if !errors.As(err, &terminalErr) {
		return false
	}
	switch terminalErr.ErrorCode() {
	case "DBClusterQuotaExceededFault",
		"DBSubnetGroupDoesNotCoverEnoughAZs",
		"InsufficientStorageClusterCapacity",
		"InvalidParameter",
		"InvalidParameterValue",
		"InvalidParameterCombination",
		"InvalidSubnet",
		"StorageQuotaExceeded",
		"StorageTypeNotAvailableFault":
		return true
	default:
		return false
	}
}

// newRestoreDBClusterFromSnapshotInput returns a RestoreDBClusterFromSnapshotInput object
// with each the field set by the corresponding configuration's fields.
func (rm *resourceManager) newRestoreDBClusterFromSnapshotInput(
	r *resource,
) (*svcsdk.RestoreDBClusterFromSnapshotInput, error) {
	res := &svcsdk.RestoreDBClusterFromSnapshotInput{}

	if r.ko.Spec.AvailabilityZones != nil {
		res.AvailabilityZones = aws.ToStringSlice(r.ko.Spec.AvailabilityZones)
	}
	if r.ko.Spec.BacktrackWindow != nil {
		res.BacktrackWindow = r.ko.Spec.BacktrackWindow
	}
	if r.ko.Spec.CopyTagsToSnapshot != nil {
		res.CopyTagsToSnapshot = r.ko.Spec.CopyTagsToSnapshot
	}
	if r.ko.Spec.DBClusterIdentifier != nil {
		res.DBClusterIdentifier = r.ko.Spec.DBClusterIdentifier
	}
	if r.ko.Spec.DBClusterInstanceClass != nil {
		res.DBClusterInstanceClass = r.ko.Spec.DBClusterInstanceClass
	}
	if r.ko.Spec.DBClusterParameterGroupName != nil {
		res.DBClusterParameterGroupName = r.ko.Spec.DBClusterParameterGroupName
	}
	if r.ko.Spec.DBSubnetGroupName != nil {
		res.DBSubnetGroupName = r.ko.Spec.DBSubnetGroupName
	}
	if r.ko.Spec.DatabaseName != nil {
		res.DatabaseName = r.ko.Spec.DatabaseName
	}
	if r.ko.Spec.DeletionProtection != nil {
		res.DeletionProtection = r.ko.Spec.DeletionProtection
	}
	if r.ko.Spec.Domain != nil {
		res.Domain = r.ko.Spec.Domain
	}
	if r.ko.Spec.DomainIAMRoleName != nil {
		res.DomainIAMRoleName = r.ko.Spec.DomainIAMRoleName
	}
	if r.ko.Spec.EnableCloudwatchLogsExports != nil {
		res.EnableCloudwatchLogsExports = aws.ToStringSlice(r.ko.Spec.EnableCloudwatchLogsExports)
	}
	if r.ko.Spec.EnableIAMDatabaseAuthentication != nil {
		res.EnableIAMDatabaseAuthentication = r.ko.Spec.EnableIAMDatabaseAuthentication
	}
	if r.ko.Spec.EnablePerformanceInsights != nil {
		res.EnablePerformanceInsights = r.ko.Spec.EnablePerformanceInsights
	}
	if r.ko.Spec.Engine != nil {
		res.Engine = r.ko.Spec.Engine
	}
	if r.ko.Spec.EngineMode != nil {
		res.EngineMode = r.ko.Spec.EngineMode
	}
	if r.ko.Spec.EngineVersion != nil {
		res.EngineVersion = r.ko.Spec.EngineVersion
	}
	if r.ko.Spec.IOPS != nil {
		iopsCopy0 := *r.ko.Spec.IOPS
		if iopsCopy0 > math.MaxInt32 || iopsCopy0 < math.MinInt32 {
			return nil, fmt.Errorf("error: field Iops is of type int32")
		}
		iopsCopy := int32(iopsCopy0)
		res.Iops = &iopsCopy
	}
	if r.ko.Spec.KMSKeyID != nil {
		res.KmsKeyId = r.ko.Spec.KMSKeyID
	}
	if r.ko.Spec.MonitoringInterval != nil {
		monitoringIntervalCopy0 := *r.ko.Spec.MonitoringInterval
		if monitoringIntervalCopy0 > math.MaxInt32 || monitoringIntervalCopy0 < math.MinInt32 {
			return nil, fmt.Errorf("error: field MonitoringInterval is of type int32")
		}
		monitoringIntervalCopy := int32(monitoringIntervalCopy0)
		res.MonitoringInterval = &monitoringIntervalCopy
	}
	if r.ko.Spec.MonitoringRoleARN != nil {
		res.MonitoringRoleArn = r.ko.Spec.MonitoringRoleARN
	}
	if r.ko.Spec.NetworkType != nil {
		res.NetworkType = r.ko.Spec.NetworkType
	}
	if r.ko.Spec.OptionGroupName != nil {
		res.OptionGroupName = r.ko.Spec.OptionGroupName
	}
	if r.ko.Spec.PerformanceInsightsKMSKeyID != nil {
		res.PerformanceInsightsKMSKeyId = r.ko.Spec.PerformanceInsightsKMSKeyID
	}
	if r.ko.Spec.PerformanceInsightsRetentionPeriod != nil {
		performanceInsightsRetentionPeriodCopy0 := *r.ko.Spec.PerformanceInsightsRetentionPeriod
		if performanceInsightsRetentionPeriodCopy0 > math.MaxInt32 || performanceInsightsRetentionPeriodCopy0 < math.MinInt32 {
			return nil, fmt.Errorf("error: field PerformanceInsightsRetentionPeriod is of type int32")
		}
		performanceInsightsRetentionPeriodCopy := int32(performanceInsightsRetentionPeriodCopy0)
		res.PerformanceInsightsRetentionPeriod = &performanceInsightsRetentionPeriodCopy
	}
	if r.ko.Spec.Port != nil {
		portCopy0 := *r.ko.Spec.Port
		if portCopy0 > math.MaxInt32 || portCopy0 < math.MinInt32 {
			return nil, fmt.Errorf("error: field Port is of type int32")
		}
		portCopy := int32(portCopy0)
		res.Port = &portCopy
	}
	if r.ko.Spec.PubliclyAccessible != nil {
		res.PubliclyAccessible = r.ko.Spec.PubliclyAccessible
	}
	if r.ko.Spec.ScalingConfiguration != nil {
		resf27 := &svcsdktypes.ScalingConfiguration{}
		if r.ko.Spec.ScalingConfiguration.AutoPause != nil {
			resf27.AutoPause = r.ko.Spec.ScalingConfiguration.AutoPause
		}
		if r.ko.Spec.ScalingConfiguration.MaxCapacity != nil {
			maxCapacityCopy0 := *r.ko.Spec.ScalingConfiguration.MaxCapacity
			if maxCapacityCopy0 > math.MaxInt32 || maxCapacityCopy0 < math.MinInt32 {
				return nil, fmt.Errorf("error: field MaxCapacity is of type int32")
			}
			maxCapacityCopy := int32(maxCapacityCopy0)
			resf27.MaxCapacity = &maxCapacityCopy
		}
		if r.ko.Spec.ScalingConfiguration.MinCapacity != nil {
			minCapacityCopy0 := *r.ko.Spec.ScalingConfiguration.MinCapacity
			if minCapacityCopy0 > math.MaxInt32 || minCapacityCopy0 < math.MinInt32 {
				return nil, fmt.Errorf("error: field MinCapacity is of type int32")
			}
			minCapacityCopy := int32(minCapacityCopy0)
			resf27.MinCapacity = &minCapacityCopy
		}
		if r.ko.Spec.ScalingConfiguration.SecondsBeforeTimeout != nil {
			secondsBeforeTimeoutCopy0 := *r.ko.Spec.ScalingConfiguration.SecondsBeforeTimeout
			if secondsBeforeTimeoutCopy0 > math.MaxInt32 || secondsBeforeTimeoutCopy0 < math.MinInt32 {
				return nil, fmt.Errorf("error: field SecondsBeforeTimeout is of type int32")
			}
			secondsBeforeTimeoutCopy := int32(secondsBeforeTimeoutCopy0)
			resf27.SecondsBeforeTimeout = &secondsBeforeTimeoutCopy
		}
		if r.ko.Spec.ScalingConfiguration.SecondsUntilAutoPause != nil {
			secondsUntilAutoPauseCopy0 := *r.ko.Spec.ScalingConfiguration.SecondsUntilAutoPause
			if secondsUntilAutoPauseCopy0 > math.MaxInt32 || secondsUntilAutoPauseCopy0 < math.MinInt32 {
				return nil, fmt.Errorf("error: field SecondsUntilAutoPause is of type int32")
			}
			secondsUntilAutoPauseCopy := int32(secondsUntilAutoPauseCopy0)
			resf27.SecondsUntilAutoPause = &secondsUntilAutoPauseCopy
		}
		if r.ko.Spec.ScalingConfiguration.TimeoutAction != nil {
			resf27.TimeoutAction = r.ko.Spec.ScalingConfiguration.TimeoutAction
		}
		res.ScalingConfiguration = resf27
	}
	if r.ko.Spec.ServerlessV2ScalingConfiguration != nil {
		resf28 := &svcsdktypes.ServerlessV2ScalingConfiguration{}
		if r.ko.Spec.ServerlessV2ScalingConfiguration.MaxCapacity != nil {
			resf28.MaxCapacity = r.ko.Spec.ServerlessV2ScalingConfiguration.MaxCapacity
		}
		if r.ko.Spec.ServerlessV2ScalingConfiguration.MinCapacity != nil {
			resf28.MinCapacity = r.ko.Spec.ServerlessV2ScalingConfiguration.MinCapacity
		}
		if r.ko.Spec.ServerlessV2ScalingConfiguration.SecondsUntilAutoPause != nil {
			secondsUntilAutoPauseCopy0 := *r.ko.Spec.ServerlessV2ScalingConfiguration.SecondsUntilAutoPause
			if secondsUntilAutoPauseCopy0 > math.MaxInt32 || secondsUntilAutoPauseCopy0 < math.MinInt32 {
				return nil, fmt.Errorf("error: field SecondsUntilAutoPause is of type int32")
			}
			secondsUntilAutoPauseCopy := int32(secondsUntilAutoPauseCopy0)
			resf28.SecondsUntilAutoPause = &secondsUntilAutoPauseCopy
		}
		res.ServerlessV2ScalingConfiguration = resf28
	}
	if r.ko.Spec.SnapshotIdentifier != nil {
		res.SnapshotIdentifier = r.ko.Spec.SnapshotIdentifier
	}
	if r.ko.Spec.StorageType != nil {
		res.StorageType = r.ko.Spec.StorageType
	}
	if r.ko.Spec.Tags != nil {
		resf31 := []svcsdktypes.Tag{}
		for _, resf31iter := range r.ko.Spec.Tags {
			resf31elem := &svcsdktypes.Tag{}
			if resf31iter.Key != nil {
				resf31elem.Key = resf31iter.Key
			}
			if resf31iter.Value != nil {
				resf31elem.Value = resf31iter.Value
			}
			resf31 = append(resf31, *resf31elem)
		}
		res.Tags = resf31
	}
	if r.ko.Spec.VPCSecurityGroupIDs != nil {
		res.VpcSecurityGroupIds = aws.ToStringSlice(r.ko.Spec.VPCSecurityGroupIDs)
	}

	return res, nil
}

// setResourceFromRestoreDBClusterFromSnapshotOutput sets a resource RestoreDBClusterFromSnapshotOutput type
// given the SDK type.
func (rm *resourceManager) setResourceFromRestoreDBClusterFromSnapshotOutput(
	r *resource,
	resp *svcsdk.RestoreDBClusterFromSnapshotOutput,
) {

	if resp.DBCluster.ActivityStreamKinesisStreamName != nil {
		r.ko.Status.ActivityStreamKinesisStreamName = resp.DBCluster.ActivityStreamKinesisStreamName
	} else {
		r.ko.Status.ActivityStreamKinesisStreamName = nil
	}
	if resp.DBCluster.ActivityStreamKmsKeyId != nil {
		r.ko.Status.ActivityStreamKMSKeyID = resp.DBCluster.ActivityStreamKmsKeyId
	} else {
		r.ko.Status.ActivityStreamKMSKeyID = nil
	}
	if resp.DBCluster.ActivityStreamMode != "" {
		r.ko.Status.ActivityStreamMode = aws.String(string(resp.DBCluster.ActivityStreamMode))
	} else {
		r.ko.Status.ActivityStreamMode = nil
	}
	if resp.DBCluster.ActivityStreamStatus != "" {
		r.ko.Status.ActivityStreamStatus = aws.String(string(resp.DBCluster.ActivityStreamStatus))
	} else {
		r.ko.Status.ActivityStreamStatus = nil
	}
	if resp.DBCluster.AllocatedStorage != nil {
		allocatedStorageCopy := int64(*resp.DBCluster.AllocatedStorage)
		r.ko.Spec.AllocatedStorage = &allocatedStorageCopy
	} else {
		r.ko.Spec.AllocatedStorage = nil
	}
	if resp.DBCluster.AssociatedRoles != nil {
		f5 := []*svcapitypes.DBClusterRole{}
		for _, f5iter := range resp.DBCluster.AssociatedRoles {
			f5elem := &svcapitypes.DBClusterRole{}
			if f5iter.FeatureName != nil {
				f5elem.FeatureName = f5iter.FeatureName
			}
			if f5iter.RoleArn != nil {
				f5elem.RoleARN = f5iter.RoleArn
			}
			if f5iter.Status != nil {
				f5elem.Status = f5iter.Status
			}
			f5 = append(f5, f5elem)
		}
		r.ko.Status.AssociatedRoles = f5
	} else {
		r.ko.Status.AssociatedRoles = nil
	}
	if resp.DBCluster.AutoMinorVersionUpgrade != nil {
		r.ko.Spec.AutoMinorVersionUpgrade = resp.DBCluster.AutoMinorVersionUpgrade
	} else {
		r.ko.Spec.AutoMinorVersionUpgrade = nil
	}
	if resp.DBCluster.AutomaticRestartTime != nil {
		r.ko.Status.AutomaticRestartTime = &metav1.Time{*resp.DBCluster.AutomaticRestartTime}
	} else {
		r.ko.Status.AutomaticRestartTime = nil
	}
	if resp.DBCluster.AvailabilityZones != nil {
		r.ko.Spec.AvailabilityZones = aws.StringSlice(resp.DBCluster.AvailabilityZones)
	} else {
		r.ko.Spec.AvailabilityZones = nil
	}
	if resp.DBCluster.BacktrackConsumedChangeRecords != nil {
		r.ko.Status.BacktrackConsumedChangeRecords = resp.DBCluster.BacktrackConsumedChangeRecords
	} else {
		r.ko.Status.BacktrackConsumedChangeRecords = nil
	}
	if resp.DBCluster.BacktrackWindow != nil {
		r.ko.Spec.BacktrackWindow = resp.DBCluster.BacktrackWindow
	} else {
		r.ko.Spec.BacktrackWindow = nil
	}
	if resp.DBCluster.BackupRetentionPeriod != nil {
		backupRetentionPeriodCopy := int64(*resp.DBCluster.BackupRetentionPeriod)
		r.ko.Spec.BackupRetentionPeriod = &backupRetentionPeriodCopy
	} else {
		r.ko.Spec.BackupRetentionPeriod = nil
	}
	if resp.DBCluster.Capacity != nil {
		capacityCopy := int64(*resp.DBCluster.Capacity)
		r.ko.Status.Capacity = &capacityCopy
	} else {
		r.ko.Status.Capacity = nil
	}
	if resp.DBCluster.CharacterSetName != nil {
		r.ko.Spec.CharacterSetName = resp.DBCluster.CharacterSetName
	} else {
		r.ko.Spec.CharacterSetName = nil
	}
	if resp.DBCluster.CloneGroupId != nil {
		r.ko.Status.CloneGroupID = resp.DBCluster.CloneGroupId
	} else {
		r.ko.Status.CloneGroupID = nil
	}
	if resp.DBCluster.ClusterCreateTime != nil {
		r.ko.Status.ClusterCreateTime = &metav1.Time{*resp.DBCluster.ClusterCreateTime}
	} else {
		r.ko.Status.ClusterCreateTime = nil
	}
	if resp.DBCluster.CopyTagsToSnapshot != nil {
		r.ko.Spec.CopyTagsToSnapshot = resp.DBCluster.CopyTagsToSnapshot
	} else {
		r.ko.Spec.CopyTagsToSnapshot = nil
	}
	if resp.DBCluster.CrossAccountClone != nil {
		r.ko.Status.CrossAccountClone = resp.DBCluster.CrossAccountClone
	} else {
		r.ko.Status.CrossAccountClone = nil
	}
	if resp.DBCluster.CustomEndpoints != nil {
		r.ko.Status.CustomEndpoints = aws.StringSlice(resp.DBCluster.CustomEndpoints)
	} else {
		r.ko.Status.CustomEndpoints = nil
	}
	if r.ko.Status.ACKResourceMetadata == nil {
		r.ko.Status.ACKResourceMetadata = &ackv1alpha1.ResourceMetadata{}
	}
	if resp.DBCluster.DBClusterArn != nil {
		arn := ackv1alpha1.AWSResourceName(*resp.DBCluster.DBClusterArn)
		r.ko.Status.ACKResourceMetadata.ARN = &arn
	}
	if resp.DBCluster.DBClusterIdentifier != nil {
		r.ko.Spec.DBClusterIdentifier = resp.DBCluster.DBClusterIdentifier
	} else {
		r.ko.Spec.DBClusterIdentifier = nil
	}
	if resp.DBCluster.DBClusterInstanceClass != nil {
		r.ko.Spec.DBClusterInstanceClass = resp.DBCluster.DBClusterInstanceClass
	} else {
		r.ko.Spec.DBClusterInstanceClass = nil
	}
	if resp.DBCluster.DBClusterMembers != nil {
		f22 := []*svcapitypes.DBClusterMember{}
		for _, f22iter := range resp.DBCluster.DBClusterMembers {
			f22elem := &svcapitypes.DBClusterMember{}
			if f22iter.DBClusterParameterGroupStatus != nil {
				f22elem.DBClusterParameterGroupStatus = f22iter.DBClusterParameterGroupStatus
			}
			if f22iter.DBInstanceIdentifier != nil {
				f22elem.DBInstanceIdentifier = f22iter.DBInstanceIdentifier
			}
			if f22iter.IsClusterWriter != nil {
				f22elem.IsClusterWriter = f22iter.IsClusterWriter
			}
			if f22iter.PromotionTier != nil {
				promotionTierCopy := int64(*f22iter.PromotionTier)
				f22elem.PromotionTier = &promotionTierCopy
			}
			f22 = append(f22, f22elem)
		}
		r.ko.Status.DBClusterMembers = f22
	} else {
		r.ko.Status.DBClusterMembers = nil
	}
	if resp.DBCluster.DBClusterOptionGroupMemberships != nil {
		f23 := []*svcapitypes.DBClusterOptionGroupStatus{}
		for _, f23iter := range resp.DBCluster.DBClusterOptionGroupMemberships {
			f23elem := &svcapitypes.DBClusterOptionGroupStatus{}
			if f23iter.DBClusterOptionGroupName != nil {
				f23elem.DBClusterOptionGroupName = f23iter.DBClusterOptionGroupName
			}
			if f23iter.Status != nil {
				f23elem.Status = f23iter.Status
			}
			f23 = append(f23, f23elem)
		}
		r.ko.Status.DBClusterOptionGroupMemberships = f23
	} else {
		r.ko.Status.DBClusterOptionGroupMemberships = nil
	}
	if resp.DBCluster.DBClusterParameterGroup != nil {
		r.ko.Status.DBClusterParameterGroup = resp.DBCluster.DBClusterParameterGroup
	} else {
		r.ko.Status.DBClusterParameterGroup = nil
	}
	if resp.DBCluster.DBSubnetGroup != nil {
		r.ko.Status.DBSubnetGroup = resp.DBCluster.DBSubnetGroup
	} else {
		r.ko.Status.DBSubnetGroup = nil
	}
	if resp.DBCluster.DBSystemId != nil {
		r.ko.Spec.DBSystemID = resp.DBCluster.DBSystemId
	} else {
		r.ko.Spec.DBSystemID = nil
	}
	if resp.DBCluster.DatabaseInsightsMode != "" {
		r.ko.Spec.DatabaseInsightsMode = aws.String(string(resp.DBCluster.DatabaseInsightsMode))
	} else {
		r.ko.Spec.DatabaseInsightsMode = nil
	}
	if resp.DBCluster.DatabaseName != nil {
		r.ko.Spec.DatabaseName = resp.DBCluster.DatabaseName
	} else {
		r.ko.Spec.DatabaseName = nil
	}
	if resp.DBCluster.DbClusterResourceId != nil {
		r.ko.Status.DBClusterResourceID = resp.DBCluster.DbClusterResourceId
	} else {
		r.ko.Status.DBClusterResourceID = nil
	}
	if resp.DBCluster.DeletionProtection != nil {
		r.ko.Spec.DeletionProtection = resp.DBCluster.DeletionProtection
	} else {
		r.ko.Spec.DeletionProtection = nil
	}
	if resp.DBCluster.DomainMemberships != nil {
		f31 := []*svcapitypes.DomainMembership{}
		for _, f31iter := range resp.DBCluster.DomainMemberships {
			f31elem := &svcapitypes.DomainMembership{}
			if f31iter.Domain != nil {
				f31elem.Domain = f31iter.Domain
			}
			if f31iter.FQDN != nil {
				f31elem.FQDN = f31iter.FQDN
			}
			if f31iter.IAMRoleName != nil {
				f31elem.IAMRoleName = f31iter.IAMRoleName
			}
			if f31iter.Status != nil {
				f31elem.Status = f31iter.Status
			}
			f31 = append(f31, f31elem)
		}
		r.ko.Status.DomainMemberships = f31
	} else {
		r.ko.Status.DomainMemberships = nil
	}
	if resp.DBCluster.EarliestBacktrackTime != nil {
		r.ko.Status.EarliestBacktrackTime = &metav1.Time{*resp.DBCluster.EarliestBacktrackTime}
	} else {
		r.ko.Status.EarliestBacktrackTime = nil
	}
	if resp.DBCluster.EarliestRestorableTime != nil {
		r.ko.Status.EarliestRestorableTime = &metav1.Time{*resp.DBCluster.EarliestRestorableTime}
	} else {
		r.ko.Status.EarliestRestorableTime = nil
	}
	if resp.DBCluster.EnabledCloudwatchLogsExports != nil {
		r.ko.Status.EnabledCloudwatchLogsExports = aws.StringSlice(resp.DBCluster.EnabledCloudwatchLogsExports)
	} else {
		r.ko.Status.EnabledCloudwatchLogsExports = nil
	}
	if resp.DBCluster.Endpoint != nil {
		r.ko.Status.Endpoint = resp.DBCluster.Endpoint
	} else {
		r.ko.Status.Endpoint = nil
	}
	if resp.DBCluster.Engine != nil {
		r.ko.Spec.Engine = resp.DBCluster.Engine
	} else {
		r.ko.Spec.Engine = nil
	}
	if resp.DBCluster.EngineMode != nil {
		r.ko.Spec.EngineMode = resp.DBCluster.EngineMode
	} else {
		r.ko.Spec.EngineMode = nil
	}
	if resp.DBCluster.EngineVersion != nil {
		r.ko.Spec.EngineVersion = resp.DBCluster.EngineVersion
	} else {
		r.ko.Spec.EngineVersion = nil
	}
	if resp.DBCluster.GlobalWriteForwardingRequested != nil {
		r.ko.Status.GlobalWriteForwardingRequested = resp.DBCluster.GlobalWriteForwardingRequested
	} else {
		r.ko.Status.GlobalWriteForwardingRequested = nil
	}
	if resp.DBCluster.GlobalWriteForwardingStatus != "" {
		r.ko.Status.GlobalWriteForwardingStatus = aws.String(string(resp.DBCluster.GlobalWriteForwardingStatus))
	} else {
		r.ko.Status.GlobalWriteForwardingStatus = nil
	}
	if resp.DBCluster.HostedZoneId != nil {
		r.ko.Status.HostedZoneID = resp.DBCluster.HostedZoneId
	} else {
		r.ko.Status.HostedZoneID = nil
	}
	if resp.DBCluster.HttpEndpointEnabled != nil {
		r.ko.Status.HTTPEndpointEnabled = resp.DBCluster.HttpEndpointEnabled
	} else {
		r.ko.Status.HTTPEndpointEnabled = nil
	}
	if resp.DBCluster.IAMDatabaseAuthenticationEnabled != nil {
		r.ko.Status.IAMDatabaseAuthenticationEnabled = resp.DBCluster.IAMDatabaseAuthenticationEnabled
	} else {
		r.ko.Status.IAMDatabaseAuthenticationEnabled = nil
	}
	if resp.DBCluster.Iops != nil {
		iopsCopy := int64(*resp.DBCluster.Iops)
		r.ko.Spec.IOPS = &iopsCopy
	} else {
		r.ko.Spec.IOPS = nil
	}
	if resp.DBCluster.KmsKeyId != nil {
		r.ko.Spec.KMSKeyID = resp.DBCluster.KmsKeyId
	} else {
		r.ko.Spec.KMSKeyID = nil
	}
	if resp.DBCluster.LatestRestorableTime != nil {
		r.ko.Status.LatestRestorableTime = &metav1.Time{*resp.DBCluster.LatestRestorableTime}
	} else {
		r.ko.Status.LatestRestorableTime = nil
	}
	if resp.DBCluster.MasterUserSecret != nil {
		f47 := &svcapitypes.MasterUserSecret{}
		if resp.DBCluster.MasterUserSecret.KmsKeyId != nil {
			f47.KMSKeyID = resp.DBCluster.MasterUserSecret.KmsKeyId
		}
		if resp.DBCluster.MasterUserSecret.SecretArn != nil {
			f47.SecretARN = resp.DBCluster.MasterUserSecret.SecretArn
		}
		if resp.DBCluster.MasterUserSecret.SecretStatus != nil {
			f47.SecretStatus = resp.DBCluster.MasterUserSecret.SecretStatus
		}
		r.ko.Status.MasterUserSecret = f47
	} else {
		r.ko.Status.MasterUserSecret = nil
	}
	if resp.DBCluster.MasterUsername != nil {
		r.ko.Spec.MasterUsername = resp.DBCluster.MasterUsername
	} else {
		r.ko.Spec.MasterUsername = nil
	}
	if resp.DBCluster.MonitoringInterval != nil {
		monitoringIntervalCopy := int64(*resp.DBCluster.MonitoringInterval)
		r.ko.Spec.MonitoringInterval = &monitoringIntervalCopy
	} else {
		r.ko.Spec.MonitoringInterval = nil
	}
	if resp.DBCluster.MonitoringRoleArn != nil {
		r.ko.Spec.MonitoringRoleARN = resp.DBCluster.MonitoringRoleArn
	} else {
		r.ko.Spec.MonitoringRoleARN = nil
	}
	if resp.DBCluster.MultiAZ != nil {
		r.ko.Status.MultiAZ = resp.DBCluster.MultiAZ
	} else {
		r.ko.Status.MultiAZ = nil
	}
	if resp.DBCluster.NetworkType != nil {
		r.ko.Spec.NetworkType = resp.DBCluster.NetworkType
	} else {
		r.ko.Spec.NetworkType = nil
	}
	if resp.DBCluster.PendingModifiedValues != nil {
		f53 := &svcapitypes.ClusterPendingModifiedValues{}
		if resp.DBCluster.PendingModifiedValues.AllocatedStorage != nil {
			allocatedStorageCopy := int64(*resp.DBCluster.PendingModifiedValues.AllocatedStorage)
			f53.AllocatedStorage = &allocatedStorageCopy
		}
		if resp.DBCluster.PendingModifiedValues.BackupRetentionPeriod != nil {
			backupRetentionPeriodCopy := int64(*resp.DBCluster.PendingModifiedValues.BackupRetentionPeriod)
			f53.BackupRetentionPeriod = &backupRetentionPeriodCopy
		}
		if resp.DBCluster.PendingModifiedValues.DBClusterIdentifier != nil {
			f53.DBClusterIdentifier = resp.DBCluster.PendingModifiedValues.DBClusterIdentifier
		}
		if resp.DBCluster.PendingModifiedValues.EngineVersion != nil {
			f53.EngineVersion = resp.DBCluster.PendingModifiedValues.EngineVersion
		}
		if resp.DBCluster.PendingModifiedValues.IAMDatabaseAuthenticationEnabled != nil {
			f53.IAMDatabaseAuthenticationEnabled = resp.DBCluster.PendingModifiedValues.IAMDatabaseAuthenticationEnabled
		}
		if resp.DBCluster.PendingModifiedValues.Iops != nil {
			iopsCopy := int64(*resp.DBCluster.PendingModifiedValues.Iops)
			f53.IOPS = &iopsCopy
		}
		if resp.DBCluster.PendingModifiedValues.MasterUserPassword != nil {
			f53.MasterUserPassword = resp.DBCluster.PendingModifiedValues.MasterUserPassword
		}
		if resp.DBCluster.PendingModifiedValues.PendingCloudwatchLogsExports != nil {
			f53f7 := &svcapitypes.PendingCloudwatchLogsExports{}
			if resp.DBCluster.PendingModifiedValues.PendingCloudwatchLogsExports.LogTypesToDisable != nil {
				f53f7.LogTypesToDisable = aws.StringSlice(resp.DBCluster.PendingModifiedValues.PendingCloudwatchLogsExports.LogTypesToDisable)
			}
			if resp.DBCluster.PendingModifiedValues.PendingCloudwatchLogsExports.LogTypesToEnable != nil {
				f53f7.LogTypesToEnable = aws.StringSlice(resp.DBCluster.PendingModifiedValues.PendingCloudwatchLogsExports.LogTypesToEnable)
			}
			f53.PendingCloudwatchLogsExports = f53f7
		}
		r.ko.Status.PendingModifiedValues = f53
	} else {
		r.ko.Status.PendingModifiedValues = nil
	}
	if resp.DBCluster.PercentProgress != nil {
		r.ko.Status.PercentProgress = resp.DBCluster.PercentProgress
	} else {
		r.ko.Status.PercentProgress = nil
	}
	if resp.DBCluster.PerformanceInsightsEnabled != nil {
		r.ko.Status.PerformanceInsightsEnabled = resp.DBCluster.PerformanceInsightsEnabled
	} else {
		r.ko.Status.PerformanceInsightsEnabled = nil
	}
	if resp.DBCluster.PerformanceInsightsKMSKeyId != nil {
		r.ko.Spec.PerformanceInsightsKMSKeyID = resp.DBCluster.PerformanceInsightsKMSKeyId
	} else {
		r.ko.Spec.PerformanceInsightsKMSKeyID = nil
	}
	if resp.DBCluster.PerformanceInsightsRetentionPeriod != nil {
		performanceInsightsRetentionPeriodCopy := int64(*resp.DBCluster.PerformanceInsightsRetentionPeriod)
		r.ko.Spec.PerformanceInsightsRetentionPeriod = &performanceInsightsRetentionPeriodCopy
	} else {
		r.ko.Spec.PerformanceInsightsRetentionPeriod = nil
	}
	if resp.DBCluster.Port != nil {
		portCopy := int64(*resp.DBCluster.Port)
		r.ko.Spec.Port = &portCopy
	} else {
		r.ko.Spec.Port = nil
	}
	if resp.DBCluster.PreferredBackupWindow != nil {
		r.ko.Spec.PreferredBackupWindow = resp.DBCluster.PreferredBackupWindow
	} else {
		r.ko.Spec.PreferredBackupWindow = nil
	}
	if resp.DBCluster.PreferredMaintenanceWindow != nil {
		r.ko.Spec.PreferredMaintenanceWindow = resp.DBCluster.PreferredMaintenanceWindow
	} else {
		r.ko.Spec.PreferredMaintenanceWindow = nil
	}
	if resp.DBCluster.PubliclyAccessible != nil {
		r.ko.Spec.PubliclyAccessible = resp.DBCluster.PubliclyAccessible
	} else {
		r.ko.Spec.PubliclyAccessible = nil
	}
	if resp.DBCluster.ReadReplicaIdentifiers != nil {
		r.ko.Status.ReadReplicaIdentifiers = aws.StringSlice(resp.DBCluster.ReadReplicaIdentifiers)
	} else {
		r.ko.Status.ReadReplicaIdentifiers = nil
	}
	if resp.DBCluster.ReaderEndpoint != nil {
		r.ko.Status.ReaderEndpoint = resp.DBCluster.ReaderEndpoint
	} else {
		r.ko.Status.ReaderEndpoint = nil
	}
	if resp.DBCluster.ReplicationSourceIdentifier != nil {
		r.ko.Spec.ReplicationSourceIdentifier = resp.DBCluster.ReplicationSourceIdentifier
	} else {
		r.ko.Spec.ReplicationSourceIdentifier = nil
	}
	if resp.DBCluster.ScalingConfigurationInfo != nil {
		f65 := &svcapitypes.ScalingConfiguration{}
		if resp.DBCluster.ScalingConfigurationInfo.AutoPause != nil {
			f65.AutoPause = resp.DBCluster.ScalingConfigurationInfo.AutoPause
		}
		if resp.DBCluster.ScalingConfigurationInfo.MaxCapacity != nil {
			maxCapacityCopy := int64(*resp.DBCluster.ScalingConfigurationInfo.MaxCapacity)
			f65.MaxCapacity = &maxCapacityCopy
		}
		if resp.DBCluster.ScalingConfigurationInfo.MinCapacity != nil {
			minCapacityCopy := int64(*resp.DBCluster.ScalingConfigurationInfo.MinCapacity)
			f65.MinCapacity = &minCapacityCopy
		}
		if resp.DBCluster.ScalingConfigurationInfo.SecondsBeforeTimeout != nil {
			secondsBeforeTimeoutCopy := int64(*resp.DBCluster.ScalingConfigurationInfo.SecondsBeforeTimeout)
			f65.SecondsBeforeTimeout = &secondsBeforeTimeoutCopy
		}
		if resp.DBCluster.ScalingConfigurationInfo.SecondsUntilAutoPause != nil {
			secondsUntilAutoPauseCopy := int64(*resp.DBCluster.ScalingConfigurationInfo.SecondsUntilAutoPause)
			f65.SecondsUntilAutoPause = &secondsUntilAutoPauseCopy
		}
		if resp.DBCluster.ScalingConfigurationInfo.TimeoutAction != nil {
			f65.TimeoutAction = resp.DBCluster.ScalingConfigurationInfo.TimeoutAction
		}
		r.ko.Spec.ScalingConfiguration = f65
	} else {
		r.ko.Spec.ScalingConfiguration = nil
	}
	if resp.DBCluster.ServerlessV2ScalingConfiguration != nil {
		f66 := &svcapitypes.ServerlessV2ScalingConfiguration{}
		if resp.DBCluster.ServerlessV2ScalingConfiguration.MaxCapacity != nil {
			f66.MaxCapacity = resp.DBCluster.ServerlessV2ScalingConfiguration.MaxCapacity
		}
		if resp.DBCluster.ServerlessV2ScalingConfiguration.MinCapacity != nil {
			f66.MinCapacity = resp.DBCluster.ServerlessV2ScalingConfiguration.MinCapacity
		}
		if resp.DBCluster.ServerlessV2ScalingConfiguration.SecondsUntilAutoPause != nil {
			secondsUntilAutoPauseCopy := int64(*resp.DBCluster.ServerlessV2ScalingConfiguration.SecondsUntilAutoPause)
			f66.SecondsUntilAutoPause = &secondsUntilAutoPauseCopy
		}
		r.ko.Spec.ServerlessV2ScalingConfiguration = f66
	} else {
		r.ko.Spec.ServerlessV2ScalingConfiguration = nil
	}
	if resp.DBCluster.Status != nil {
		r.ko.Status.Status = resp.DBCluster.Status
	} else {
		r.ko.Status.Status = nil
	}
	if resp.DBCluster.StorageEncrypted != nil {
		r.ko.Spec.StorageEncrypted = resp.DBCluster.StorageEncrypted
	} else {
		r.ko.Spec.StorageEncrypted = nil
	}
	if resp.DBCluster.StorageType != nil {
		r.ko.Spec.StorageType = resp.DBCluster.StorageType
	} else {
		r.ko.Spec.StorageType = nil
	}
	if resp.DBCluster.TagList != nil {
		f70 := []*svcapitypes.Tag{}
		for _, f70iter := range resp.DBCluster.TagList {
			f70elem := &svcapitypes.Tag{}
			if f70iter.Key != nil {
				f70elem.Key = f70iter.Key
			}
			if f70iter.Value != nil {
				f70elem.Value = f70iter.Value
			}
			f70 = append(f70, f70elem)
		}
		r.ko.Status.TagList = f70
	} else {
		r.ko.Status.TagList = nil
	}
	if resp.DBCluster.VpcSecurityGroups != nil {
		f71 := []*svcapitypes.VPCSecurityGroupMembership{}
		for _, f71iter := range resp.DBCluster.VpcSecurityGroups {
			f71elem := &svcapitypes.VPCSecurityGroupMembership{}
			if f71iter.Status != nil {
				f71elem.Status = f71iter.Status
			}
			if f71iter.VpcSecurityGroupId != nil {
				f71elem.VPCSecurityGroupID = f71iter.VpcSecurityGroupId
			}
			f71 = append(f71, f71elem)
		}
		r.ko.Status.VPCSecurityGroups = f71
	} else {
		r.ko.Status.VPCSecurityGroups = nil
	}

}

// newRestoreDBClusterToPointInTimeInput returns a RestoreDBClusterToPointInTimeInput object
// with each the field set by the corresponding configuration's fields.
func (rm *resourceManager) newRestoreDBClusterToPointInTimeInput(
	r *resource,
) (*svcsdk.RestoreDBClusterToPointInTimeInput, error) {
	res := &svcsdk.RestoreDBClusterToPointInTimeInput{}

	if r.ko.Spec.BacktrackWindow != nil {
		res.BacktrackWindow = r.ko.Spec.BacktrackWindow
	}
	if r.ko.Spec.CopyTagsToSnapshot != nil {
		res.CopyTagsToSnapshot = r.ko.Spec.CopyTagsToSnapshot
	}
	if r.ko.Spec.DBClusterIdentifier != nil {
		res.DBClusterIdentifier = r.ko.Spec.DBClusterIdentifier
	}
	if r.ko.Spec.DBClusterInstanceClass != nil {
		res.DBClusterInstanceClass = r.ko.Spec.DBClusterInstanceClass
	}
	if r.ko.Spec.DBClusterParameterGroupName != nil {
		res.DBClusterParameterGroupName = r.ko.Spec.DBClusterParameterGroupName
	}
	if r.ko.Spec.DBSubnetGroupName != nil {
		res.DBSubnetGroupName = r.ko.Spec.DBSubnetGroupName
	}
	if r.ko.Spec.DeletionProtection != nil {
		res.DeletionProtection = r.ko.Spec.DeletionProtection
	}
	if r.ko.Spec.Domain != nil {
		res.Domain = r.ko.Spec.Domain
	}
	if r.ko.Spec.DomainIAMRoleName != nil {
		res.DomainIAMRoleName = r.ko.Spec.DomainIAMRoleName
	}
	if r.ko.Spec.EnableCloudwatchLogsExports != nil {
		res.EnableCloudwatchLogsExports = aws.ToStringSlice(r.ko.Spec.EnableCloudwatchLogsExports)
	}
	if r.ko.Spec.EnableIAMDatabaseAuthentication != nil {
		res.EnableIAMDatabaseAuthentication = r.ko.Spec.EnableIAMDatabaseAuthentication
	}
	if r.ko.Spec.EnablePerformanceInsights != nil {
		res.EnablePerformanceInsights = r.ko.Spec.EnablePerformanceInsights
	}
	if r.ko.Spec.EngineMode != nil {
		res.EngineMode = r.ko.Spec.EngineMode
	}
	if r.ko.Spec.IOPS != nil {
		iopsCopy0 := *r.ko.Spec.IOPS
		if iopsCopy0 > math.MaxInt32 || iopsCopy0 < math.MinInt32 {
			return nil, fmt.Errorf("error: field Iops is of type int32")
		}
		iopsCopy := int32(iopsCopy0)
		res.Iops = &iopsCopy
	}
	if r.ko.Spec.KMSKeyID != nil {
		res.KmsKeyId = r.ko.Spec.KMSKeyID
	}
	if r.ko.Spec.MonitoringInterval != nil {
		monitoringIntervalCopy0 := *r.ko.Spec.MonitoringInterval
		if monitoringIntervalCopy0 > math.MaxInt32 || monitoringIntervalCopy0 < math.MinInt32 {
			return nil, fmt.Errorf("error: field MonitoringInterval is of type int32")
		}
		monitoringIntervalCopy := int32(monitoringIntervalCopy0)
		res.MonitoringInterval = &monitoringIntervalCopy
	}
	if r.ko.Spec.MonitoringRoleARN != nil {
		res.MonitoringRoleArn = r.ko.Spec.MonitoringRoleARN
	}
	if r.ko.Spec.NetworkType != nil {
		res.NetworkType = r.ko.Spec.NetworkType
	}
	if r.ko.Spec.OptionGroupName != nil {
		res.OptionGroupName = r.ko.Spec.OptionGroupName
	}
	if r.ko.Spec.PerformanceInsightsKMSKeyID != nil {
		res.PerformanceInsightsKMSKeyId = r.ko.Spec.PerformanceInsightsKMSKeyID
	}
	if r.ko.Spec.PerformanceInsightsRetentionPeriod != nil {
		performanceInsightsRetentionPeriodCopy0 := *r.ko.Spec.PerformanceInsightsRetentionPeriod
		if performanceInsightsRetentionPeriodCopy0 > math.MaxInt32 || performanceInsightsRetentionPeriodCopy0 < math.MinInt32 {
			return nil, fmt.Errorf("error: field PerformanceInsightsRetentionPeriod is of type int32")
		}
		performanceInsightsRetentionPeriodCopy := int32(performanceInsightsRetentionPeriodCopy0)
		res.PerformanceInsightsRetentionPeriod = &performanceInsightsRetentionPeriodCopy
	}
	if r.ko.Spec.Port != nil {
		portCopy0 := *r.ko.Spec.Port
		if portCopy0 > math.MaxInt32 || portCopy0 < math.MinInt32 {
			return nil, fmt.Errorf("error: field Port is of type int32")
		}
		portCopy := int32(portCopy0)
		res.Port = &portCopy
	}
	if r.ko.Spec.PubliclyAccessible != nil {
		res.PubliclyAccessible = r.ko.Spec.PubliclyAccessible
	}
	if r.ko.Spec.RestoreToTime != nil {
		res.RestoreToTime = &r.ko.Spec.RestoreToTime.Time
	}
	if r.ko.Spec.RestoreType != nil {
		res.RestoreType = r.ko.Spec.RestoreType
	}
	if r.ko.Spec.ScalingConfiguration != nil {
		resf25 := &svcsdktypes.ScalingConfiguration{}
		if r.ko.Spec.ScalingConfiguration.AutoPause != nil {
			resf25.AutoPause = r.ko.Spec.ScalingConfiguration.AutoPause
		}
		if r.ko.Spec.ScalingConfiguration.MaxCapacity != nil {
			maxCapacityCopy0 := *r.ko.Spec.ScalingConfiguration.MaxCapacity
			if maxCapacityCopy0 > math.MaxInt32 || maxCapacityCopy0 < math.MinInt32 {
				return nil, fmt.Errorf("error: field MaxCapacity is of type int32")
			}
			maxCapacityCopy := int32(maxCapacityCopy0)
			resf25.MaxCapacity = &maxCapacityCopy
		}
		if r.ko.Spec.ScalingConfiguration.MinCapacity != nil {
			minCapacityCopy0 := *r.ko.Spec.ScalingConfiguration.MinCapacity
			if minCapacityCopy0 > math.MaxInt32 || minCapacityCopy0 < math.MinInt32 {
				return nil, fmt.Errorf("error: field MinCapacity is of type int32")
			}
			minCapacityCopy := int32(minCapacityCopy0)
			resf25.MinCapacity = &minCapacityCopy
		}
		if r.ko.Spec.ScalingConfiguration.SecondsBeforeTimeout != nil {
			secondsBeforeTimeoutCopy0 := *r.ko.Spec.ScalingConfiguration.SecondsBeforeTimeout
			if secondsBeforeTimeoutCopy0 > math.MaxInt32 || secondsBeforeTimeoutCopy0 < math.MinInt32 {
				return nil, fmt.Errorf("error: field SecondsBeforeTimeout is of type int32")
			}
			secondsBeforeTimeoutCopy := int32(secondsBeforeTimeoutCopy0)
			resf25.SecondsBeforeTimeout = &secondsBeforeTimeoutCopy
		}
		if r.ko.Spec.ScalingConfiguration.SecondsUntilAutoPause != nil {
			secondsUntilAutoPauseCopy0 := *r.ko.Spec.ScalingConfiguration.SecondsUntilAutoPause
			if secondsUntilAutoPauseCopy0 > math.MaxInt32 || secondsUntilAutoPauseCopy0 < math.MinInt32 {
				return nil, fmt.Errorf("error: field SecondsUntilAutoPause is of type int32")
			}
			secondsUntilAutoPauseCopy := int32(secondsUntilAutoPauseCopy0)
			resf25.SecondsUntilAutoPause = &secondsUntilAutoPauseCopy
		}
		if r.ko.Spec.ScalingConfiguration.TimeoutAction != nil {
			resf25.TimeoutAction = r.ko.Spec.ScalingConfiguration.TimeoutAction
		}
		res.ScalingConfiguration = resf25
	}
	if r.ko.Spec.ServerlessV2ScalingConfiguration != nil {
		resf26 := &svcsdktypes.ServerlessV2ScalingConfiguration{}
		if r.ko.Spec.ServerlessV2ScalingConfiguration.MaxCapacity != nil {
			resf26.MaxCapacity = r.ko.Spec.ServerlessV2ScalingConfiguration.MaxCapacity
		}
		if r.ko.Spec.ServerlessV2ScalingConfiguration.MinCapacity != nil {
			resf26.MinCapacity = r.ko.Spec.ServerlessV2ScalingConfiguration.MinCapacity
		}
		if r.ko.Spec.ServerlessV2ScalingConfiguration.SecondsUntilAutoPause != nil {
			secondsUntilAutoPauseCopy0 := *r.ko.Spec.ServerlessV2ScalingConfiguration.SecondsUntilAutoPause
			if secondsUntilAutoPauseCopy0 > math.MaxInt32 || secondsUntilAutoPauseCopy0 < math.MinInt32 {
				return nil, fmt.Errorf("error: field SecondsUntilAutoPause is of type int32")
			}
			secondsUntilAutoPauseCopy := int32(secondsUntilAutoPauseCopy0)
			resf26.SecondsUntilAutoPause = &secondsUntilAutoPauseCopy
		}
		res.ServerlessV2ScalingConfiguration = resf26
	}
	if r.ko.Spec.SourceDBClusterIdentifier != nil {
		res.SourceDBClusterIdentifier = r.ko.Spec.SourceDBClusterIdentifier
	}
	if r.ko.Spec.StorageType != nil {
		res.StorageType = r.ko.Spec.StorageType
	}
	if r.ko.Spec.Tags != nil {
		resf29 := []svcsdktypes.Tag{}
		for _, resf29iter := range r.ko.Spec.Tags {
			resf29elem := &svcsdktypes.Tag{}
			if resf29iter.Key != nil {
				resf29elem.Key = resf29iter.Key
			}
			if resf29iter.Value != nil {
				resf29elem.Value = resf29iter.Value
			}
			resf29 = append(resf29, *resf29elem)
		}
		res.Tags = resf29
	}
	if r.ko.Spec.UseLatestRestorableTime != nil {
		res.UseLatestRestorableTime = r.ko.Spec.UseLatestRestorableTime
	}
	if r.ko.Spec.VPCSecurityGroupIDs != nil {
		res.VpcSecurityGroupIds = aws.ToStringSlice(r.ko.Spec.VPCSecurityGroupIDs)
	}

	return res, nil
}

// setResourceFromRestoreDBClusterToPointInTimeOutput sets a resource RestoreDBClusterToPointInTimeOutput type
// given the SDK type.
func (rm *resourceManager) setResourceFromRestoreDBClusterToPointInTimeOutput(
	r *resource,
	resp *svcsdk.RestoreDBClusterToPointInTimeOutput,
) {

	if resp.DBCluster.ActivityStreamKinesisStreamName != nil {
		r.ko.Status.ActivityStreamKinesisStreamName = resp.DBCluster.ActivityStreamKinesisStreamName
	} else {
		r.ko.Status.ActivityStreamKinesisStreamName = nil
	}
	if resp.DBCluster.ActivityStreamKmsKeyId != nil {
		r.ko.Status.ActivityStreamKMSKeyID = resp.DBCluster.ActivityStreamKmsKeyId
	} else {
		r.ko.Status.ActivityStreamKMSKeyID = nil
	}
	if resp.DBCluster.ActivityStreamMode != "" {
		r.ko.Status.ActivityStreamMode = aws.String(string(resp.DBCluster.ActivityStreamMode))
	} else {
		r.ko.Status.ActivityStreamMode = nil
	}
	if resp.DBCluster.ActivityStreamStatus != "" {
		r.ko.Status.ActivityStreamStatus = aws.String(string(resp.DBCluster.ActivityStreamStatus))
	} else {
		r.ko.Status.ActivityStreamStatus = nil
	}
	if resp.DBCluster.AllocatedStorage != nil {
		allocatedStorageCopy := int64(*resp.DBCluster.AllocatedStorage)
		r.ko.Spec.AllocatedStorage = &allocatedStorageCopy
	} else {
		r.ko.Spec.AllocatedStorage = nil
	}
	if resp.DBCluster.AssociatedRoles != nil {
		f5 := []*svcapitypes.DBClusterRole{}
		for _, f5iter := range resp.DBCluster.AssociatedRoles {
			f5elem := &svcapitypes.DBClusterRole{}
			if f5iter.FeatureName != nil {
				f5elem.FeatureName = f5iter.FeatureName
			}
			if f5iter.RoleArn != nil {
				f5elem.RoleARN = f5iter.RoleArn
			}
			if f5iter.Status != nil {
				f5elem.Status = f5iter.Status
			}
			f5 = append(f5, f5elem)
		}
		r.ko.Status.AssociatedRoles = f5
	} else {
		r.ko.Status.AssociatedRoles = nil
	}
	if resp.DBCluster.AutoMinorVersionUpgrade != nil {
		r.ko.Spec.AutoMinorVersionUpgrade = resp.DBCluster.AutoMinorVersionUpgrade
	} else {
		r.ko.Spec.AutoMinorVersionUpgrade = nil
	}
	if resp.DBCluster.AutomaticRestartTime != nil {
		r.ko.Status.AutomaticRestartTime = &metav1.Time{*resp.DBCluster.AutomaticRestartTime}
	} else {
		r.ko.Status.AutomaticRestartTime = nil
	}
	if resp.DBCluster.AvailabilityZones != nil {
		r.ko.Spec.AvailabilityZones = aws.StringSlice(resp.DBCluster.AvailabilityZones)
	} else {
		r.ko.Spec.AvailabilityZones = nil
	}
	if resp.DBCluster.BacktrackConsumedChangeRecords != nil {
		r.ko.Status.BacktrackConsumedChangeRecords = resp.DBCluster.BacktrackConsumedChangeRecords
	} else {
		r.ko.Status.BacktrackConsumedChangeRecords = nil
	}
	if resp.DBCluster.BacktrackWindow != nil {
		r.ko.Spec.BacktrackWindow = resp.DBCluster.BacktrackWindow
	} else {
		r.ko.Spec.BacktrackWindow = nil
	}
	if resp.DBCluster.BackupRetentionPeriod != nil {
		backupRetentionPeriodCopy := int64(*resp.DBCluster.BackupRetentionPeriod)
		r.ko.Spec.BackupRetentionPeriod = &backupRetentionPeriodCopy
	} else {
		r.ko.Spec.BackupRetentionPeriod = nil
	}
	if resp.DBCluster.Capacity != nil {
		capacityCopy := int64(*resp.DBCluster.Capacity)
		r.ko.Status.Capacity = &capacityCopy
	} else {
		r.ko.Status.Capacity = nil
	}
	if resp.DBCluster.CharacterSetName != nil {
		r.ko.Spec.CharacterSetName = resp.DBCluster.CharacterSetName
	} else {
		r.ko.Spec.CharacterSetName = nil
	}
	if resp.DBCluster.CloneGroupId != nil {
		r.ko.Status.CloneGroupID = resp.DBCluster.CloneGroupId
	} else {
		r.ko.Status.CloneGroupID = nil
	}
	if resp.DBCluster.ClusterCreateTime != nil {
		r.ko.Status.ClusterCreateTime = &metav1.Time{*resp.DBCluster.ClusterCreateTime}
	} else {
		r.ko.Status.ClusterCreateTime = nil
	}
	if resp.DBCluster.CopyTagsToSnapshot != nil {
		r.ko.Spec.CopyTagsToSnapshot = resp.DBCluster.CopyTagsToSnapshot
	} else {
		r.ko.Spec.CopyTagsToSnapshot = nil
	}
	if resp.DBCluster.CrossAccountClone != nil {
		r.ko.Status.CrossAccountClone = resp.DBCluster.CrossAccountClone
	} else {
		r.ko.Status.CrossAccountClone = nil
	}
	if resp.DBCluster.CustomEndpoints != nil {
		r.ko.Status.CustomEndpoints = aws.StringSlice(resp.DBCluster.CustomEndpoints)
	} else {
		r.ko.Status.CustomEndpoints = nil
	}
	if r.ko.Status.ACKResourceMetadata == nil {
		r.ko.Status.ACKResourceMetadata = &ackv1alpha1.ResourceMetadata{}
	}
	if resp.DBCluster.DBClusterArn != nil {
		arn := ackv1alpha1.AWSResourceName(*resp.DBCluster.DBClusterArn)
		r.ko.Status.ACKResourceMetadata.ARN = &arn
	}
	if resp.DBCluster.DBClusterIdentifier != nil {
		r.ko.Spec.DBClusterIdentifier = resp.DBCluster.DBClusterIdentifier
	} else {
		r.ko.Spec.DBClusterIdentifier = nil
	}
	if resp.DBCluster.DBClusterInstanceClass != nil {
		r.ko.Spec.DBClusterInstanceClass = resp.DBCluster.DBClusterInstanceClass
	} else {
		r.ko.Spec.DBClusterInstanceClass = nil
	}
	if resp.DBCluster.DBClusterMembers != nil {
		f22 := []*svcapitypes.DBClusterMember{}
		for _, f22iter := range resp.DBCluster.DBClusterMembers {
			f22elem := &svcapitypes.DBClusterMember{}
			if f22iter.DBClusterParameterGroupStatus != nil {
				f22elem.DBClusterParameterGroupStatus = f22iter.DBClusterParameterGroupStatus
			}
			if f22iter.DBInstanceIdentifier != nil {
				f22elem.DBInstanceIdentifier = f22iter.DBInstanceIdentifier
			}
			if f22iter.IsClusterWriter != nil {
				f22elem.IsClusterWriter = f22iter.IsClusterWriter
			}
			if f22iter.PromotionTier != nil {
				promotionTierCopy := int64(*f22iter.PromotionTier)
				f22elem.PromotionTier = &promotionTierCopy
			}
			f22 = append(f22, f22elem)
		}
		r.ko.Status.DBClusterMembers = f22
	} else {
		r.ko.Status.DBClusterMembers = nil
	}
	if resp.DBCluster.DBClusterOptionGroupMemberships != nil {
		f23 := []*svcapitypes.DBClusterOptionGroupStatus{}
		for _, f23iter := range resp.DBCluster.DBClusterOptionGroupMemberships {
			f23elem := &svcapitypes.DBClusterOptionGroupStatus{}
			if f23iter.DBClusterOptionGroupName != nil {
				f23elem.DBClusterOptionGroupName = f23iter.DBClusterOptionGroupName
			}
			if f23iter.Status != nil {
				f23elem.Status = f23iter.Status
			}
			f23 = append(f23, f23elem)
		}
		r.ko.Status.DBClusterOptionGroupMemberships = f23
	} else {
		r.ko.Status.DBClusterOptionGroupMemberships = nil
	}
	if resp.DBCluster.DBClusterParameterGroup != nil {
		r.ko.Status.DBClusterParameterGroup = resp.DBCluster.DBClusterParameterGroup
	} else {
		r.ko.Status.DBClusterParameterGroup = nil
	}
	if resp.DBCluster.DBSubnetGroup != nil {
		r.ko.Status.DBSubnetGroup = resp.DBCluster.DBSubnetGroup
	} else {
		r.ko.Status.DBSubnetGroup = nil
	}
	if resp.DBCluster.DBSystemId != nil {
		r.ko.Spec.DBSystemID = resp.DBCluster.DBSystemId
	} else {
		r.ko.Spec.DBSystemID = nil
	}
	if resp.DBCluster.DatabaseInsightsMode != "" {
		r.ko.Spec.DatabaseInsightsMode = aws.String(string(resp.DBCluster.DatabaseInsightsMode))
	} else {
		r.ko.Spec.DatabaseInsightsMode = nil
	}
	if resp.DBCluster.DatabaseName != nil {
		r.ko.Spec.DatabaseName = resp.DBCluster.DatabaseName
	} else {
		r.ko.Spec.DatabaseName = nil
	}
	if resp.DBCluster.DbClusterResourceId != nil {
		r.ko.Status.DBClusterResourceID = resp.DBCluster.DbClusterResourceId
	} else {
		r.ko.Status.DBClusterResourceID = nil
	}
	if resp.DBCluster.DeletionProtection != nil {
		r.ko.Spec.DeletionProtection = resp.DBCluster.DeletionProtection
	} else {
		r.ko.Spec.DeletionProtection = nil
	}
	if resp.DBCluster.DomainMemberships != nil {
		f31 := []*svcapitypes.DomainMembership{}
		for _, f31iter := range resp.DBCluster.DomainMemberships {
			f31elem := &svcapitypes.DomainMembership{}
			if f31iter.Domain != nil {
				f31elem.Domain = f31iter.Domain
			}
			if f31iter.FQDN != nil {
				f31elem.FQDN = f31iter.FQDN
			}
			if f31iter.IAMRoleName != nil {
				f31elem.IAMRoleName = f31iter.IAMRoleName
			}
			if f31iter.Status != nil {
				f31elem.Status = f31iter.Status
			}
			f31 = append(f31, f31elem)
		}
		r.ko.Status.DomainMemberships = f31
	} else {
		r.ko.Status.DomainMemberships = nil
	}
	if resp.DBCluster.EarliestBacktrackTime != nil {
		r.ko.Status.EarliestBacktrackTime = &metav1.Time{*resp.DBCluster.EarliestBacktrackTime}
	} else {
		r.ko.Status.EarliestBacktrackTime = nil
	}
	if resp.DBCluster.EarliestRestorableTime != nil {
		r.ko.Status.EarliestRestorableTime = &metav1.Time{*resp.DBCluster.EarliestRestorableTime}
	} else {
		r.ko.Status.EarliestRestorableTime = nil
	}
	if resp.DBCluster.EnabledCloudwatchLogsExports != nil {
		r.ko.Status.EnabledCloudwatchLogsExports = aws.StringSlice(resp.DBCluster.EnabledCloudwatchLogsExports)
	} else {
		r.ko.Status.EnabledCloudwatchLogsExports = nil
	}
	if resp.DBCluster.Endpoint != nil {
		r.ko.Status.Endpoint = resp.DBCluster.Endpoint
	} else {
		r.ko.Status.Endpoint = nil
	}
	if resp.DBCluster.Engine != nil {
		r.ko.Spec.Engine = resp.DBCluster.Engine
	} else {
		r.ko.Spec.Engine = nil
	}
	if resp.DBCluster.EngineMode != nil {
		r.ko.Spec.EngineMode = resp.DBCluster.EngineMode
	} else {
		r.ko.Spec.EngineMode = nil
	}
	if resp.DBCluster.EngineVersion != nil {
		r.ko.Spec.EngineVersion = resp.DBCluster.EngineVersion
	} else {
		r.ko.Spec.EngineVersion = nil
	}
	if resp.DBCluster.GlobalWriteForwardingRequested != nil {
		r.ko.Status.GlobalWriteForwardingRequested = resp.DBCluster.GlobalWriteForwardingRequested
	} else {
		r.ko.Status.GlobalWriteForwardingRequested = nil
	}
	if resp.DBCluster.GlobalWriteForwardingStatus != "" {
		r.ko.Status.GlobalWriteForwardingStatus = aws.String(string(resp.DBCluster.GlobalWriteForwardingStatus))
	} else {
		r.ko.Status.GlobalWriteForwardingStatus = nil
	}
	if resp.DBCluster.HostedZoneId != nil {
		r.ko.Status.HostedZoneID = resp.DBCluster.HostedZoneId
	} else {
		r.ko.Status.HostedZoneID = nil
	}
	if resp.DBCluster.HttpEndpointEnabled != nil {
		r.ko.Status.HTTPEndpointEnabled = resp.DBCluster.HttpEndpointEnabled
	} else {
		r.ko.Status.HTTPEndpointEnabled = nil
	}
	if resp.DBCluster.IAMDatabaseAuthenticationEnabled != nil {
		r.ko.Status.IAMDatabaseAuthenticationEnabled = resp.DBCluster.IAMDatabaseAuthenticationEnabled
	} else {
		r.ko.Status.IAMDatabaseAuthenticationEnabled = nil
	}
	if resp.DBCluster.Iops != nil {
		iopsCopy := int64(*resp.DBCluster.Iops)
		r.ko.Spec.IOPS = &iopsCopy
	} else {
		r.ko.Spec.IOPS = nil
	}
	if resp.DBCluster.KmsKeyId != nil {
		r.ko.Spec.KMSKeyID = resp.DBCluster.KmsKeyId
	} else {
		r.ko.Spec.KMSKeyID = nil
	}
	if resp.DBCluster.LatestRestorableTime != nil {
		r.ko.Status.LatestRestorableTime = &metav1.Time{*resp.DBCluster.LatestRestorableTime}
	} else {
		r.ko.Status.LatestRestorableTime = nil
	}
	if resp.DBCluster.MasterUserSecret != nil {
		f47 := &svcapitypes.MasterUserSecret{}
		if resp.DBCluster.MasterUserSecret.KmsKeyId != nil {
			f47.KMSKeyID = resp.DBCluster.MasterUserSecret.KmsKeyId
		}
		if resp.DBCluster.MasterUserSecret.SecretArn != nil {
			f47.SecretARN = resp.DBCluster.MasterUserSecret.SecretArn
		}
		if resp.DBCluster.MasterUserSecret.SecretStatus != nil {
			f47.SecretStatus = resp.DBCluster.MasterUserSecret.SecretStatus
		}
		r.ko.Status.MasterUserSecret = f47
	} else {
		r.ko.Status.MasterUserSecret = nil
	}
	if resp.DBCluster.MasterUsername != nil {
		r.ko.Spec.MasterUsername = resp.DBCluster.MasterUsername
	} else {
		r.ko.Spec.MasterUsername = nil
	}
	if resp.DBCluster.MonitoringInterval != nil {
		monitoringIntervalCopy := int64(*resp.DBCluster.MonitoringInterval)
		r.ko.Spec.MonitoringInterval = &monitoringIntervalCopy
	} else {
		r.ko.Spec.MonitoringInterval = nil
	}
	if resp.DBCluster.MonitoringRoleArn != nil {
		r.ko.Spec.MonitoringRoleARN = resp.DBCluster.MonitoringRoleArn
	} else {
		r.ko.Spec.MonitoringRoleARN = nil
	}
	if resp.DBCluster.MultiAZ != nil {
		r.ko.Status.MultiAZ = resp.DBCluster.MultiAZ
	} else {
		r.ko.Status.MultiAZ = nil
	}
	if resp.DBCluster.NetworkType != nil {
		r.ko.Spec.NetworkType = resp.DBCluster.NetworkType
	} else {
		r.ko.Spec.NetworkType = nil
	}
	if resp.DBCluster.PendingModifiedValues != nil {
		f53 := &svcapitypes.ClusterPendingModifiedValues{}
		if resp.DBCluster.PendingModifiedValues.AllocatedStorage != nil {
			allocatedStorageCopy := int64(*resp.DBCluster.PendingModifiedValues.AllocatedStorage)
			f53.AllocatedStorage = &allocatedStorageCopy
		}
		if resp.DBCluster.PendingModifiedValues.BackupRetentionPeriod != nil {
			backupRetentionPeriodCopy := int64(*resp.DBCluster.PendingModifiedValues.BackupRetentionPeriod)
			f53.BackupRetentionPeriod = &backupRetentionPeriodCopy
		}
		if resp.DBCluster.PendingModifiedValues.DBClusterIdentifier != nil {
			f53.DBClusterIdentifier = resp.DBCluster.PendingModifiedValues.DBClusterIdentifier
		}
		if resp.DBCluster.PendingModifiedValues.EngineVersion != nil {
			f53.EngineVersion = resp.DBCluster.PendingModifiedValues.EngineVersion
		}
		if resp.DBCluster.PendingModifiedValues.IAMDatabaseAuthenticationEnabled != nil {
			f53.IAMDatabaseAuthenticationEnabled = resp.DBCluster.PendingModifiedValues.IAMDatabaseAuthenticationEnabled
		}
		if resp.DBCluster.PendingModifiedValues.Iops != nil {
			iopsCopy := int64(*resp.DBCluster.PendingModifiedValues.Iops)
			f53.IOPS = &iopsCopy
		}
		if resp.DBCluster.PendingModifiedValues.MasterUserPassword != nil {
			f53.MasterUserPassword = resp.DBCluster.PendingModifiedValues.MasterUserPassword
		}
		if resp.DBCluster.PendingModifiedValues.PendingCloudwatchLogsExports != nil {
			f53f7 := &svcapitypes.PendingCloudwatchLogsExports{}
			if resp.DBCluster.PendingModifiedValues.PendingCloudwatchLogsExports.LogTypesToDisable != nil {
				f53f7.LogTypesToDisable = aws.StringSlice(resp.DBCluster.PendingModifiedValues.PendingCloudwatchLogsExports.LogTypesToDisable)
			}
			if resp.DBCluster.PendingModifiedValues.PendingCloudwatchLogsExports.LogTypesToEnable != nil {
				f53f7.LogTypesToEnable = aws.StringSlice(resp.DBCluster.PendingModifiedValues.PendingCloudwatchLogsExports.LogTypesToEnable)
			}
			f53.PendingCloudwatchLogsExports = f53f7
		}
		r.ko.Status.PendingModifiedValues = f53
	} else {
		r.ko.Status.PendingModifiedValues = nil
	}
	if resp.DBCluster.PercentProgress != nil {
		r.ko.Status.PercentProgress = resp.DBCluster.PercentProgress
	} else {
		r.ko.Status.PercentProgress = nil
	}
	if resp.DBCluster.PerformanceInsightsEnabled != nil {
		r.ko.Status.PerformanceInsightsEnabled = resp.DBCluster.PerformanceInsightsEnabled
	} else {
		r.ko.Status.PerformanceInsightsEnabled = nil
	}
	if resp.DBCluster.PerformanceInsightsKMSKeyId != nil {
		r.ko.Spec.PerformanceInsightsKMSKeyID = resp.DBCluster.PerformanceInsightsKMSKeyId
	} else {
		r.ko.Spec.PerformanceInsightsKMSKeyID = nil
	}
	if resp.DBCluster.PerformanceInsightsRetentionPeriod != nil {
		performanceInsightsRetentionPeriodCopy := int64(*resp.DBCluster.PerformanceInsightsRetentionPeriod)
		r.ko.Spec.PerformanceInsightsRetentionPeriod = &performanceInsightsRetentionPeriodCopy
	} else {
		r.ko.Spec.PerformanceInsightsRetentionPeriod = nil
	}
	if resp.DBCluster.Port != nil {
		portCopy := int64(*resp.DBCluster.Port)
		r.ko.Spec.Port = &portCopy
	} else {
		r.ko.Spec.Port = nil
	}
	if resp.DBCluster.PreferredBackupWindow != nil {
		r.ko.Spec.PreferredBackupWindow = resp.DBCluster.PreferredBackupWindow
	} else {
		r.ko.Spec.PreferredBackupWindow = nil
	}
	if resp.DBCluster.PreferredMaintenanceWindow != nil {
		r.ko.Spec.PreferredMaintenanceWindow = resp.DBCluster.PreferredMaintenanceWindow
	} else {
		r.ko.Spec.PreferredMaintenanceWindow = nil
	}
	if resp.DBCluster.PubliclyAccessible != nil {
		r.ko.Spec.PubliclyAccessible = resp.DBCluster.PubliclyAccessible
	} else {
		r.ko.Spec.PubliclyAccessible = nil
	}
	if resp.DBCluster.ReadReplicaIdentifiers != nil {
		r.ko.Status.ReadReplicaIdentifiers = aws.StringSlice(resp.DBCluster.ReadReplicaIdentifiers)
	} else {
		r.ko.Status.ReadReplicaIdentifiers = nil
	}
	if resp.DBCluster.ReaderEndpoint != nil {
		r.ko.Status.ReaderEndpoint = resp.DBCluster.ReaderEndpoint
	} else {
		r.ko.Status.ReaderEndpoint = nil
	}
	if resp.DBCluster.ReplicationSourceIdentifier != nil {
		r.ko.Spec.ReplicationSourceIdentifier = resp.DBCluster.ReplicationSourceIdentifier
	} else {
		r.ko.Spec.ReplicationSourceIdentifier = nil
	}
	if resp.DBCluster.ScalingConfigurationInfo != nil {
		f65 := &svcapitypes.ScalingConfiguration{}
		if resp.DBCluster.ScalingConfigurationInfo.AutoPause != nil {
			f65.AutoPause = resp.DBCluster.ScalingConfigurationInfo.AutoPause
		}
		if resp.DBCluster.ScalingConfigurationInfo.MaxCapacity != nil {
			maxCapacityCopy := int64(*resp.DBCluster.ScalingConfigurationInfo.MaxCapacity)
			f65.MaxCapacity = &maxCapacityCopy
		}
		if resp.DBCluster.ScalingConfigurationInfo.MinCapacity != nil {
			minCapacityCopy := int64(*resp.DBCluster.ScalingConfigurationInfo.MinCapacity)
			f65.MinCapacity = &minCapacityCopy
		}
		if resp.DBCluster.ScalingConfigurationInfo.SecondsBeforeTimeout != nil {
			secondsBeforeTimeoutCopy := int64(*resp.DBCluster.ScalingConfigurationInfo.SecondsBeforeTimeout)
			f65.SecondsBeforeTimeout = &secondsBeforeTimeoutCopy
		}
		if resp.DBCluster.ScalingConfigurationInfo.SecondsUntilAutoPause != nil {
			secondsUntilAutoPauseCopy := int64(*resp.DBCluster.ScalingConfigurationInfo.SecondsUntilAutoPause)
			f65.SecondsUntilAutoPause = &secondsUntilAutoPauseCopy
		}
		if resp.DBCluster.ScalingConfigurationInfo.TimeoutAction != nil {
			f65.TimeoutAction = resp.DBCluster.ScalingConfigurationInfo.TimeoutAction
		}
		r.ko.Spec.ScalingConfiguration = f65
	} else {
		r.ko.Spec.ScalingConfiguration = nil
	}
	if resp.DBCluster.ServerlessV2ScalingConfiguration != nil {
		f66 := &svcapitypes.ServerlessV2ScalingConfiguration{}
		if resp.DBCluster.ServerlessV2ScalingConfiguration.MaxCapacity != nil {
			f66.MaxCapacity = resp.DBCluster.ServerlessV2ScalingConfiguration.MaxCapacity
		}
		if resp.DBCluster.ServerlessV2ScalingConfiguration.MinCapacity != nil {
			f66.MinCapacity = resp.DBCluster.ServerlessV2ScalingConfiguration.MinCapacity
		}
		if resp.DBCluster.ServerlessV2ScalingConfiguration.SecondsUntilAutoPause != nil {
			secondsUntilAutoPauseCopy := int64(*resp.DBCluster.ServerlessV2ScalingConfiguration.SecondsUntilAutoPause)
			f66.SecondsUntilAutoPause = &secondsUntilAutoPauseCopy
		}
		r.ko.Spec.ServerlessV2ScalingConfiguration = f66
	} else {
		r.ko.Spec.ServerlessV2ScalingConfiguration = nil
	}
	if resp.DBCluster.Status != nil {
		r.ko.Status.Status = resp.DBCluster.Status
	} else {
		r.ko.Status.Status = nil
	}
	if resp.DBCluster.StorageEncrypted != nil {
		r.ko.Spec.StorageEncrypted = resp.DBCluster.StorageEncrypted
	} else {
		r.ko.Spec.StorageEncrypted = nil
	}
	if resp.DBCluster.StorageType != nil {
		r.ko.Spec.StorageType = resp.DBCluster.StorageType
	} else {
		r.ko.Spec.StorageType = nil
	}
	if resp.DBCluster.TagList != nil {
		f70 := []*svcapitypes.Tag{}
		for _, f70iter := range resp.DBCluster.TagList {
			f70elem := &svcapitypes.Tag{}
			if f70iter.Key != nil {
				f70elem.Key = f70iter.Key
			}
			if f70iter.Value != nil {
				f70elem.Value = f70iter.Value
			}
			f70 = append(f70, f70elem)
		}
		r.ko.Status.TagList = f70
	} else {
		r.ko.Status.TagList = nil
	}
	if resp.DBCluster.VpcSecurityGroups != nil {
		f71 := []*svcapitypes.VPCSecurityGroupMembership{}
		for _, f71iter := range resp.DBCluster.VpcSecurityGroups {
			f71elem := &svcapitypes.VPCSecurityGroupMembership{}
			if f71iter.Status != nil {
				f71elem.Status = f71iter.Status
			}
			if f71iter.VpcSecurityGroupId != nil {
				f71elem.VPCSecurityGroupID = f71iter.VpcSecurityGroupId
			}
			f71 = append(f71, f71elem)
		}
		r.ko.Status.VPCSecurityGroups = f71
	} else {
		r.ko.Status.VPCSecurityGroups = nil
	}

}
