Free abelian group of fractional ideals

This question is from Ch.2 of Frohlich and Taylor's Algebraic Number Theory, page 42.

Let $R$ be a Dedekind domain, $I_R$ the multiplicative group of fractional $R$-ideals. There is an isomorphism of groups $I_R\cong \bigoplus_{\mathfrak p}\mathbb Z$, where $\mathfrak p$ ranges over all prime ideals of $R$.

How does it follow that given an abelian group $A$ and any set of elements $a(\mathfrak p)\in A$ there exists a unique homomorphism $f:I_R\to A$ such that $f(\mathfrak p)=a(\mathfrak p)$ for all prime ideals $\mathfrak p$?

Is the universal property of the free abelian group used here?

-

Yes. A free abelian group of rank $n$ (maybe $n = \infty$) should be thought of as the most "general" abelian group, in the sense that it has no additional relations beyond the ones making it abelian. Thus, any group homomorphism from the free abelian group of rank $n$, namely $\mathbb{Z}^n$ to any abelian group $A$ is equivalent to the data of an $n$-tuple of elements of $A$, where you send the $i$th generator of $\mathbb{Z}^n$ to the $i$th coordinate of the tuple. Of course this data determines the homomorphism, and any such choice of $n$ elements gives a homomorphism because $\mathbb{Z}^n$ is free abelian, and $A$ is abelian.
In general, if $F_n$ is the free group of rank $n$ (not abelian!), then any homomorphism from $F_n$ to ANY group $G$ is the same as an $n$-tuple of elements of $G$. Again, of course any such $n$-tuple completely determines the homomorphism if it exists, and the homomorphism does exist because $F_n$ is free (no relations on its generators).
As an example where this fails, you can consider homomorphisms from the cyclic group of order $m$, $\mathbb{Z}/m\mathbb{Z}$ to another group $G$. Its not true that for any choice of an element of $g$, you have a homomorphism from $\mathbb{Z}/m\mathbb{Z}$ to $G$ (written additively) sending 1 to $g$, since 1 satisfies the relation $n\cdot 1 = 0$, so the image of 1 must also be an element $x$ satisfying $n\cdot x = 0$.