Skip to content

Commit 84bf792

Browse files
committed
Made region used by spark-ec2 configurable.
1 parent 79c82b6 commit 84bf792

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ec2/spark_ec2.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ def parse_args():
5858
"WARNING: must be 64-bit; small instances won't work")
5959
parser.add_option("-m", "--master-instance-type", default="",
6060
help="Master instance type (leave empty for same as instance-type)")
61-
parser.add_option("-z", "--zone", default="us-east-1b",
61+
parser.add_option("-r", "--region", default="us-east-1",
62+
help="EC2 region zone to launch instances in")
63+
parser.add_option("-z", "--zone", default="",
6264
help="Availability zone to launch instances in")
6365
parser.add_option("-a", "--ami", default="latest",
6466
help="Amazon Machine Image ID to use, or 'latest' to use latest " +
@@ -438,7 +440,7 @@ def ssh(host, opts, command):
438440

439441
def main():
440442
(opts, action, cluster_name) = parse_args()
441-
conn = boto.connect_ec2()
443+
conn = boto.ec2.connect_to_region(opts.region)
442444

443445
# Select an AZ at random if it was not specified.
444446
if opts.zone == "":

0 commit comments

Comments
 (0)