HEX
Server: LiteSpeed
System: Linux s3604.bom1.stableserver.net 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User: dmstechonline (1480)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/awscli/examples/iam/create-service-linked-role.rst
**To create a service-linked role**

The following ``create-service-linked-role`` example creates a service-linked role for the specified AWS service and attaches the specified description. ::

    aws iam create-service-linked-role \
        --aws-service-name lex.amazonaws.com \
        --description "My service-linked role to support Lex"

Output::

    {
        "Role": {
            "Path": "/aws-service-role/lex.amazonaws.com/",
            "RoleName": "AWSServiceRoleForLexBots",
            "RoleId": "AROA1234567890EXAMPLE",
            "Arn": "arn:aws:iam::1234567890:role/aws-service-role/lex.amazonaws.com/AWSServiceRoleForLexBots",
            "CreateDate": "2019-04-17T20:34:14+00:00",
            "AssumeRolePolicyDocument": {
                "Version": "2012-10-17",
                "Statement": [
                    {
                        "Action": [
                            "sts:AssumeRole"
                        ],
                        "Effect": "Allow",
                        "Principal": {
                            "Service": [
                                "lex.amazonaws.com"
                            ]
                        }
                    }
                ]
            }
        }
    }

For more information, see `Using Service-Linked Roles <https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html>`_ in the *IAM User Guide*.