Carina

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

Path prefix for filtering the results. If it is not included, it defaults to /, listing all roles.

name_regex

Regular expression string applied client-side to filter results by role name.

Attributes

arns

Set of ARNs of the matched IAM roles.

names

Set of names of the matched IAM roles.