Indonesia was part of an elite group among G20 nations during the financial crisis. It, along with China and India, continued to grow even as the economics of other countries were contracting at alarming rates.

That continues to be true, despite the fact that Indonesia has problems, some of them daunting. Some would-be investors pay far more attention to the problems than to the opportunities that the country offers, and many bailed after the country instituted new laws concerning investment and trade. But, with a little caution, there are plenty of ways to seek out the benefits presented by an economy dominated by young consumers.

The population of Indonesia is something that its officials have been using as a selling point to lure outside money to the country. Under-30s fill half the country, which accounts for the popularity of gaming, social media and telecommunications—but there are plenty of other opportunities as well, a fact not lost on companies ranging from automakers to furniture retailer Ikea, Abu Dhabi-based LuLu Hypermarket and banks in Dubai. All have sought, or are seeking, entree into investments or expansion of an existing presence in Indonesia’s marketplace.

Then are the companies that have come to Indonesia for its minerals, but that’s a bit problematic since the country has put in place new laws that impose a ban on the export of raw minerals. Indonesia’s government is gambling that the move will result in an increase in jobs by encouraging companies to invest in smelters, thus providing the companies with the ore they seek while at the same time providing employment to Indonesians who need work.

At least one company with a contract has sought to prevent enforcement of the new legislation against it. Newmont Mining Corp., which declared force majeure at its copper mine in Batu Hijau, has filed for international arbitration against the government of Indonesia on the terms of the export restrictions, which include an escalating export tax. Freeport McMoRan Copper & Gold Inc. has not yet taken that route, but is still talking with Jakarta in hopes of finding a way around the new requirements by claiming that existing contracts should proceed as written, exempting them from the tax.

The investing climate is not perfect, of course. New laws announced in May hinder the abilities of investors to own businesses, or the amount of a business they may own, if they are not residents in this country of 700 languages. There are new hoops to jump through, which despite the stated purpose on the recently instituted foreign investment regulations to ease the path for businesses, make it tougher and impose enough restrictions that some potential investors may be turned off altogether, while others will proceed slowly.

Although pharmaceuticals and advertising are now accessible to foreign investment, there are now restrictions in areas that were previously more open to outside ownership. Some of those restrictions involve a requirement to partner with local investors, as the country tries to bolster its own people in business. Horticulture and retail, storage and power plants are all affected, with warehousing and cold storage posing challenges for outsiders who are now limited to 33% ownership. There’s also a bar against new foreign investment in such diverse retail areas as electronics, food, footwear, textiles and toys.

In addition, at the beginning of July it was announced that Indonesia’s financial services regulator is going to make it more difficult for banks to be acquired by foreign companies. The regulator is going to put more weight on reciprocal agreements with the countries of potential acquirers, and firms that lack such agreements will find it tougher to pass muster.

Foreign ownership limitations of 40% were put in place last July, and that’s already resulted in some potential deals being scuppered. These new and tougher requirements are already having an effect as well; Malaysia’s RHB Capital Bhd has announced that it’s abandoning plans to buy into PT Bank Mestika Dharma in Indonesia after the regulator nixed its approval.

While not everyone in the Indonesian government is pleased with the new regulations, not much can be done till after the country’s July elections, when Jakarta Governor Joko “Jokowi” Widodo is expected to win. However, in recent polls his lead has diminished over his opponent, ex-general Prabowo Subianto, and wary investors have reacted accordingly. They have backed off from high-yield bonds, and the rupiah has fallen as worries increase over the potential for volatility and political patronage in the wake of a Prabowo victory.

Jokowi, a former furniture businessman with a lower-class background than his opponent, is regarded as more pro-business than Prabowo, who is a nationalist and who has been accused of human rights violations—particularly during the end of the reign of his former father-in-law Suharto. But Jokowi is also seen as a potential protectionist, allowing foreign investment insofar as it can promote the growth of local investment and then seeking to put control of the country’s sources of wealth back into domestic hands.

Neither candidate would have much maneuver room in the budget for changes, thanks to fuel subsidies that are rapidly growing as fuel demand rises, but the outgoing government has come in for heavy criticism for its failure to protect the country’s economy against falling export demand and fluctuating commodity prices.

Much of Indonesia’s exports flow to China, and a slowdown there has hurt the Indonesian economy; the government responded by slowing domestic consumption, which reduced the country’s capital account deficit and boosted foreign reserves.

However, overall the picture still has bright spots. Fitch Ratings gave the country’s upcoming euro-denominated bond issue a BBB-(EXP) rating, citing the country’s stable outlook, “stronger and less volatile economic growth than its peers,” and “favorable debt levels.” So opportunities exist for the cautious investor.