This study examines the Canadian Code of Ethics for Registered Nurses as a discursive mechanism for shaping nurses' professional identity using a Foucauldian lens. Nurses are considered essential in healthcare, yet the nursing profession has struggled to be recognized for its discipline-specific knowledge and expertise and, as such, has remained the subject of and subject to the dominant discourses within healthcare and society generally. Developing a professional identity in nursing begins after the necessary education and training are achieved and embodies the profession's history, values, code of ethics, and expectations of the profession that distinguish it from other professions. Since nurses' professional identity is shaped through discourse, it raises the question of whether there are spaces to reconceptualize nurses' subject position within health care. Since professional identity is considered the embodiment of knowledge and practice, the code of ethics bears examination both for its effect on nurses' professional identity and as a potential site from which to challenge hegemonic assumptions. This article discusses the concept of professional identity in nursing and its development through the discursive formations in the code of ethics. The sources of power/knowledge are examined as both mechanisms of control and as spaces for change. © 2022 John Wiley & Sons Ltd.