Skip to content

Getting the current Instance #21

Open

Description

@rmasters

Hi, I can't find a way to access the current instance. I need to create a volume in the same availability zone as the instance (using boto), but need to know the availability zone of the instance it will be attached to (it may be variable). I guess I'm trying to get the Ec2InstanceWrapper or underlying EC2Connection.

For some reason, env.host_string is empty (in fact, the entire env seems to be at it's default values), so I can't look up the instance by it's DNS name either.

@task
@ec2instance(tags={'Group': 'master'})
def build():
    pprint(env)
    #vol = conn.create_volume(VOLUME_SIZE, REGION)

env looks like this:

'ec2ids': None,
'ec2names': None,
'ec2tags': '',
...
'host': '',
'host_string': '',
'hosts': [],

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions