You can specify the fill opacity separately from the draw opacity. In the first example below I used opacity and in the second I used fill opacity which will only affect the fill and not the draw.

Note:
- As pointed out by Martin Scharrer: Specifying
\opacity=<x> affects the fill, draw and text so is equivalent to saying fill opacity=<X>, draw opacity=<X>, text opacity=<X>.
fill opacity applies not only to the fill, but also applies to text. To override this behavior, you can separately set the text opacity which applies only to the text labels. So, apply text opacity=1 to ensure that opacity is not applied to the text.
Code:
\documentclass[border=3pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw [ultra thick, draw=black, fill=yellow, opacity=0.2]
(0,0) -- (0,1) -- (1,1) -- cycle;
\end{tikzpicture}
\begin{tikzpicture}
\draw [ultra thick, draw=black, fill=yellow, fill opacity=0.2]
(0,0) -- (0,1) -- (1,1) -- cycle;
\end{tikzpicture}
\end{document}
opacity=<X>is just a short-cut forfill opacity=<X>,draw opacity=<X>. Both are actual to different low-level settings in the output file (e.g. PDF). – Martin Scharrer Dec 21 '11 at 18:52text opacity=1. – oarfish Sep 01 '15 at 08:57transparency group, fill opacity=0.3, text opacity=1will not work as expected. – cgogolin Jan 17 '19 at 09:38transparency groups so I recommend you post a new question with a fully compilable MWE including\documentclassand the appropriate packages that reproduces the problem. – Peter Grill Jan 17 '19 at 16:43