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

Adds BackupRetentionPeriod to RDS spec #50

Merged
Merged
Changes from 3 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
4 changes: 4 additions & 0 deletions aws/sqldatabases.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ param allocatedStorage string = '20'
@description('Database license model')
param licenseModel string = 'license-included'

@description('The number of days for which automated backups are retained. Setting this parameter to a positive number enables backups. Defaults to 1.')
Copy link
Contributor

@kachawla kachawla Dec 14, 2023

Choose a reason for hiding this comment

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

Could you include this in the description as well #50 (comment)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I checked the spec for this resource and it doesn't look like there's a maximum - I think the link yetkin linked is the C# SDK

    "BackupRetentionPeriod": {
      "type": "integer",
      "minimum": 0,
      "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."
    },

https://us-west-2.console.aws.amazon.com/cloudformation/home?region=us-west-2#/registry/activated-extensions/details/schema?arn=arn%3Aaws%3Acloudformation%3Aus-west-2%3A%3Atype%2Fresource%2FAWS-RDS-DBInstance

Copy link
Contributor

Choose a reason for hiding this comment

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

https://docs.aws.amazon.com/cli/latest/reference/rds/create-db-instance.html - this describes max as 35.

Constraints:

Must be a value from 0 to 35.
Can't be set to 0 if the DB instance is a source to read replicas.
Can't be set to 0 for an RDS Custom for Oracle DB instance.

param backupRetentionPeriod int = 1

@description('Database port')
param port int = 1433

Expand Down Expand Up @@ -98,6 +101,7 @@ resource rdsDBInstance 'AWS.RDS/DBInstance@default' = {
DBSubnetGroupName: rdsDBSubnetGroup.properties.DBSubnetGroupName
VPCSecurityGroups: [eksCluster.properties.ClusterSecurityGroupId]
LicenseModel: licenseModel
BackupRetentionPeriod: backupRetentionPeriod
Tags: [
{
Key: 'radapp.io/environment'
Expand Down