You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""Fetches connection parameters (`host`, `port`, etc.) from the DescribeDBInstances RDS API using `master_instance_arn` in the master secret metadata as a filter.
569
+
570
+
This helper function fetches connection parameters from the DescribeDBInstances RDS API using `master_instance_arn` in the master secret metadata as a filter.
571
+
572
+
Args:
573
+
master_dict (dictionary): The master secret dictionary that will be updated with connection parameters.
574
+
575
+
master_instance_arn (string): The DB Instance ARN from master secret System Tags that will be used as a filter in DescribeDBInstances RDS API calls.
576
+
577
+
Returns:
578
+
master_dict (dictionary): An updated master secret dictionary that now contains connection parameters such as `host`, `port`, etc.
579
+
580
+
Raises:
581
+
Exception: If there is some error/throttling when calling the DescribeDBInstances RDS API
582
+
583
+
ValueError: If the DescribeDBInstances RDS API Response contains no Instances or more than 1 Instance
logger.error("setSecret: Encountered API error while fetching connection parameters from DescribeDBInstances RDS API: %s"%err)
593
+
raiseException("Encountered API error while fetching connection parameters from DescribeDBInstances RDS API: %s"%err)
594
+
595
+
# Verify the instance was found
596
+
instances=describe_response['DBInstances']
597
+
iflen(instances) ==0:
598
+
logger.error("setSecret: %s is not a valid DB Instance ARN. No Instances found when using DescribeDBInstances RDS API to get connection params."%master_instance_arn)
599
+
raiseValueError("%s is not a valid DB Instance ARN. No Instances found when using DescribeDBInstances RDS API to get connection params."%master_instance_arn)
600
+
601
+
# put connection parameters in master secret dictionary
"""Fetches connection parameters (`host`, `port`, etc.) from the DescribeDBInstances RDS API using `master_instance_arn` in the master secret metadata as a filter.
619
+
620
+
This helper function fetches connection parameters from the DescribeDBInstances RDS API using `master_instance_arn` in the master secret metadata as a filter.
621
+
622
+
Args:
623
+
master_dict (dictionary): The master secret dictionary that will be updated with connection parameters.
624
+
625
+
master_instance_arn (string): The DB Instance ARN from master secret System Tags that will be used as a filter in DescribeDBInstances RDS API calls.
626
+
627
+
Returns:
628
+
master_dict (dictionary): An updated master secret dictionary that now contains connection parameters such as `host`, `port`, etc.
629
+
630
+
Raises:
631
+
Exception: If there is some error/throttling when calling the DescribeDBInstances RDS API
632
+
633
+
ValueError: If the DescribeDBInstances RDS API Response contains no Instances or more than 1 Instance
logger.error("setSecret: Encountered API error while fetching connection parameters from DescribeDBInstances RDS API: %s"%err)
643
+
raiseException("Encountered API error while fetching connection parameters from DescribeDBInstances RDS API: %s"%err)
644
+
645
+
# Verify the instance was found
646
+
instances=describe_response['DBInstances']
647
+
iflen(instances) ==0:
648
+
logger.error("setSecret: %s is not a valid DB Instance ARN. No Instances found when using DescribeDBInstances RDS API to get connection params."%master_instance_arn)
649
+
raiseValueError("%s is not a valid DB Instance ARN. No Instances found when using DescribeDBInstances RDS API to get connection params."%master_instance_arn)
650
+
651
+
# put connection parameters in master secret dictionary
0 commit comments