Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My specific case is for getting the amazon EC2 authentication information stored in the environments.yaml.
I am aware of the get-constraints command available in recent Juju builds. Can this be used to access this information?

share|improve this question
Try referring here – atenz Aug 2 '12 at 8:53
up vote 2 down vote accepted

Try passing the information you need as config parameters for the charm.

To do this, you'd:

  • add parameter names into the charm's config.yaml file

  • either pass the keys in as a --config part of the juju deploy command or alternatively using the juju set command

  • read the keys from the charm hooks using the config-get command

share|improve this answer
I am automating the juju commands so it is more suitable to use --config switch than calling set .Also I need the parameters within in the install and xxx-relation-added hooks. – Antojk Aug 3 '12 at 10:16

At this time you can not access Environment varaibables. If your charm requires authentication information you'll need to add it as a configuration option for that Charm (Charms should be designed to deploy on all stacks, so not every provider will have something like an ec2-authentication key). If you require AWS services in your charm consider exposing those in the configuration with something like this:

    type: string
    default: ""
    description: Amazon Public Key for S3
    type: string
    default: ""
    description: Amazon Secret Key for S3
    type: string
    default: ""
    description: Amazon S3 Bucket

So these would be set using the juju setcommand and would be available in the config_changed hook via config-get

share|improve this answer
I have used the config.yaml to preset the variables – Antojk Aug 3 '12 at 10:20

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.