When investors think of Brazil, they often think of Carnival and ethanol. Perhaps they should be thinking of oil and Repsol (NYSE: REP) instead.

Significant discoveries in recent years, especially in deepwater areas like the Campos and Santos Basins, potentially make Brazil one of the largest oil-exporting nations in the world. Now, Spanish oil giant Repsol may be well-positioned to take advantage.

The company claims that it has the most offshore acreage, 24 blocks in total, of all the non-state-run operators in Brazil. This is an astonishing boast, since Repsol competes for offshore oil in the country with supermajors such as ExxonMobil. While the size of its territory sounds promising, investors need to know whether all that drilling will pay off for Repsol in the long run.

Faced with the daunting task of extracting all of that potential oil from Brazilian shores, the company estimates that it will invest at least $10 billion over the course of the next 10 to 12 years. Some estimates run as high as $18 billion. To its credit, Repsol decided to focus only on the areas it considers most profitable. Other, less valuable areas are being sold to help raise more capital for the company's drilling campaign in its more lucrative sections.

Repsol values its Brazilian oil operations at roughly $6 billion. At first glance, this discovery doesn't appear to be a sunken treasure, considering the costs, but you have to keep in mind that these are largely undeveloped assets. More importantly, Repsol faces political uncertainty, thanks to Brazilian legislators eager to support the home team -- namely, local giant Petrobras (NYSE: PBR) -- when crafting new oil laws.

Despite a recent string of successes in Brazil, Venezuela, and the Gulf of Mexico, I'm hesitant to invest in Repsol until the Brazilian government passes a comprehensive oil bill. The country should be a strong driver for Repsol's future growth, but if the legislature's terms aren't favorable to outside operators, that growth could be stunted. In the meantime, it may be wise to consider other energy-related alternatives.

Further high-octane Foolishness:

Fool contributor Gerard Torres does not own or short shares in any of the companies mentioned in this article. Petroleo Brasileiro is a Motley Fool Income Investor recommendation. The Fool disclosure policy sticks to you like glue.