How to keep existing tags on aurora autoscaled replicas from primary database?

Viewed 150

My question is when i am autoscaling my primary database i need all new automatically created replicas have the same tags that original database has been setup with, i am working in aws cli. So far i can only add new tags but on already existing databases, since adding tags requires ARN, but in my understanding in autoscaling, if replicas has not been created then there is no ARN... I need either preserve all tags from primary database to all autoscaled instances or to add tags to an autoscaling policy... below code is my steps:

# 1. We need to register db cluster to apply autoscaling policy:

aws application-autoscaling register-scalable-target \
    --service-namespace rds \
    --resource-id cluster:resourseidname \
    --scalable-dimension rds:cluster:ReadReplicaCount \
    --min-capacity 1 \
    --max-capacity 8


# 2. Creating Autoscaling policy with the following command:

aws application-autoscaling put-scaling-policy \
    --policy-name cli-autoscaling-tagging-test \
    --policy-type TargetTrackingScaling \
    --resource-id cluster:cluster name \
    --service-namespace rds \
    --scalable-dimension rds:cluster:ReadReplicaCount \
    --target-tracking-scaling-policy-configuration file://custom_metrics.json
0 Answers
Related