# Path: stacker_blueprints/rds/base.py
# def validate_backup_retention_period(value):
#     if not (0 <= value <= 35):
#         raise ValueError(
#             "Backup retention period must be between 0 and 35."
#         )
#     return value


from troposphere import (
    GetAtt, Ref, ec2, Output, Tags
)
from troposphere.rds import (
    DBSubnetGroup,
    DBClusterParameterGroup,
    DBCluster,
)
from troposphere.route53 import RecordSetType
from stacker.blueprints.base import Blueprint
from stacker.blueprints.variables.types import CFNString
from stacker_blueprints.rds.base import validate_backup_retention_period



# Resource name constants
SUBNET_GROUP = "SubnetGroup"
PARAMETER_GROUP = "ClusterParameterGroup"
SECURITY_GROUP = "SecurityGroup"
DBCLUSTER = "DBCluster"
DNS_RECORD = "DBClusterMasterDnsRecord"


class Cluster(Blueprint):
    VARIABLES = {
        "BackupRetentionPeriod": {
            "type": int,
            "description": "Number of days to retain database backups.",

# Path: stacker_blueprints/rds/base.py
# def validate_backup_retention_period(value):
#     if not (0 <= value <= 35):
#         raise ValueError(
#             "Backup retention period must be between 0 and 35."
#         )
#     return value


# Path: stacker_blueprints/rds/aurora/base.py
from troposphere import (
    GetAtt, Ref, ec2, Output, Tags
)
from troposphere.rds import (
    DBSubnetGroup,
    DBClusterParameterGroup,
    DBCluster,
)
from troposphere.route53 import RecordSetType
from stacker.blueprints.base import Blueprint
from stacker.blueprints.variables.types import CFNString
from stacker_blueprints.rds.base import validate_backup_retention_period




# Resource name constants
SUBNET_GROUP = "SubnetGroup"
PARAMETER_GROUP = "ClusterParameterGroup"
SECURITY_GROUP = "SecurityGroup"
DBCLUSTER = "DBCluster"
DNS_RECORD = "DBClusterMasterDnsRecord"


class Cluster(Blueprint):
    VARIABLES = {
        "BackupRetentionPeriod": {
            "type": int,
            "description": "Number of days to retain database backups.",

            "validator": validate_backup_retention_period,