Data source
aws.iam.Roles
This is a data source (read-only). Use with the read keyword.
Example
let sso_admin_roles = read aws.iam.Roles {
path_prefix = '/aws-reserved/sso.amazonaws.com/'
name_regex = '^AWSReservedSSO_AdministratorAccess_[0-9a-f]{16}$'
# Downstream resources consume the result via `sso_admin_roles.arns`
# and `sso_admin_roles.names`. For example, a cross-account
# `aws.s3.BucketPolicy` Principal can be built as
# `sso_admin_roles.arns[0]` once the regex narrows the match to one role.
}
Lookup Inputs
path_prefix
-
Required: No
-
Type:
String (pattern: /^\u002F[\u0021-\u007F]*$/ (Full), len: 1..=512)
Path prefix for filtering the results. If it is not included, it defaults to /, listing all roles.
name_regex
-
Required: No
-
Type:
String
Regular expression string applied client-side to filter results by role name.
Attributes
arns
- Type: List<
IamRoleArn (identity constraints: pattern: /^arn:(?:aws|aws-cn|aws-us-gov|aws-iso|aws-iso-b|aws-iso-e|aws-iso-f|aws-eusc):iam::[^:]*:role/.+$/ (Full), member constraints: len: 20..=2048, custom validator)> (unordered) - Read-only
Set of ARNs of the matched IAM roles.
names
- Type: List<
IamRoleName (identity constraints: pattern: /^[A-Za-z0-9_+=,.@-]+\z/ (Full), len: 1..=64, member constraints: pattern: /^[A-Za-z0-9_+=,.@\-]+$/ (Full), len: 1..=64)> (unordered) - Read-only
Set of names of the matched IAM roles.