Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for DBInstance BackupTarget #526

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions aws-rds-dbinstance/aws-rds-dbinstance.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,15 @@
"default": 1,
"description": "The number of days for which automated backups are retained. Setting this parameter to a positive number enables backups. Setting this parameter to 0 disables automated backups."
},
"BackupTarget": {
"type": "string",
"description": "Where to store automated backups and manual snapshots, either in the AWS Region (default) or locally in your Outpost.",
"default": "region",
"enum": [
"outposts",
"region"
]
},
"CACertificateIdentifier": {
"type": "string",
"description": "The identifier of the CA certificate for this DB instance."
Expand Down Expand Up @@ -488,6 +497,7 @@
"/properties/StorageType": "$lowercase(StorageType)"
},
"createOnlyProperties": [
"/properties/BackupTarget",
"/properties/CharacterSetName",
"/properties/CustomIAMInstanceProfile",
"/properties/DBClusterIdentifier",
Expand Down
15 changes: 15 additions & 0 deletions aws-rds-dbinstance/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ To declare this entity in your AWS CloudFormation template, use the following sy
"<a href="#automaticbackupreplicationregion" title="AutomaticBackupReplicationRegion">AutomaticBackupReplicationRegion</a>" : <i>String</i>,
"<a href="#availabilityzone" title="AvailabilityZone">AvailabilityZone</a>" : <i>String</i>,
"<a href="#backupretentionperiod" title="BackupRetentionPeriod">BackupRetentionPeriod</a>" : <i>Integer</i>,
"<a href="#backuptarget" title="BackupTarget">BackupTarget</a>" : <i>String</i>,
"<a href="#cacertificateidentifier" title="CACertificateIdentifier">CACertificateIdentifier</a>" : <i>String</i>,
"<a href="#certificatedetails" title="CertificateDetails">CertificateDetails</a>" : <i><a href="certificatedetails.md">CertificateDetails</a></i>,
"<a href="#certificaterotationrestart" title="CertificateRotationRestart">CertificateRotationRestart</a>" : <i>Boolean</i>,
Expand Down Expand Up @@ -105,6 +106,7 @@ Properties:
<a href="#automaticbackupreplicationregion" title="AutomaticBackupReplicationRegion">AutomaticBackupReplicationRegion</a>: <i>String</i>
<a href="#availabilityzone" title="AvailabilityZone">AvailabilityZone</a>: <i>String</i>
<a href="#backupretentionperiod" title="BackupRetentionPeriod">BackupRetentionPeriod</a>: <i>Integer</i>
<a href="#backuptarget" title="BackupTarget">BackupTarget</a>: <i>String</i>
<a href="#cacertificateidentifier" title="CACertificateIdentifier">CACertificateIdentifier</a>: <i>String</i>
<a href="#certificatedetails" title="CertificateDetails">CertificateDetails</a>: <i><a href="certificatedetails.md">CertificateDetails</a></i>
<a href="#certificaterotationrestart" title="CertificateRotationRestart">CertificateRotationRestart</a>: <i>Boolean</i>
Expand Down Expand Up @@ -256,6 +258,18 @@ _Type_: Integer

_Update requires_: [Some interruptions](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-some-interrupt)

#### BackupTarget

Where to store automated backups and manual snapshots, either in the AWS Region (default) or locally in your Outpost.

_Required_: No

_Type_: String

_Allowed Values_: <code>outposts</code> | <code>region</code>

_Update requires_: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement)

#### CACertificateIdentifier

The identifier of the CA certificate for this DB instance.
Expand Down Expand Up @@ -1018,3 +1032,4 @@ Returns the <code>CAIdentifier</code> value.
#### ValidTill

Returns the <code>ValidTill</code> value.

Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ public static CreateDbInstanceRequest createDbInstanceRequestV12(
.autoMinorVersionUpgrade(model.getAutoMinorVersionUpgrade())
.availabilityZone(model.getAvailabilityZone())
.backupRetentionPeriod(model.getBackupRetentionPeriod())
.backupTarget(model.getBackupTarget())
.customIamInstanceProfile(model.getCustomIAMInstanceProfile())
.characterSetName(model.getCharacterSetName())
.dbInstanceClass(model.getDBInstanceClass())
Expand Down Expand Up @@ -279,6 +280,7 @@ public static CreateDbInstanceRequest createDbInstanceRequest(
.autoMinorVersionUpgrade(model.getAutoMinorVersionUpgrade())
.availabilityZone(model.getAvailabilityZone())
.backupRetentionPeriod(model.getBackupRetentionPeriod())
.backupTarget(model.getBackupTarget())
Copy link
Collaborator

@zrfr zrfr Jun 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be included in RestoreDBInstanceFromDBSnapshot and RestoreDBInstanceToPointInTime too.

.caCertificateIdentifier(model.getCACertificateIdentifier())
.characterSetName(model.getCharacterSetName())
.copyTagsToSnapshot(model.getCopyTagsToSnapshot())
Expand Down Expand Up @@ -824,6 +826,7 @@ public static ResourceModel.ResourceModelBuilder translateDbInstanceFromSdkBuild
.autoMinorVersionUpgrade(dbInstance.autoMinorVersionUpgrade())
.availabilityZone(dbInstance.availabilityZone())
.backupRetentionPeriod(dbInstance.backupRetentionPeriod())
.backupTarget(dbInstance.backupTarget())
.cACertificateIdentifier(dbInstance.caCertificateIdentifier())
.certificateDetails(translateCertificateDetailsFromSdk(dbInstance.certificateDetails()))
.characterSetName(dbInstance.characterSetName())
Expand Down