A rotation angle sensor (10A-10C, 10E-10I) configured to detect a rotation angle of a shaft, the rotation angle sensor comprising: an attachment member (30A-30C, 30H, 30I); and a sensor integrated circuit (20A-20G, 20I) attached to an attachment surface of the attachment member, wherein the attachment member includes: a connecting terminal protruding away from the attachment surface; and a guide (36-38, 37B, 38B, 37C, 38C) protruding away from the attachment surface and configured to position, together with the connecting terminal, the sensor integrated circuit at an attachment position (39, 30B, 30C), the sensor integrated circuit includes: a lead frame (21, 21B-21D) on which an electronic circuit for detecting the rotation angle is mounted; and an exterior that covers the electronic circuit, the lead frame includes: a lead configured to guide a terminal of the electronic circuit from an inside to an outside of the exterior, and an extending portion (215-219, 215C, 215D) located in at least a portion of an outer periphery of the exterior, at least one of the lead and the extending portion has an elastic structure, and the sensor integrated circuit is attached to the attachment member by an elastic force generated from the elastic structure that biases a portion of the extending portion against the guide and that joins the lead to the connecting terminal. an attachment member (30A-30C, 30H, 30I); and a sensor integrated circuit (20A-20G, 20I) attached to an attachment surface of the attachment member, wherein the attachment member includes: a connecting terminal protruding away from the attachment surface; and a guide (36-38, 37B, 38B, 37C, 38C) protruding away from the attachment surface and configured to position, together with the connecting terminal, the sensor integrated circuit at an attachment position (39, 30B, 30C), a connecting terminal protruding away from the attachment surface; and a guide (36-38, 37B, 38B, 37C, 38C) protruding away from the attachment surface and configured to position, together with the connecting terminal, the sensor integrated circuit at an attachment position (39, 30B, 30C), the sensor integrated circuit includes: a lead frame (21, 21B-21D) on which an electronic circuit for detecting the rotation angle is mounted; and an exterior that covers the electronic circuit, a lead frame (21, 21B-21D) on which an electronic circuit for detecting the rotation angle is mounted; and an exterior that covers the electronic circuit, the lead frame includes: a lead configured to guide a terminal of the electronic circuit from an inside to an outside of the exterior, and an extending portion (215-219, 215C, 215D) located in at least a portion of an outer periphery of the exterior, a lead configured to guide a terminal of the electronic circuit from an inside to an outside of the exterior, and an extending portion (215-219, 215C, 215D) located in at least a portion of an outer periphery of the exterior, at least one of the lead and the extending portion has an elastic structure, and the sensor integrated circuit is attached to the attachment member by an elastic force generated from the elastic structure that biases a portion of the extending portion against the guide and that joins the lead to the connecting terminal.