CfnDBClusterPropsMixin
- class aws_cdk.mixins_preview.aws_rds.mixins.CfnDBClusterPropsMixin(props, *, strategy=None)
Bases:
MixinThe
AWS::RDS::DBClusterresource creates an Amazon Aurora DB cluster or Multi-AZ DB cluster.For more information about creating an Aurora DB cluster, see Creating an Amazon Aurora DB cluster in the Amazon Aurora User Guide .
For more information about creating a Multi-AZ DB cluster, see Creating a Multi-AZ DB cluster in the Amazon RDS User Guide . .. epigraph:
You can only create this resource in AWS Regions where Amazon Aurora or Multi-AZ DB clusters are supported.
Updating DB clusters
When properties labeled “ Update requires: Replacement “ are updated, AWS CloudFormation first creates a replacement DB cluster, then changes references from other dependent resources to point to the replacement DB cluster, and finally deletes the old DB cluster. .. epigraph:
We highly recommend that you take a snapshot of the database before updating the stack. If you don't, you lose the data when AWS CloudFormation replaces your DB cluster. To preserve your data, perform the following procedure: - Deactivate any applications that are using the DB cluster so that there's no activity on the DB instance. - Create a snapshot of the DB cluster. For more information, see `Creating a DB cluster snapshot <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_CreateSnapshotCluster.html>`_ . - If you want to restore your DB cluster using a DB cluster snapshot, modify the updated template with your DB cluster changes and add the ``SnapshotIdentifier`` property with the ID of the DB cluster snapshot that you want to use. After you restore a DB cluster with a ``SnapshotIdentifier`` property, you must specify the same ``SnapshotIdentifier`` property for any future updates to the DB cluster. When you specify this property for an update, the DB cluster is not restored from the DB cluster snapshot again, and the data in the database is not changed. However, if you don't specify the ``SnapshotIdentifier`` property, an empty DB cluster is created, and the original DB cluster is deleted. If you specify a property that is different from the previous snapshot restore property, a new DB cluster is restored from the specified ``SnapshotIdentifier`` property, and the original DB cluster is deleted. - Update the stack.
Currently, when you are updating the stack for an Aurora Serverless DB cluster, you can’t include changes to any other properties when you specify one of the following properties:
PreferredBackupWindow,PreferredMaintenanceWindow, andPort. This limitation doesn’t apply to provisioned DB clusters.For more information about updating other properties of this resource, see
[ModifyDBCluster](https://docs.aws.amazon.com//AmazonRDS/latest/APIReference/API_ModifyDBCluster.html). For more information about updating stacks, see AWS CloudFormation Stacks Updates .Deleting DB clusters
The default
DeletionPolicyforAWS::RDS::DBClusterresources isSnapshot. For more information about how AWS CloudFormation deletes resources, see DeletionPolicy Attribute .- See:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbcluster.html
- CloudformationResource:
AWS::RDS::DBCluster
- Mixin:
true
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview import mixins from aws_cdk.mixins_preview.aws_rds import mixins as rds_mixins cfn_dBCluster_props_mixin = rds_mixins.CfnDBClusterPropsMixin(rds_mixins.CfnDBClusterMixinProps( allocated_storage=123, associated_roles=[rds_mixins.CfnDBClusterPropsMixin.DBClusterRoleProperty( feature_name="featureName", role_arn="roleArn" )], auto_minor_version_upgrade=False, availability_zones=["availabilityZones"], backtrack_window=123, backup_retention_period=123, cluster_scalability_type="clusterScalabilityType", copy_tags_to_snapshot=False, database_insights_mode="databaseInsightsMode", database_name="databaseName", db_cluster_identifier="dbClusterIdentifier", db_cluster_instance_class="dbClusterInstanceClass", db_cluster_parameter_group_name="dbClusterParameterGroupName", db_instance_parameter_group_name="dbInstanceParameterGroupName", db_subnet_group_name="dbSubnetGroupName", db_system_id="dbSystemId", delete_automated_backups=False, deletion_protection=False, domain="domain", domain_iam_role_name="domainIamRoleName", enable_cloudwatch_logs_exports=["enableCloudwatchLogsExports"], enable_global_write_forwarding=False, enable_http_endpoint=False, enable_iam_database_authentication=False, enable_local_write_forwarding=False, engine="engine", engine_lifecycle_support="engineLifecycleSupport", engine_mode="engineMode", engine_version="engineVersion", global_cluster_identifier="globalClusterIdentifier", iops=123, kms_key_id="kmsKeyId", manage_master_user_password=False, master_user_authentication_type="masterUserAuthenticationType", master_username="masterUsername", master_user_password="masterUserPassword", master_user_secret=rds_mixins.CfnDBClusterPropsMixin.MasterUserSecretProperty( kms_key_id="kmsKeyId", secret_arn="secretArn" ), monitoring_interval=123, monitoring_role_arn="monitoringRoleArn", network_type="networkType", performance_insights_enabled=False, performance_insights_kms_key_id="performanceInsightsKmsKeyId", performance_insights_retention_period=123, port=123, preferred_backup_window="preferredBackupWindow", preferred_maintenance_window="preferredMaintenanceWindow", publicly_accessible=False, replication_source_identifier="replicationSourceIdentifier", restore_to_time="restoreToTime", restore_type="restoreType", scaling_configuration=rds_mixins.CfnDBClusterPropsMixin.ScalingConfigurationProperty( auto_pause=False, max_capacity=123, min_capacity=123, seconds_before_timeout=123, seconds_until_auto_pause=123, timeout_action="timeoutAction" ), serverless_v2_scaling_configuration=rds_mixins.CfnDBClusterPropsMixin.ServerlessV2ScalingConfigurationProperty( max_capacity=123, min_capacity=123, seconds_until_auto_pause=123 ), snapshot_identifier="snapshotIdentifier", source_db_cluster_identifier="sourceDbClusterIdentifier", source_db_cluster_resource_id="sourceDbClusterResourceId", source_region="sourceRegion", storage_encrypted=False, storage_type="storageType", tags=[CfnTag( key="key", value="value" )], use_latest_restorable_time=False, vpc_security_group_ids=["vpcSecurityGroupIds"] ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::RDS::DBCluster.- Parameters:
props (
Union[CfnDBClusterMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- supports(construct)
Check if this mixin supports the given construct.
- Parameters:
construct (
IConstruct)- Return type:
bool
Attributes
- CFN_PROPERTY_KEYS = ['allocatedStorage', 'associatedRoles', 'autoMinorVersionUpgrade', 'availabilityZones', 'backtrackWindow', 'backupRetentionPeriod', 'clusterScalabilityType', 'copyTagsToSnapshot', 'databaseInsightsMode', 'databaseName', 'dbClusterIdentifier', 'dbClusterInstanceClass', 'dbClusterParameterGroupName', 'dbInstanceParameterGroupName', 'dbSubnetGroupName', 'dbSystemId', 'deleteAutomatedBackups', 'deletionProtection', 'domain', 'domainIamRoleName', 'enableCloudwatchLogsExports', 'enableGlobalWriteForwarding', 'enableHttpEndpoint', 'enableIamDatabaseAuthentication', 'enableLocalWriteForwarding', 'engine', 'engineLifecycleSupport', 'engineMode', 'engineVersion', 'globalClusterIdentifier', 'iops', 'kmsKeyId', 'manageMasterUserPassword', 'masterUserAuthenticationType', 'masterUsername', 'masterUserPassword', 'masterUserSecret', 'monitoringInterval', 'monitoringRoleArn', 'networkType', 'performanceInsightsEnabled', 'performanceInsightsKmsKeyId', 'performanceInsightsRetentionPeriod', 'port', 'preferredBackupWindow', 'preferredMaintenanceWindow', 'publiclyAccessible', 'replicationSourceIdentifier', 'restoreToTime', 'restoreType', 'scalingConfiguration', 'serverlessV2ScalingConfiguration', 'snapshotIdentifier', 'sourceDbClusterIdentifier', 'sourceDbClusterResourceId', 'sourceRegion', 'storageEncrypted', 'storageType', 'tags', 'useLatestRestorableTime', 'vpcSecurityGroupIds']
Static Methods
- classmethod is_mixin(x)
(experimental) Checks if
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
DBClusterRoleProperty
- class CfnDBClusterPropsMixin.DBClusterRoleProperty(*, feature_name=None, role_arn=None)
Bases:
objectDescribes an AWS Identity and Access Management (IAM) role that is associated with a DB cluster.
- Parameters:
feature_name (
Optional[str]) – The name of the feature associated with the AWS Identity and Access Management (IAM) role. IAM roles that are associated with a DB cluster grant permission for the DB cluster to access other AWS services on your behalf. For the list of supported feature names, see theSupportedFeatureNamesdescription in DBEngineVersion in the Amazon RDS API Reference .role_arn (
Optional[str]) – The Amazon Resource Name (ARN) of the IAM role that is associated with the DB cluster.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_rds import mixins as rds_mixins d_bCluster_role_property = rds_mixins.CfnDBClusterPropsMixin.DBClusterRoleProperty( feature_name="featureName", role_arn="roleArn" )
Attributes
- feature_name
The name of the feature associated with the AWS Identity and Access Management (IAM) role.
IAM roles that are associated with a DB cluster grant permission for the DB cluster to access other AWS services on your behalf. For the list of supported feature names, see the
SupportedFeatureNamesdescription in DBEngineVersion in the Amazon RDS API Reference .
- role_arn
The Amazon Resource Name (ARN) of the IAM role that is associated with the DB cluster.
EndpointProperty
- class CfnDBClusterPropsMixin.EndpointProperty(*, address=None, port=None)
Bases:
objectThe
Endpointreturn value specifies the connection endpoint for the primary instance of the DB cluster.- Parameters:
address (
Optional[str]) – Specifies the connection endpoint for the primary instance of the DB cluster.port (
Optional[str]) – Specifies the port that the database engine is listening on.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_rds import mixins as rds_mixins endpoint_property = rds_mixins.CfnDBClusterPropsMixin.EndpointProperty( address="address", port="port" )
Attributes
- address
Specifies the connection endpoint for the primary instance of the DB cluster.
- port
Specifies the port that the database engine is listening on.
MasterUserSecretProperty
- class CfnDBClusterPropsMixin.MasterUserSecretProperty(*, kms_key_id=None, secret_arn=None)
Bases:
objectThe
MasterUserSecretreturn value specifies the secret managed by RDS in AWS Secrets Manager for the master user password.For more information, see Password management with AWS Secrets Manager in the Amazon RDS User Guide and Password management with AWS Secrets Manager in the Amazon Aurora User Guide.
- Parameters:
kms_key_id (
Optional[str]) – The AWS KMS key identifier that is used to encrypt the secret.secret_arn (
Optional[str]) – The Amazon Resource Name (ARN) of the secret. This parameter is a return value that you can retrieve using theFn::GetAttintrinsic function. For more information, see Return values .
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_rds import mixins as rds_mixins master_user_secret_property = rds_mixins.CfnDBClusterPropsMixin.MasterUserSecretProperty( kms_key_id="kmsKeyId", secret_arn="secretArn" )
Attributes
- kms_key_id
The AWS KMS key identifier that is used to encrypt the secret.
- secret_arn
The Amazon Resource Name (ARN) of the secret.
This parameter is a return value that you can retrieve using the
Fn::GetAttintrinsic function. For more information, see Return values .
ReadEndpointProperty
- class CfnDBClusterPropsMixin.ReadEndpointProperty(*, address=None)
Bases:
objectThe
ReadEndpointreturn value specifies the reader endpoint for the DB cluster.The reader endpoint for a DB cluster load-balances connections across the Aurora Replicas that are available in a DB cluster. As clients request new connections to the reader endpoint, Aurora distributes the connection requests among the Aurora Replicas in the DB cluster. This functionality can help balance your read workload across multiple Aurora Replicas in your DB cluster.
If a failover occurs, and the Aurora Replica that you are connected to is promoted to be the primary instance, your connection is dropped. To continue sending your read workload to other Aurora Replicas in the cluster, you can then reconnect to the reader endpoint.
For more information about Aurora endpoints, see Amazon Aurora connection management in the Amazon Aurora User Guide .
- Parameters:
address (
Optional[str]) – The host address of the reader endpoint.- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_rds import mixins as rds_mixins read_endpoint_property = rds_mixins.CfnDBClusterPropsMixin.ReadEndpointProperty( address="address" )
Attributes
- address
The host address of the reader endpoint.
ScalingConfigurationProperty
- class CfnDBClusterPropsMixin.ScalingConfigurationProperty(*, auto_pause=None, max_capacity=None, min_capacity=None, seconds_before_timeout=None, seconds_until_auto_pause=None, timeout_action=None)
Bases:
objectThe
ScalingConfigurationproperty type specifies the scaling configuration of an Aurora Serverless v1 DB cluster.For more information, see Using Amazon Aurora Serverless in the Amazon Aurora User Guide .
This property is only supported for Aurora Serverless v1. For Aurora Serverless v2, Use the
ServerlessV2ScalingConfigurationproperty.Valid for: Aurora Serverless v1 DB clusters only
- Parameters:
auto_pause (
Union[bool,IResolvable,None]) – Indicates whether to allow or disallow automatic pause for an Aurora DB cluster inserverlessDB engine mode. A DB cluster can be paused only when it’s idle (it has no connections). .. epigraph:: If a DB cluster is paused for more than seven days, the DB cluster might be backed up with a snapshot. In this case, the DB cluster is restored when there is a request to connect to it.max_capacity (
Union[int,float,None]) – The maximum capacity for an Aurora DB cluster inserverlessDB engine mode. For Aurora MySQL, valid capacity values are1,2,4,8,16,32,64,128, and256. For Aurora PostgreSQL, valid capacity values are2,4,8,16,32,64,192, and384. The maximum capacity must be greater than or equal to the minimum capacity.min_capacity (
Union[int,float,None]) – The minimum capacity for an Aurora DB cluster inserverlessDB engine mode. For Aurora MySQL, valid capacity values are1,2,4,8,16,32,64,128, and256. For Aurora PostgreSQL, valid capacity values are2,4,8,16,32,64,192, and384. The minimum capacity must be less than or equal to the maximum capacity.seconds_before_timeout (
Union[int,float,None]) – The amount of time, in seconds, that Aurora Serverless v1 tries to find a scaling point to perform seamless scaling before enforcing the timeout action. The default is 300. Specify a value between 60 and 600 seconds.seconds_until_auto_pause (
Union[int,float,None]) – The time, in seconds, before an Aurora DB cluster inserverlessmode is paused. Specify a value between 300 and 86,400 seconds.timeout_action (
Optional[str]) – The action to take when the timeout is reached, eitherForceApplyCapacityChangeorRollbackCapacityChange.ForceApplyCapacityChangesets the capacity to the specified value as soon as possible.RollbackCapacityChange, the default, ignores the capacity change if a scaling point isn’t found in the timeout period. .. epigraph:: If you specifyForceApplyCapacityChange, connections that prevent Aurora Serverless v1 from finding a scaling point might be dropped. For more information, see Autoscaling for Aurora Serverless v1 in the Amazon Aurora User Guide .
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_rds import mixins as rds_mixins scaling_configuration_property = rds_mixins.CfnDBClusterPropsMixin.ScalingConfigurationProperty( auto_pause=False, max_capacity=123, min_capacity=123, seconds_before_timeout=123, seconds_until_auto_pause=123, timeout_action="timeoutAction" )
Attributes
- auto_pause
Indicates whether to allow or disallow automatic pause for an Aurora DB cluster in
serverlessDB engine mode.A DB cluster can be paused only when it’s idle (it has no connections). .. epigraph:
If a DB cluster is paused for more than seven days, the DB cluster might be backed up with a snapshot. In this case, the DB cluster is restored when there is a request to connect to it.
- max_capacity
The maximum capacity for an Aurora DB cluster in
serverlessDB engine mode.For Aurora MySQL, valid capacity values are
1,2,4,8,16,32,64,128, and256.For Aurora PostgreSQL, valid capacity values are
2,4,8,16,32,64,192, and384.The maximum capacity must be greater than or equal to the minimum capacity.
- min_capacity
The minimum capacity for an Aurora DB cluster in
serverlessDB engine mode.For Aurora MySQL, valid capacity values are
1,2,4,8,16,32,64,128, and256.For Aurora PostgreSQL, valid capacity values are
2,4,8,16,32,64,192, and384.The minimum capacity must be less than or equal to the maximum capacity.
- seconds_before_timeout
The amount of time, in seconds, that Aurora Serverless v1 tries to find a scaling point to perform seamless scaling before enforcing the timeout action.
The default is 300.
Specify a value between 60 and 600 seconds.
- seconds_until_auto_pause
The time, in seconds, before an Aurora DB cluster in
serverlessmode is paused.Specify a value between 300 and 86,400 seconds.
- timeout_action
The action to take when the timeout is reached, either
ForceApplyCapacityChangeorRollbackCapacityChange.ForceApplyCapacityChangesets the capacity to the specified value as soon as possible.RollbackCapacityChange, the default, ignores the capacity change if a scaling point isn’t found in the timeout period. .. epigraph:If you specify ``ForceApplyCapacityChange`` , connections that prevent Aurora Serverless v1 from finding a scaling point might be dropped.
For more information, see Autoscaling for Aurora Serverless v1 in the Amazon Aurora User Guide .
ServerlessV2ScalingConfigurationProperty
- class CfnDBClusterPropsMixin.ServerlessV2ScalingConfigurationProperty(*, max_capacity=None, min_capacity=None, seconds_until_auto_pause=None)
Bases:
objectThe
ServerlessV2ScalingConfigurationproperty type specifies the scaling configuration of an Aurora Serverless V2 DB cluster.For more information, see Using Amazon Aurora Serverless v2 in the Amazon Aurora User Guide .
If you have an Aurora cluster, you must set this attribute before you add a DB instance that uses the
db.serverlessDB instance class. For more information, see Clusters that use Aurora Serverless v2 must have a capacity range specified in the Amazon Aurora User Guide .This property is only supported for Aurora Serverless v2. For Aurora Serverless v1, use the
ScalingConfigurationproperty.Valid for: Aurora Serverless v2 DB clusters
- Parameters:
max_capacity (
Union[int,float,None]) – The maximum number of Aurora capacity units (ACUs) for a DB instance in an Aurora Serverless v2 cluster. You can specify ACU values in half-step increments, such as 40, 40.5, 41, and so on. The largest value that you can use is 128. The maximum capacity must be higher than 0.5 ACUs. For more information, see Choosing the maximum Aurora Serverless v2 capacity setting for a cluster in the Amazon Aurora User Guide . Aurora automatically sets certain parameters for Aurora Serverless V2 DB instances to values that depend on the maximum ACU value in the capacity range. When you update the maximum capacity value, theParameterApplyStatusvalue for the DB instance changes topending-reboot. You can update the parameter values by rebooting the DB instance after changing the capacity range.min_capacity (
Union[int,float,None]) – The minimum number of Aurora capacity units (ACUs) for a DB instance in an Aurora Serverless v2 cluster. You can specify ACU values in half-step increments, such as 8, 8.5, 9, and so on. For Aurora versions that support the Aurora Serverless v2 auto-pause feature, the smallest value that you can use is 0. For versions that don’t support Aurora Serverless v2 auto-pause, the smallest value that you can use is 0.5.seconds_until_auto_pause (
Union[int,float,None]) – Specifies the number of seconds an Aurora Serverless v2 DB instance must be idle before Aurora attempts to automatically pause it. Specify a value between 300 seconds (five minutes) and 86,400 seconds (one day). The default is 300 seconds.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_rds import mixins as rds_mixins serverless_v2_scaling_configuration_property = rds_mixins.CfnDBClusterPropsMixin.ServerlessV2ScalingConfigurationProperty( max_capacity=123, min_capacity=123, seconds_until_auto_pause=123 )
Attributes
- max_capacity
The maximum number of Aurora capacity units (ACUs) for a DB instance in an Aurora Serverless v2 cluster.
You can specify ACU values in half-step increments, such as 40, 40.5, 41, and so on. The largest value that you can use is 128.
The maximum capacity must be higher than 0.5 ACUs. For more information, see Choosing the maximum Aurora Serverless v2 capacity setting for a cluster in the Amazon Aurora User Guide .
Aurora automatically sets certain parameters for Aurora Serverless V2 DB instances to values that depend on the maximum ACU value in the capacity range. When you update the maximum capacity value, the
ParameterApplyStatusvalue for the DB instance changes topending-reboot. You can update the parameter values by rebooting the DB instance after changing the capacity range.
- min_capacity
The minimum number of Aurora capacity units (ACUs) for a DB instance in an Aurora Serverless v2 cluster.
You can specify ACU values in half-step increments, such as 8, 8.5, 9, and so on. For Aurora versions that support the Aurora Serverless v2 auto-pause feature, the smallest value that you can use is 0. For versions that don’t support Aurora Serverless v2 auto-pause, the smallest value that you can use is 0.5.
- seconds_until_auto_pause
Specifies the number of seconds an Aurora Serverless v2 DB instance must be idle before Aurora attempts to automatically pause it.
Specify a value between 300 seconds (five minutes) and 86,400 seconds (one day). The default is 300 seconds.