[ aws . emr ]

create-default-roles

Description

Creates the default IAM role EMR_EC2_DefaultRole and EMR_DefaultRole which can be used when creating the cluster using the create-cluster command. The default roles for EMR use managed policies, which are updated automatically to support future EMR functionality.

If you do not have a Service Role and Instance Profile variable set for your create-cluster command in the AWS CLI config file, create-default-roles will automatically set the values for these variables with these default roles. If you have already set a value for Service Role or Instance Profile, create-default-roles will not automatically set the defaults for these variables in the AWS CLI config file. You can view settings for variables in the config file using the “aws configure get” command.

Synopsis

  create-default-roles
[--iam-endpoint <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]
[--no-cli-pager]
[--cli-auto-prompt]
[--no-cli-auto-prompt]

Options

--iam-endpoint (string)

The IAM endpoint to call for creating the roles. This is optional and should only be specified when a custom endpoint should be called for IAM operations.

Global Options

--debug (boolean)

Turn on debug logging.

--endpoint-url (string)

Override command’s default URL with the given URL.

--no-verify-ssl (boolean)

By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.

--no-paginate (boolean)

Disable automatic pagination.

--output (string)

The formatting style for command output.

  • json

  • text

  • table

  • yaml

  • yaml-stream

--query (string)

A JMESPath query to use in filtering the response data.

--profile (string)

Use a specific profile from your credential file.

--region (string)

The region to use. Overrides config/env settings.

--version (string)

Display the version of this tool.

--color (string)

Turn on/off color output.

  • on

  • off

  • auto

--no-sign-request (boolean)

Do not sign requests. Credentials will not be loaded if this argument is provided.

--ca-bundle (string)

The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.

--cli-read-timeout (int)

The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.

--cli-connect-timeout (int)

The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.

--cli-binary-format (string)

The formatting style to be used for binary blobs. The default format is base64. The base64 format expects binary blobs to be provided as a base64 encoded string. The raw-in-base64-out format preserves compatibility with AWS CLI V1 behavior and binary values must be passed literally. When providing contents from a file that map to a binary blob fileb:// will always be treated as binary and use the file contents directly regardless of the cli-binary-format setting. When using file:// the file contents will need to properly formatted for the configured cli-binary-format.

  • base64

  • raw-in-base64-out

--no-cli-pager (boolean)

Disable cli pager for output.

--cli-auto-prompt (boolean)

Automatically prompt for CLI input parameters.

--no-cli-auto-prompt (boolean)

Disable automatically prompt for CLI input parameters.

Examples

Note

To use the following examples, you must have the AWS CLI installed and configured. See the Getting started guide in the AWS CLI User Guide for more information.

Unless otherwise stated, all examples have unix-like quotation rules. These examples will need to be adapted to your terminal’s quoting rules. See Using quotation marks with strings in the AWS CLI User Guide .

1. To create the default IAM role for EC2

  • Command:

    aws emr create-default-roles
    
  • Output:

    If the role already exists then the command returns nothing.
    
    If the role does not exist then the output will be:
    
    [
        {
            "RolePolicy": {
                "Version": "2012-10-17",
                "Statement": [
                    {
                        "Action": [
                            "cloudwatch:*",
                            "dynamodb:*",
                            "ec2:Describe*",
                            "elasticmapreduce:Describe*",
                            "elasticmapreduce:ListBootstrapActions",
                            "elasticmapreduce:ListClusters",
                            "elasticmapreduce:ListInstanceGroups",
                            "elasticmapreduce:ListInstances",
                            "elasticmapreduce:ListSteps",
                            "kinesis:CreateStream",
                            "kinesis:DeleteStream",
                            "kinesis:DescribeStream",
                            "kinesis:GetRecords",
                            "kinesis:GetShardIterator",
                            "kinesis:MergeShards",
                            "kinesis:PutRecord",
                            "kinesis:SplitShard",
                            "rds:Describe*",
                            "s3:*",
                            "sdb:*",
                            "sns:*",
                            "sqs:*"
                        ],
                        "Resource": "*",
                        "Effect": "Allow"
                    }
                ]
            },
            "Role": {
                "AssumeRolePolicyDocument": {
                    "Version": "2008-10-17",
                    "Statement": [
                        {
                            "Action": "sts:AssumeRole",
                            "Sid": "",
                            "Effect": "Allow",
                            "Principal": {
                                "Service": "ec2.amazonaws.com"
                            }
                        }
                    ]
                },
                "RoleId": "AROAIQ5SIQUGL5KMYBJX6",
                "CreateDate": "2015-06-09T17:09:04.602Z",
                "RoleName": "EMR_EC2_DefaultRole",
                "Path": "/",
                "Arn": "arn:aws:iam::176430881729:role/EMR_EC2_DefaultRole"
            }
        },
        {
            "RolePolicy": {
                "Version": "2012-10-17",
                "Statement": [
                    {
                        "Action": [
                            "ec2:AuthorizeSecurityGroupIngress",
                            "ec2:CancelSpotInstanceRequests",
                            "ec2:CreateSecurityGroup",
                            "ec2:CreateTags",
                            "ec2:DeleteTags",
                            "ec2:DescribeAvailabilityZones",
                            "ec2:DescribeAccountAttributes",
                            "ec2:DescribeInstances",
                            "ec2:DescribeInstanceStatus",
                            "ec2:DescribeKeyPairs",
                            "ec2:DescribePrefixLists",
                            "ec2:DescribeRouteTables",
                            "ec2:DescribeSecurityGroups",
                            "ec2:DescribeSpotInstanceRequests",
                            "ec2:DescribeSpotPriceHistory",
                            "ec2:DescribeSubnets",
                            "ec2:DescribeVpcAttribute",
                            "ec2:DescribeVpcEndpoints",
                            "ec2:DescribeVpcEndpointServices",
                            "ec2:DescribeVpcs",
                            "ec2:ModifyImageAttribute",
                            "ec2:ModifyInstanceAttribute",
                            "ec2:RequestSpotInstances",
                            "ec2:RunInstances",
                            "ec2:TerminateInstances",
                            "iam:GetRole",
                            "iam:GetRolePolicy",
                            "iam:ListInstanceProfiles",
                            "iam:ListRolePolicies",
                            "iam:PassRole",
                            "s3:CreateBucket",
                            "s3:Get*",
                            "s3:List*",
                            "sdb:BatchPutAttributes",
                            "sdb:Select",
                            "sqs:CreateQueue",
                            "sqs:Delete*",
                            "sqs:GetQueue*",
                            "sqs:ReceiveMessage"
                        ],
                        "Resource": "*",
                        "Effect": "Allow"
                    }
                ]
            },
            "Role": {
                "AssumeRolePolicyDocument": {
                    "Version": "2008-10-17",
                    "Statement": [
                        {
                            "Action": "sts:AssumeRole",
                            "Sid": "",
                            "Effect": "Allow",
                            "Principal": {
                                "Service": "elasticmapreduce.amazonaws.com"
                            }
                        }
                    ]
                },
                "RoleId": "AROAI3SRVPPVSRDLARBPY",
                "CreateDate": "2015-06-09T17:09:10.401Z",
                "RoleName": "EMR_DefaultRole",
                "Path": "/",
                "Arn": "arn:aws:iam::176430881729:role/EMR_DefaultRole"
            }
        }
    ]