(cls, cluster: str, pool: str, config: Any, **kwargs: Any)
return matching_resource_groups
Load a list of corresponding resource groups

        :param cluster: a cluster name
        :param pool: a pool name
        :param config: a config specific to a resource group type
        :returns: a dictionary of resource groups, indexed by id
Load a list of corresponding resource groups
Load a list of corresponding resource groups
def load(cls, cluster: str, pool: str, config: Any, **kwargs: Any) -> Mapping[str, "AWSResourceGroup"]:
        """ Load a list of corresponding resource groups

        :param cluster: a cluster name
        :param pool: a pool name
        :param config: a config specific to a resource group type
        :returns: a dictionary of resource groups, indexed by id
        """

        try:
            identifier_tag_label = config["tag"]
        except KeyError:
            return {}

        resource_group_tags = cls._get_resource_group_tags(identifier_tag_label)
        matching_resource_groups = {}

        for rg_id, tags in resource_group_tags.items():
            try:
                tag_json = tags.get(identifier_tag_label)
                # Not every ASG/SFR/etc will have the right tags, because they belong to someone else
                if tag_json:
                    identifier_tags = json.loads(tag_json)
                    if identifier_tags["pool"] == pool and identifier_tags["paasta_cluster"] == cluster:
                        rg = cls(rg_id, **kwargs)
                        matching_resource_groups[rg_id] = rg
            except Exception:
                logger.exception(f"Could not load resource group {rg_id}; skipping...")
                continue
        return matching_resource_groups
def load ( cls , cluster : str , pool : str , config : Any , * * kwargs : Any ) -> Mapping [ str , "AWSResourceGroup" ] : try : identifier_tag_label = config [ "tag" ] except KeyError : return { } resource_group_tags = cls . _get_resource_group_tags ( identifier_tag_label ) matching_resource_groups = { } for rg_id , tags in resource_group_tags . items ( ) : try : tag_json = tags . get ( identifier_tag_label ) # Not every ASG/SFR/etc will have the right tags, because they belong to someone else if tag_json : identifier_tags = json . loads ( tag_json ) if identifier_tags [ "pool" ] == pool and identifier_tags [ "paasta_cluster" ] == cluster : rg = cls ( rg_id , * * kwargs ) matching_resource_groups [ rg_id ] = rg except Exception : logger . exception ( f"Could not load resource group {rg_id}; skipping..." ) continue return matching_resource_groups