def get_target_group_arns(tg_names: List[str], client: boto3.client) -> Dict: """ Return list of target group ARNs based on list of target group names return structure: { "TargetGroupName": "TargetGroupArn", .... } """ logger.debug(f"Target group name(s): {str(tg_names)} Looking for ARN") res = client.describe_target_groups(Names=tg_names) tg_arns = {} for tg in res["TargetGroups"]: tg_arns[tg["TargetGroupName"]] = tg["TargetGroupArn"] logger.debug(f"Target groups ARN: {str(tg_arns)}") return tg_arns
def get_target_group_arns(tg_names: List[str], client: boto3.client) -> Dict: """ Return list of target group ARNs based on list of target group names return structure: { "TargetGroupName": "TargetGroupArn", .... } """ logger.debug("Target group name(s): {} Looking for ARN".format( str(tg_names))) res = client.describe_target_groups(Names=tg_names) tg_arns = {} for tg in res['TargetGroups']: tg_arns[tg['TargetGroupName']] = tg['TargetGroupArn'] logger.debug("Target groups ARNs: {}".format(str(tg_arns))) return tg_arns