{
	"id": "30c7fa2d-4529-4833-8a37-74fc191696b6",
	"created_at": "2026-04-06T00:11:13.570763Z",
	"updated_at": "2026-04-10T13:11:59.838162Z",
	"deleted_at": null,
	"sha1_hash": "4cb32091e275c1dbd50590b20d9a0340b04ef588",
	"title": "list-roles — AWS CLI 2.34.23 Command Reference",
	"llm_title": "",
	"authors": "",
	"file_creation_date": "0001-01-01T00:00:00Z",
	"file_modification_date": "0001-01-01T00:00:00Z",
	"file_size": 124486,
	"plain_text": "list-roles — AWS CLI 2.34.23 Command Reference\r\nArchived: 2026-04-05 23:01:23 UTC\r\nDescription¶\r\nLists the IAM roles that have the specified path prefix. If there are none, the operation returns an empty list. For\r\nmore information about roles, see IAM roles in the IAM User Guide .\r\nNote\r\nIAM resource-listing operations return a subset of the available attributes for the resource. This operation does not\r\nreturn the following attributes, even though they are an attribute of the returned object:\r\nPermissionsBoundary\r\nRoleLastUsed\r\nTags\r\nTo view all of the information for a role, see GetRole .\r\nYou can paginate the results using the MaxItems and Marker parameters.\r\nSee also: AWS API Documentation\r\nlist-roles is a paginated operation. Multiple API calls may be issued in order to retrieve the entire data set of\r\nresults. You can disable pagination by providing the --no-paginate argument. When using --output text and\r\nthe --query argument on a paginated response, the --query argument must extract data from the results of the\r\nfollowing query expressions: Roles\r\nSynopsis¶\r\n list-roles\r\n[--path-prefix \u003cvalue\u003e]\r\n[--max-items \u003cvalue\u003e]\r\n[--cli-input-json | --cli-input-yaml]\r\n[--starting-token \u003cvalue\u003e]\r\n[--page-size \u003cvalue\u003e]\r\n[--generate-cli-skeleton \u003cvalue\u003e]\r\n[--debug]\r\n[--endpoint-url \u003cvalue\u003e]\r\n[--no-verify-ssl]\r\n[--no-paginate]\r\n[--output \u003cvalue\u003e]\r\n[--query \u003cvalue\u003e]\r\nhttps://docs.aws.amazon.com/cli/latest/reference/iam/list-roles.html\r\nPage 1 of 10\n\n[--profile \u003cvalue\u003e]\r\n[--region \u003cvalue\u003e]\r\n[--version \u003cvalue\u003e]\r\n[--color \u003cvalue\u003e]\r\n[--no-sign-request]\r\n[--ca-bundle \u003cvalue\u003e]\r\n[--cli-read-timeout \u003cvalue\u003e]\r\n[--cli-connect-timeout \u003cvalue\u003e]\r\n[--cli-binary-format \u003cvalue\u003e]\r\n[--no-cli-pager]\r\n[--cli-auto-prompt]\r\n[--no-cli-auto-prompt]\r\n[--cli-error-format \u003cvalue\u003e]\r\nOptions¶\r\n--path-prefix (string)\r\nThe path prefix for filtering the results. For example, the prefix /application_abc/component_xyz/\r\ngets all roles whose path starts with /application_abc/component_xyz/ .\r\nThis parameter is optional. If it is not included, it defaults to a slash (/), listing all roles. This parameter\r\nallows (through its regex pattern ) a string of characters consisting of either a forward slash (/) by itself\r\nor a string that must begin and end with forward slashes. In addition, it can contain any ASCII character\r\nfrom the ! ( \\u0021 ) through the DEL character ( \\u007F ), including most punctuation characters,\r\ndigits, and upper and lowercased letters.\r\nConstraints:\r\nmin: 1\r\nmax: 512\r\npattern: \\u002F[\\u0021-\\u007F]*\r\n--max-items (integer)\r\nThe total number of items to return in the command’s output. If the total number of items available is\r\nmore than the value specified, a NextToken is provided in the command’s output. To resume\r\npagination, provide the NextToken value in the starting-token argument of a subsequent command.\r\nDo not use the NextToken response element directly outside of the AWS CLI.\r\nFor usage examples, see Pagination in the AWS Command Line Interface User Guide .\r\n--cli-input-json | --cli-input-yaml (string) Reads arguments from the JSON string provided. The JSON\r\nstring follows the format provided by --generate-cli-skeleton . If other arguments are provided on the\r\ncommand line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary\r\nhttps://docs.aws.amazon.com/cli/latest/reference/iam/list-roles.html\r\nPage 2 of 10\n\nvalues using a JSON-provided value as the string will be taken literally. This may not be specified along with --\r\ncli-input-yaml .\r\n--starting-token (string)\r\nA token to specify where to start paginating. This is the NextToken from a previously truncated\r\nresponse.\r\nFor usage examples, see Pagination in the AWS Command Line Interface User Guide .\r\n--page-size (integer)\r\nThe size of each page to get in the AWS service call. This does not affect the number of items returned\r\nin the command’s output. Setting a smaller page size results in more calls to the AWS service, retrieving\r\nfewer items in each call. This can help prevent the AWS service calls from timing out.\r\nFor usage examples, see Pagination in the AWS Command Line Interface User Guide .\r\n--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If\r\nprovided with no value or the value input , prints a sample input JSON that can be used as an argument for --\r\ncli-input-json . Similarly, if provided yaml-input it will print a sample input YAML that can be used with --\r\ncli-input-yaml . If provided with the value output , it validates the command inputs and returns a sample\r\noutput JSON for that command. The generated JSON skeleton is not stable between versions of the AWS CLI and\r\nthere are no backwards compatibility guarantees in the JSON skeleton generated.\r\nGlobal Options¶\r\n--debug (boolean)\r\nTurn on debug logging.\r\n--endpoint-url (string)\r\nOverride command’s default URL with the given URL.\r\n--no-verify-ssl (boolean)\r\nBy default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS\r\nCLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.\r\n--no-paginate (boolean)\r\nDisable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the\r\nfirst page of results.\r\n--output (string)\r\nThe formatting style for command output.\r\nhttps://docs.aws.amazon.com/cli/latest/reference/iam/list-roles.html\r\nPage 3 of 10\n\njson\r\ntext\r\ntable\r\nyaml\r\nyaml-stream\r\noff\r\n--query (string)\r\nA JMESPath query to use in filtering the response data.\r\n--profile (string)\r\nUse a specific profile from your credential file.\r\n--region (string)\r\nThe region to use. Overrides config/env settings.\r\n--version (string)\r\nDisplay the version of this tool.\r\n--color (string)\r\nTurn on/off color output.\r\non\r\noff\r\nauto\r\n--no-sign-request (boolean)\r\nDo not sign requests. Credentials will not be loaded if this argument is provided.\r\n--ca-bundle (string)\r\nThe CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.\r\n--cli-read-timeout (int)\r\nThe maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not\r\ntimeout. The default value is 60 seconds.\r\n--cli-connect-timeout (int)\r\nThe maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not\r\ntimeout. The default value is 60 seconds.\r\n--cli-binary-format (string)\r\nhttps://docs.aws.amazon.com/cli/latest/reference/iam/list-roles.html\r\nPage 4 of 10\n\nThe formatting style to be used for binary blobs. The default format is base64. The base64 format expects binary\r\nblobs to be provided as a base64 encoded string. The raw-in-base64-out format preserves compatibility with AWS\r\nCLI V1 behavior and binary values must be passed literally. When providing contents from a file that map to a\r\nbinary 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\r\ncli-binary-format .\r\nbase64\r\nraw-in-base64-out\r\n--no-cli-pager (boolean)\r\nDisable cli pager for output.\r\n--cli-auto-prompt (boolean)\r\nAutomatically prompt for CLI input parameters.\r\n--no-cli-auto-prompt (boolean)\r\nDisable automatically prompt for CLI input parameters.\r\n--cli-error-format (string)\r\nThe formatting style for error output. By default, errors are displayed in enhanced format.\r\nlegacy\r\njson\r\nyaml\r\ntext\r\ntable\r\nenhanced\r\nExamples¶\r\nNote\r\nTo use the following examples, you must have the AWS CLI installed and configured. See the Getting started\r\nguide in the AWS CLI User Guide for more information.\r\nUnless otherwise stated, all examples have unix-like quotation rules. These examples will need to be adapted to\r\nyour terminal’s quoting rules. See Using quotation marks with strings in the AWS CLI User Guide .\r\nTo list IAM roles for the current account\r\nThe following list-roles command lists IAM roles for the current account.\r\nhttps://docs.aws.amazon.com/cli/latest/reference/iam/list-roles.html\r\nPage 5 of 10\n\naws iam list-roles\r\nOutput:\r\n{\r\n \"Roles\": [\r\n {\r\n \"Path\": \"/\",\r\n \"RoleName\": \"ExampleRole\",\r\n \"RoleId\": \"AROAJ52OTH4H7LEXAMPLE\",\r\n \"Arn\": \"arn:aws:iam::123456789012:role/ExampleRole\",\r\n \"CreateDate\": \"2017-09-12T19:23:36+00:00\",\r\n \"AssumeRolePolicyDocument\": {\r\n \"Version\": \"2012-10-17\",\r\n \"Statement\": [\r\n {\r\n \"Sid\": \"\",\r\n \"Effect\": \"Allow\",\r\n \"Principal\": {\r\n \"Service\": \"ec2.amazonaws.com\"\r\n },\r\n \"Action\": \"sts:AssumeRole\"\r\n }\r\n ]\r\n },\r\n \"MaxSessionDuration\": 3600\r\n },\r\n {\r\n \"Path\": \"/example_path/\",\r\n \"RoleName\": \"ExampleRoleWithPath\",\r\n \"RoleId\": \"AROAI4QRP7UFT7EXAMPLE\",\r\n \"Arn\": \"arn:aws:iam::123456789012:role/example_path/ExampleRoleWithPath\",\r\n \"CreateDate\": \"2023-09-21T20:29:38+00:00\",\r\n \"AssumeRolePolicyDocument\": {\r\n \"Version\": \"2012-10-17\",\r\n \"Statement\": [\r\n {\r\n \"Sid\": \"\",\r\n \"Effect\": \"Allow\",\r\n \"Principal\": {\r\n \"Service\": \"ec2.amazonaws.com\"\r\n },\r\n \"Action\": \"sts:AssumeRole\"\r\n }\r\n ]\r\n },\r\nhttps://docs.aws.amazon.com/cli/latest/reference/iam/list-roles.html\r\nPage 6 of 10\n\n\"MaxSessionDuration\": 3600\r\n }\r\n ]\r\n}\r\nFor more information, see Creating IAM roles in the AWS IAM User Guide.\r\nOutput¶\r\nRoles -\u003e (list)\r\nA list of roles.\r\n(structure)\r\nContains information about an IAM role. This structure is returned as a response element in\r\nseveral API operations that interact with roles.\r\nPath -\u003e (string) [required]\r\nThe path to the role. For more information about paths, see IAM identifiers in the\r\nIAM User Guide .\r\nConstraints:\r\nmin: 1\r\nmax: 512\r\npattern: (\\u002F)|(\\u002F[\\u0021-\\u007E]+\\u002F)\r\nRoleName -\u003e (string) [required]\r\nThe friendly name that identifies the role.\r\nConstraints:\r\nmin: 1\r\nmax: 64\r\npattern: [\\w+=,.@-]+\r\nRoleId -\u003e (string) [required]\r\nThe stable and unique string identifying the role. For more information about IDs,\r\nsee IAM identifiers in the IAM User Guide .\r\nConstraints:\r\nmin: 16\r\nmax: 128\r\nhttps://docs.aws.amazon.com/cli/latest/reference/iam/list-roles.html\r\nPage 7 of 10\n\npattern: [\\w]+\r\nArn -\u003e (string) [required]\r\nThe Amazon Resource Name (ARN) specifying the role. For more information\r\nabout ARNs and how to use them in policies, see IAM identifiers in the IAM User\r\nGuide guide.\r\nConstraints:\r\nmin: 20\r\nmax: 2048\r\nCreateDate -\u003e (timestamp) [required]\r\nAssumeRolePolicyDocument -\u003e (string)\r\nThe policy that grants an entity permission to assume the role.\r\nConstraints:\r\nmin: 1\r\nmax: 131072\r\npattern: [\\u0009\\u000A\\u000D\\u0020-\\u00FF]+\r\nDescription -\u003e (string)\r\nA description of the role that you provide.\r\nConstraints:\r\nmax: 1000\r\npattern: [\\u0009\\u000A\\u000D\\u0020-\\u007E\\u00A1-\\u00FF]*\r\nMaxSessionDuration -\u003e (integer)\r\nThe maximum session duration (in seconds) for the specified role. Anyone who\r\nuses the CLI, or API to assume the role can specify the duration using the optional\r\nDurationSeconds API parameter or duration-seconds CLI parameter.\r\nConstraints:\r\nmin: 3600\r\nmax: 43200\r\nPermissionsBoundary -\u003e (structure)\r\nThe ARN of the policy used to set the permissions boundary for the role.\r\nhttps://docs.aws.amazon.com/cli/latest/reference/iam/list-roles.html\r\nPage 8 of 10\n\nFor more information about permissions boundaries, see Permissions boundaries\r\nfor IAM identities in the IAM User Guide .\r\nPermissionsBoundaryType -\u003e (string)\r\nThe permissions boundary usage type that indicates what type of IAM\r\nresource is used as the permissions boundary for an entity. This data\r\ntype can only have a value of Policy .\r\nPossible values:\r\nPermissionsBoundaryPolicy\r\nPermissionsBoundaryArn -\u003e (string)\r\nThe ARN of the policy used to set the permissions boundary for the user\r\nor role.\r\nConstraints:\r\nmin: 20\r\nmax: 2048\r\nTags -\u003e (list)\r\nA list of tags that are attached to the role. For more information about tagging, see\r\nTagging IAM resources in the IAM User Guide .\r\nConstraints:\r\nmax: 50\r\n(structure)\r\nA structure that represents user-provided metadata that can be associated\r\nwith an IAM resource. For more information about tagging, see Tagging\r\nIAM resources in the IAM User Guide .\r\nKey -\u003e (string) [required]\r\nThe key name that can be used to look up or retrieve the\r\nassociated value. For example, Department or Cost\r\nCenter are common choices.\r\nConstraints:\r\nmin: 1\r\nmax: 128\r\npattern: [\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]+\r\nhttps://docs.aws.amazon.com/cli/latest/reference/iam/list-roles.html\r\nPage 9 of 10\n\nValue -\u003e (string) [required]\r\nThe value associated with this tag. For example, tags with a\r\nkey name of Department could have values such as Human\r\nResources , Accounting , and Support . Tags with a key\r\nname of Cost Center might have values that consist of the\r\nnumber associated with the different cost centers in your\r\ncompany. Typically, many resources have tags with the same\r\nkey name but with different values.\r\nConstraints:\r\nmin: 0\r\nmax: 256\r\npattern: [\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*\r\nRoleLastUsed -\u003e (structure)\r\nContains information about the last time that an IAM role was used. This includes\r\nthe date and time and the Region in which the role was last used. Activity is only\r\nreported for the trailing 400 days. This period can be shorter if your Region began\r\nsupporting these features within the last year. The role might have been used more\r\nthan 400 days ago. For more information, see Regions where data is tracked in the\r\nIAM user Guide .\r\nLastUsedDate -\u003e (timestamp)\r\nRegion -\u003e (string)\r\nThe name of the Amazon Web Services Region in which the role was\r\nlast used.\r\nIsTruncated -\u003e (boolean)\r\nA flag that indicates whether there are more items to return. If your results were truncated, you can\r\nmake a subsequent pagination request using the Marker request parameter to retrieve more items.\r\nNote that IAM might return fewer than the MaxItems number of results even when there are more\r\nresults available. We recommend that you check IsTruncated after every call to ensure that you\r\nreceive all your results.\r\nMarker -\u003e (string)\r\nWhen IsTruncated is true , this element is present and contains the value to use for the Marker\r\nparameter in a subsequent pagination request.\r\nSource: https://docs.aws.amazon.com/cli/latest/reference/iam/list-roles.html\r\nhttps://docs.aws.amazon.com/cli/latest/reference/iam/list-roles.html\r\nPage 10 of 10",
	"extraction_quality": 1,
	"language": "EN",
	"sources": [
		"MITRE"
	],
	"origins": [
		"web"
	],
	"references": [
		"https://docs.aws.amazon.com/cli/latest/reference/iam/list-roles.html"
	],
	"report_names": [
		"list-roles.html"
	],
	"threat_actors": [],
	"ts_created_at": 1775434273,
	"ts_updated_at": 1775826719,
	"ts_creation_date": 0,
	"ts_modification_date": 0,
	"files": {
		"pdf": "https://archive.orkl.eu/4cb32091e275c1dbd50590b20d9a0340b04ef588.pdf",
		"text": "https://archive.orkl.eu/4cb32091e275c1dbd50590b20d9a0340b04ef588.txt",
		"img": "https://archive.orkl.eu/4cb32091e275c1dbd50590b20d9a0340b04ef588.jpg"
	}
}