(cls, filter_tag: str = "")
return sfr_id_to_tags
Gets a dictionary of SFR id -> a dictionary of tags. The tags are taken
        from the TagSpecifications for the first LaunchSpecification
Gets a dictionary of SFR id -> a dictionary of tags. The tags are taken
        from the TagSpecifications for the first LaunchSpecification
Gets a dictionary of SFR id - > a dictionary of tags . The tags are taken from the TagSpecifications for the first LaunchSpecification
def _get_resource_group_tags(cls, filter_tag: str = "") -> Mapping[str, Mapping[str, str]]:
        """ Gets a dictionary of SFR id -> a dictionary of tags. The tags are taken
        from the TagSpecifications for the first LaunchSpecification
        """
        spot_fleet_requests = ec2.describe_spot_fleet_requests()
        sfr_id_to_tags = {}
        for sfr_config in spot_fleet_requests["SpotFleetRequestConfigs"]:
            launch_specs = sfr_config["SpotFleetRequestConfig"]["LaunchSpecifications"]
            try:
                # we take the tags from the 0th launch spec for now
                # they should always be identical in every launch spec
                tags = launch_specs[0]["TagSpecifications"][0]["Tags"]
            except (IndexError, KeyError):
                # if this SFR is misssing the TagSpecifications
                tags = []
            tags_dict = {tag["Key"]: tag["Value"] for tag in tags}
            sfr_id_to_tags[sfr_config["SpotFleetRequestId"]] = tags_dict
        return sfr_id_to_tags
def _get_resource_group_tags ( cls , filter_tag : str = "" ) -> Mapping [ str , Mapping [ str , str ] ] : spot_fleet_requests = ec2 . describe_spot_fleet_requests ( ) sfr_id_to_tags = { } for sfr_config in spot_fleet_requests [ "SpotFleetRequestConfigs" ] : launch_specs = sfr_config [ "SpotFleetRequestConfig" ] [ "LaunchSpecifications" ] try : # we take the tags from the 0th launch spec for now # they should always be identical in every launch spec tags = launch_specs [ 0 ] [ "TagSpecifications" ] [ 0 ] [ "Tags" ] except ( IndexError , KeyError ) : # if this SFR is misssing the TagSpecifications tags = [ ] tags_dict = { tag [ "Key" ] : tag [ "Value" ] for tag in tags } sfr_id_to_tags [ sfr_config [ "SpotFleetRequestId" ] ] = tags_dict return sfr_id_to_tags