How to specify ec2 instance types for different services?

After I have specified a default EC2 instance type for my Juju charm, how do I override that for one of the services?

For instance, the Juju tutorial deploys wordpress and mysql, and I can set the default-instance-type in my environments.yaml so both services are m1.small

But how do I configure it so that (only) the mysql service gets deployed on an instance type better suited to a database, like m2.xlarge ?


In summary, if you wanted to deploy with m2.xlarge:

 juju deploy mysql --constraints 'instance-type=m2.xlarge'

Or if you want your deployment script to be more portable between providers:

 juju deploy mysql --constraints 'mem=8G'

Here are the corresponding documents:

  • https://jujucharms.com/docs/2.0/reference-constraints