Skip to content

Commit ab7f3f6

Browse files
committed
Select only production DB snapshots to recreate DB from
* The data replication DB itself is being automatically backed up. This can't be turned off. We need to change the selector in a way that it only matches snapshots of the Production DB and not the data replication snapshots
1 parent 99a4a8c commit ab7f3f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/data-replication-pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
if [ -z "${{ inputs.db_snapshot_arn }}" ]; then
7272
echo "No snapshot ARN provided, fetching the latest snapshot"
7373
SNAPSHOT_ARN=$(aws rds describe-db-cluster-snapshots \
74-
--query 'DBClusterSnapshots[?contains(DBClusterSnapshotIdentifier, `${{ inputs.environment}}`)].[DBClusterSnapshotArn, SnapshotCreateTime]' \
74+
--query 'DBClusterSnapshots[?contains(DBClusterSnapshotIdentifier, `${{ inputs.environment}}`) && !contains(DBClusterSnapshotIdentifier, `data-replication`)].[DBClusterSnapshotArn, SnapshotCreateTime]' \
7575
--output text | sort -k2 -r | head -n 1 | cut -f1)
7676
else
7777
echo "Using provided snapshot ARN: ${{ inputs.db_snapshot_arn }}"

0 commit comments

Comments
 (0)