aboutsummaryrefslogtreecommitdiff
path: root/ec2/spark_ec2.py
diff options
context:
space:
mode:
Diffstat (limited to 'ec2/spark_ec2.py')
-rwxr-xr-xec2/spark_ec2.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/ec2/spark_ec2.py b/ec2/spark_ec2.py
index 3a2361c6d6..9327e21e43 100755
--- a/ec2/spark_ec2.py
+++ b/ec2/spark_ec2.py
@@ -182,6 +182,10 @@ def parse_args():
"-i", "--identity-file",
help="SSH private key file to use for logging into instances")
parser.add_option(
+ "-p", "--profile", default=None,
+ help="If you have multiple profiles (AWS or boto config), you can configure " +
+ "additional, named profiles by using this option (default: %default)")
+ parser.add_option(
"-t", "--instance-type", default="m1.large",
help="Type of instance to launch (default: %default). " +
"WARNING: must be 64-bit; small instances won't work")
@@ -1315,7 +1319,10 @@ def real_main():
sys.exit(1)
try:
- conn = ec2.connect_to_region(opts.region)
+ if opts.profile is None:
+ conn = ec2.connect_to_region(opts.region)
+ else:
+ conn = ec2.connect_to_region(opts.region, profile_name=opts.profile)
except Exception as e:
print((e), file=stderr)
sys.exit(1)