CfnDBInstancePropsMixin
- class aws_cdk.mixins_preview.aws_rds.mixins.CfnDBInstancePropsMixin(props, *, strategy=None)
Bases:
MixinThe
AWS::RDS::DBInstanceresource creates an Amazon DB instance.The new DB instance can be an RDS DB instance, or it can be a DB instance in an Aurora DB cluster.
For more information about creating an RDS DB instance, see Creating an Amazon RDS DB instance in the Amazon RDS User Guide .
For more information about creating a DB instance in an Aurora DB cluster, see Creating an Amazon Aurora DB cluster in the Amazon Aurora User Guide .
If you import an existing DB instance, and the template configuration doesn’t match the actual configuration of the DB instance, AWS CloudFormation applies the changes in the template during the import operation. .. epigraph:
If a DB instance is deleted or replaced during an update, AWS CloudFormation deletes all automated snapshots. However, it retains manual DB snapshots. During an update that requires replacement, you can apply a stack policy to prevent DB instances from being replaced. For more information, see `Prevent Updates to Stack Resources <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html>`_ .
Updating DB instances
When properties labeled “ Update requires: Replacement “ are updated, AWS CloudFormation first creates a replacement DB instance, then changes references from other dependent resources to point to the replacement DB instance, and finally deletes the old DB instance. .. 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 instance. To preserve your data, perform the following procedure: - Deactivate any applications that are using the DB instance so that there's no activity on the DB instance. - Create a snapshot of the DB instance. For more information, see `Creating a DB Snapshot <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CreateSnapshot.html>`_ . - If you want to restore your instance using a DB snapshot, modify the updated template with your DB instance changes and add the ``DBSnapshotIdentifier`` property with the ID of the DB snapshot that you want to use. After you restore a DB instance with a ``DBSnapshotIdentifier`` property, you can delete the ``DBSnapshotIdentifier`` property. When you specify this property for an update, the DB instance is not restored from the DB snapshot again, and the data in the database is not changed. However, if you don't specify the ``DBSnapshotIdentifier`` property, an empty DB instance is created, and the original DB instance is deleted. If you specify a property that is different from the previous snapshot restore property, a new DB instance is restored from the specified ``DBSnapshotIdentifier`` property, and the original DB instance is deleted. - Update the stack.
For more information about updating other properties of this resource, see
[ModifyDBInstance](https://docs.aws.amazon.com//AmazonRDS/latest/APIReference/API_ModifyDBInstance.html). For more information about updating stacks, see AWS CloudFormation Stacks Updates .Deleting DB instances
For DB instances that are part of an Aurora DB cluster, you can set a deletion policy for your DB instance to control how AWS CloudFormation handles the DB instance when the stack is deleted. For Amazon RDS DB instances, you can choose to retain the DB instance, to delete the DB instance, or to create a snapshot of the DB instance. The default AWS CloudFormation behavior depends on the
DBClusterIdentifierproperty:For
AWS::RDS::DBInstanceresources that don’t specify theDBClusterIdentifierproperty, AWS CloudFormation saves a snapshot of the DB instance.For
AWS::RDS::DBInstanceresources that do specify theDBClusterIdentifierproperty, AWS CloudFormation deletes the DB instance.
For more information, see DeletionPolicy Attribute .
- See:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbinstance.html
- CloudformationResource:
AWS::RDS::DBInstance
- 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_dBInstance_props_mixin = rds_mixins.CfnDBInstancePropsMixin(rds_mixins.CfnDBInstanceMixinProps( allocated_storage="allocatedStorage", allow_major_version_upgrade=False, apply_immediately=False, associated_roles=[rds_mixins.CfnDBInstancePropsMixin.DBInstanceRoleProperty( feature_name="featureName", role_arn="roleArn" )], automatic_backup_replication_kms_key_id="automaticBackupReplicationKmsKeyId", automatic_backup_replication_region="automaticBackupReplicationRegion", automatic_backup_replication_retention_period=123, auto_minor_version_upgrade=False, availability_zone="availabilityZone", backup_retention_period=123, backup_target="backupTarget", ca_certificate_identifier="caCertificateIdentifier", certificate_rotation_restart=False, character_set_name="characterSetName", copy_tags_to_snapshot=False, custom_iam_instance_profile="customIamInstanceProfile", database_insights_mode="databaseInsightsMode", db_cluster_identifier="dbClusterIdentifier", db_cluster_snapshot_identifier="dbClusterSnapshotIdentifier", db_instance_class="dbInstanceClass", db_instance_identifier="dbInstanceIdentifier", db_name="dbName", db_parameter_group_name="dbParameterGroupName", db_security_groups=["dbSecurityGroups"], db_snapshot_identifier="dbSnapshotIdentifier", db_subnet_group_name="dbSubnetGroupName", db_system_id="dbSystemId", dedicated_log_volume=False, delete_automated_backups=False, deletion_protection=False, domain="domain", domain_auth_secret_arn="domainAuthSecretArn", domain_dns_ips=["domainDnsIps"], domain_fqdn="domainFqdn", domain_iam_role_name="domainIamRoleName", domain_ou="domainOu", enable_cloudwatch_logs_exports=["enableCloudwatchLogsExports"], enable_iam_database_authentication=False, enable_performance_insights=False, engine="engine", engine_lifecycle_support="engineLifecycleSupport", engine_version="engineVersion", iops=123, kms_key_id="kmsKeyId", license_model="licenseModel", manage_master_user_password=False, master_user_authentication_type="masterUserAuthenticationType", master_username="masterUsername", master_user_password="masterUserPassword", master_user_secret=rds_mixins.CfnDBInstancePropsMixin.MasterUserSecretProperty( kms_key_id="kmsKeyId", secret_arn="secretArn" ), max_allocated_storage=123, monitoring_interval=123, monitoring_role_arn="monitoringRoleArn", multi_az=False, nchar_character_set_name="ncharCharacterSetName", network_type="networkType", option_group_name="optionGroupName", performance_insights_kms_key_id="performanceInsightsKmsKeyId", performance_insights_retention_period=123, port="port", preferred_backup_window="preferredBackupWindow", preferred_maintenance_window="preferredMaintenanceWindow", processor_features=[rds_mixins.CfnDBInstancePropsMixin.ProcessorFeatureProperty( name="name", value="value" )], promotion_tier=123, publicly_accessible=False, replica_mode="replicaMode", restore_time="restoreTime", source_db_cluster_identifier="sourceDbClusterIdentifier", source_db_instance_automated_backups_arn="sourceDbInstanceAutomatedBackupsArn", source_db_instance_identifier="sourceDbInstanceIdentifier", source_dbi_resource_id="sourceDbiResourceId", source_region="sourceRegion", storage_encrypted=False, storage_throughput=123, storage_type="storageType", tags=[CfnTag( key="key", value="value" )], tde_credential_arn="tdeCredentialArn", tde_credential_password="tdeCredentialPassword", timezone="timezone", use_default_processor_features=False, use_latest_restorable_time=False, vpc_security_groups=["vpcSecurityGroups"] ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::RDS::DBInstance.- Parameters:
props (
Union[CfnDBInstanceMixinProps,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', 'allowMajorVersionUpgrade', 'applyImmediately', 'associatedRoles', 'automaticBackupReplicationKmsKeyId', 'automaticBackupReplicationRegion', 'automaticBackupReplicationRetentionPeriod', 'autoMinorVersionUpgrade', 'availabilityZone', 'backupRetentionPeriod', 'backupTarget', 'caCertificateIdentifier', 'certificateRotationRestart', 'characterSetName', 'copyTagsToSnapshot', 'customIamInstanceProfile', 'databaseInsightsMode', 'dbClusterIdentifier', 'dbClusterSnapshotIdentifier', 'dbInstanceClass', 'dbInstanceIdentifier', 'dbName', 'dbParameterGroupName', 'dbSecurityGroups', 'dbSnapshotIdentifier', 'dbSubnetGroupName', 'dbSystemId', 'dedicatedLogVolume', 'deleteAutomatedBackups', 'deletionProtection', 'domain', 'domainAuthSecretArn', 'domainDnsIps', 'domainFqdn', 'domainIamRoleName', 'domainOu', 'enableCloudwatchLogsExports', 'enableIamDatabaseAuthentication', 'enablePerformanceInsights', 'engine', 'engineLifecycleSupport', 'engineVersion', 'iops', 'kmsKeyId', 'licenseModel', 'manageMasterUserPassword', 'masterUserAuthenticationType', 'masterUsername', 'masterUserPassword', 'masterUserSecret', 'maxAllocatedStorage', 'monitoringInterval', 'monitoringRoleArn', 'multiAz', 'ncharCharacterSetName', 'networkType', 'optionGroupName', 'performanceInsightsKmsKeyId', 'performanceInsightsRetentionPeriod', 'port', 'preferredBackupWindow', 'preferredMaintenanceWindow', 'processorFeatures', 'promotionTier', 'publiclyAccessible', 'replicaMode', 'restoreTime', 'sourceDbClusterIdentifier', 'sourceDbInstanceAutomatedBackupsArn', 'sourceDbInstanceIdentifier', 'sourceDbiResourceId', 'sourceRegion', 'storageEncrypted', 'storageThroughput', 'storageType', 'tags', 'tdeCredentialArn', 'tdeCredentialPassword', 'timezone', 'useDefaultProcessorFeatures', 'useLatestRestorableTime', 'vpcSecurityGroups']
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
CertificateDetailsProperty
- class CfnDBInstancePropsMixin.CertificateDetailsProperty(*, ca_identifier=None, valid_till=None)
Bases:
objectThe details of the DB instance’s server certificate.
For more information, see Using SSL/TLS to encrypt a connection to a DB instance in the Amazon RDS User Guide and Using SSL/TLS to encrypt a connection to a DB cluster in the Amazon Aurora User Guide .
- Parameters:
ca_identifier (
Optional[str]) – The CA identifier of the CA certificate used for the DB instance’s server certificate.valid_till (
Optional[str]) – The expiration date of the DB instance’s server certificate.
- 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 certificate_details_property = rds_mixins.CfnDBInstancePropsMixin.CertificateDetailsProperty( ca_identifier="caIdentifier", valid_till="validTill" )
Attributes
- ca_identifier
The CA identifier of the CA certificate used for the DB instance’s server certificate.
- valid_till
The expiration date of the DB instance’s server certificate.
DBInstanceRoleProperty
- class CfnDBInstancePropsMixin.DBInstanceRoleProperty(*, feature_name=None, role_arn=None)
Bases:
objectInformation about an AWS Identity and Access Management (IAM) role that is associated with a DB instance.
- 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 instance grant permission for the DB instance 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 instance.
- 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_bInstance_role_property = rds_mixins.CfnDBInstancePropsMixin.DBInstanceRoleProperty( 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 instance grant permission for the DB instance 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 instance.
DBInstanceStatusInfoProperty
- class CfnDBInstancePropsMixin.DBInstanceStatusInfoProperty(*, message=None, normal=None, status=None, status_type=None)
Bases:
objectProvides a list of status information for a DB instance.
- Parameters:
message (
Optional[str]) – Details of the error if there is an error for the instance. If the instance isn’t in an error state, this value is blank.normal (
Union[bool,IResolvable,None]) – Indicates whether the instance is operating normally (TRUE) or is in an error state (FALSE).status (
Optional[str]) – The status of the DB instance. For a StatusType of read replica, the values can be replicating, replication stop point set, replication stop point reached, error, stopped, or terminated.status_type (
Optional[str]) – This value is currently “read replication.”.
- 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_bInstance_status_info_property = rds_mixins.CfnDBInstancePropsMixin.DBInstanceStatusInfoProperty( message="message", normal=False, status="status", status_type="statusType" )
Attributes
- message
Details of the error if there is an error for the instance.
If the instance isn’t in an error state, this value is blank.
- normal
Indicates whether the instance is operating normally (TRUE) or is in an error state (FALSE).
- status
The status of the DB instance.
For a StatusType of read replica, the values can be replicating, replication stop point set, replication stop point reached, error, stopped, or terminated.
- status_type
This value is currently “read replication.”.
EndpointProperty
- class CfnDBInstancePropsMixin.EndpointProperty(*, address=None, hosted_zone_id=None, port=None)
Bases:
objectThis data type represents the information you need to connect to an Amazon RDS DB instance.
This data type is used as a response element in the following actions:
CreateDBInstanceDescribeDBInstancesDeleteDBInstance
For the data structure that represents Amazon Aurora DB cluster endpoints, see
DBClusterEndpoint.- Parameters:
address (
Optional[str]) – Specifies the DNS address of the DB instance.hosted_zone_id (
Optional[str]) – Specifies the ID that Amazon Route 53 assigns when you create a hosted zone.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.CfnDBInstancePropsMixin.EndpointProperty( address="address", hosted_zone_id="hostedZoneId", port="port" )
Attributes
- address
Specifies the DNS address of the DB instance.
- hosted_zone_id
Specifies the ID that Amazon Route 53 assigns when you create a hosted zone.
- port
Specifies the port that the database engine is listening on.
MasterUserSecretProperty
- class CfnDBInstancePropsMixin.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.CfnDBInstancePropsMixin.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 .
ProcessorFeatureProperty
- class CfnDBInstancePropsMixin.ProcessorFeatureProperty(*, name=None, value=None)
Bases:
objectThe
ProcessorFeatureproperty type specifies the processor features of a DB instance class.- Parameters:
name (
Optional[str]) – The name of the processor feature. Valid names arecoreCountandthreadsPerCore.value (
Optional[str]) – The value of a processor feature.
- 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 processor_feature_property = rds_mixins.CfnDBInstancePropsMixin.ProcessorFeatureProperty( name="name", value="value" )
Attributes
- name
The name of the processor feature.
Valid names are
coreCountandthreadsPerCore.
- value
The value of a processor feature.