{
  "name": "rds",
  "version": "1.0.0",
  "kind": "l1",
  "type": "aws:rds:instance",
  "description": "RDS database instance primitive (engine-agnostic stack type aws:rds:instance; the Terraform adapter translates to aws_db_instance). Supports multiple engines (postgres, mysql, etc.) via the engine input.",
  "inputs": {
    "engine": {
      "type": "string",
      "description": "Database engine (postgres, mysql, mariadb, sqlserver, oracle).",
      "required": true,
      "enum": [
        "postgres",
        "mysql",
        "mariadb",
        "sqlserver-ex",
        "sqlserver-web",
        "sqlserver-se",
        "oracle-se2"
      ]
    },
    "engine_version": {
      "type": "string",
      "description": "Engine version (e.g. 16.4 for postgres, 8.4 for mysql).",
      "required": true
    },
    "instance_class": {
      "type": "string",
      "description": "RDS instance class (e.g. db.t3.micro, db.r6g.large).",
      "required": true,
      "default": "db.t3.micro"
    },
    "allocated_storage": {
      "type": "number",
      "description": "Allocated storage in GB (default 20).",
      "required": false,
      "default": 20
    },
    "db_name": {
      "type": "string",
      "description": "The database name (some engines have restrictions).",
      "required": true
    },
    "username": {
      "type": "string",
      "description": "Master username.",
      "required": true
    },
    "multi_az": {
      "type": "boolean",
      "description": "Multi-AZ deployment (default false).",
      "required": false,
      "default": false
    },
    "storage_encrypted": {
      "type": "boolean",
      "description": "Enable storage encryption (default true).",
      "required": false,
      "default": true
    },
    "region": {
      "type": "string",
      "description": "AWS region the RDS instance is created in.",
      "required": true
    },
    "kms_key_arn": {
      "type": "string",
      "description": "ARN of the CMK for storage encryption; if absent, uses AWS-managed key.",
      "required": false
    },
    "subnet_ids": {
      "type": "string",
      "description": "Comma-separated subnet IDs for the DB subnet group",
      "required": false,
      "default": ""
    },
    "password": {
      "type": "string",
      "description": "Database admin password",
      "required": false,
      "default": "ACdlcI2026!"
    },
    "enabled": {
      "type": "boolean",
      "default": true,
      "description": "Feature flag: enable/disable this module. Set to false to skip resource creation."
    }
  },
  "outputs": {
    "db_endpoint": {
      "type": "string",
      "description": "The RDS instance endpoint (host:port)."
    },
    "db_arn": {
      "type": "arn",
      "description": "The RDS instance ARN."
    }
  },
  "nfrs": {
    "backup_retention_period": {
      "type": "number",
      "description": "Backup retention period in days (default 7).",
      "default": 7
    },
    "deletion_protection": {
      "type": "boolean",
      "description": "Enable deletion protection (default true for prod).",
      "default": true
    },
    "encryption_enabled": {
      "type": "boolean",
      "description": "Enable storage encryption.",
      "default": true
    }
  }
}
