Skip to content

Commit

Permalink
Actually pass the credentials to docker-machine.
Browse files Browse the repository at this point in the history
  • Loading branch information
ahoereth committed Feb 20, 2017
1 parent 43df275 commit f1b671f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion awstf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

def build_command(
name, region, zone, ami, instance_type, security_group, price_max,
key_id=None, key_secret=None,
):
cmd = '''docker-machine create {name} \\
--driver amazonec2 \\
Expand All @@ -35,7 +36,11 @@ def build_command(
)

if ami is not None:
cmd += '\\\n --amazonec2-ami {ami}'.format(ami)
cmd += '\\\n --amazonec2-ami {} '.format(ami)

if key_id is not None:
cmd += '\\\n --amazonec2-access-key {} '.format(key_id)
cmd += '\\\n --amazonec2-secret-key {} '.format(key_secret)

return cmd

Expand Down Expand Up @@ -87,6 +92,8 @@ def main(
security_group=security_group,
price_max=price + max_price_overhead,
ami=AMIS[ami] if ami in AMIS else None,
key_id=key_id,
key_secret=key_secret,
))


Expand Down

0 comments on commit f1b671f

Please sign in to comment.