Shelvery v0.9.11

Introduction

Shelvery v0.9.11 introduces important improvements to tag handling for RDS instances, DocumentDB clusters, and Aurora clusters. This release focuses on making the backup process more robust by implementing safer tag retrieval mechanisms.

Features

Enhanced Tag Handling

The primary enhancement in this release is the implementation of safe tag retrieval across multiple AWS database services:

Technical Improvements

The following improvements have been made to the codebase:

  1. RDS Backup Module:

    • Added safe tag retrieval using .get('TagList', []) instead of direct access
    • Implemented fallback to empty list when tags are not available
    • Enhanced tag handling for both instance and snapshot resources
  2. DocumentDB Backup Module:

    • Improved tag collection from DocumentDB cluster snapshots
    • Added null safety for tag retrieval operations
    • Enhanced error handling for tag-related operations
  3. RDS Cluster Backup Module:

    • Implemented safe tag access for Aurora clusters
    • Added proper fallback mechanisms for missing tags
    • Enhanced tag collection for cluster snapshots

Examples

Tag Retrieval Implementation

The new tag retrieval mechanism is implemented across all database services. Here’s an example of how tags are now safely retrieved:

# Previous implementation (potentially unsafe)
tags = snapshot['TagList']

# New implementation (safe with fallback)
tags = snapshot.get('TagList', [])

Using with RDS Instances

When working with RDS instances, tags are now safely retrieved:

# Safe tag retrieval for RDS instances
tags = rds_client.list_tags_for_resource(
    ResourceName=rds_instance['DBInstanceArn']
).get('TagList', [])

DocumentDB Cluster Handling

For DocumentDB clusters, the new implementation ensures safe tag handling:

# Safe tag retrieval for DocumentDB clusters
tags = docdb_client.list_tags_for_resource(
    ResourceName=snapshot['DBClusterSnapshotArn']
).get('TagList', [])

Conclusion

Shelvery v0.9.11 represents a significant improvement in the reliability of tag handling across all supported database services. The enhanced error handling and null safety mechanisms ensure more robust backup operations, reducing the likelihood of failures due to missing or malformed tags.

Upgrade Instructions

To upgrade to the latest version, update your deployment scripts with the new version number:

SHELVERY_VERSION=0.9.11

Or if using pip:

pip install shelvery==0.9.11

For AWS SAM deployments, the template has been updated to reflect the new version automatically.