Amazon EMR
Developer Guide

Specifying Parameter Values in AWS CLI for Amazon EMR

You can specify values for parameters supplied with the Amazon EMR subcommands create-cluster, ssh, get, put, and socks. You can set the value of the parameter by using aws configure or by setting the values in your ~/.aws/config or C:\Users\USERNAME\.aws\config files. The following tables show the subcommands and parameters that can be set.


Parameter Description
instance_profile The instance profile you want Amazon EMR to use to run application on the cluster's Amazon EC2 instances.
service_role The service role you want the Amazon EMR service to use.
log_uri The Amazon S3 URI you want Amazon EMR to place cluster logs.
key_name The EC2 key pair name you want to use the access the EMR cluster.
enable_debugging The Boolean value that indicates if you want to enable debugging when creating a cluster.

ssh, get, put, socks

Parameter Description
key_pair_file The path to the private key pair file you use to connect to the EMR cluster.

Setting Parameters with the Command Line

To set a parameter, you can use the command aws configure set emr.parameter_name value . For example, set the value of the key_name to myKeyName use the following:

% aws configure set emr.key_name myKeyName

Displaying Parameter Values with the Command Line

You can also display a value for a given parameter using aws configure get emr.parameter_name value. For example, to get the value of the key_name you just set, use the following command and myKeyName will be displayed:

% aws configure get emr.key_name myKeyName

Setting Parameters with the Configuration File

To set parameters using the configuration file, you specify the service and then key-value assignments in the AWS CLI configuration file. For example, on Linux, Mac OS X, Unix systems this is located at ~/.aws/config or at C:\Users\USERNAME\.aws\config on Windows systems. A sample configuration looks like:

[default] region = us-east-1 emr = service_role = EMR_DefaultRole instance_profile = EMR_EC2_DefaultRole log_uri = s3://myBucket/logs enable_debugging = True key_name = myKeyName key_pair_file = /home/myUser/myKeyName.pem


If you create roles for Amazon EMR using aws emr create-default-roles they will be automatically be populated in the configuration file.