def METHOD_NAME(
    self,
    association_id: str,
    iam_instance_profile_name: Optional[str] = None,
    iam_instance_profile_arn: Optional[str] = None,
) -> IamInstanceProfileAssociation:
    instance_profile = filter_iam_instance_profiles(
        self.account_id, iam_instance_profile_arn, iam_instance_profile_name  # type: ignore[attr-defined]
    )
    iam_instance_profile_association = None
    for association_key in self.iam_instance_profile_associations.keys():
        if (
            self.iam_instance_profile_associations[association_key].id
            == association_id
        ):
            self.iam_instance_profile_associations[
                association_key
            ].iam_instance_profile = instance_profile
            iam_instance_profile_association = (
                self.iam_instance_profile_associations[association_key]
            )
            break
    if not iam_instance_profile_association:
        raise InvalidAssociationIDIamProfileAssociationError(association_id)
    return iam_instance_profile_association