Skip to main content

Role

Creates and manages IAM roles with support for inline policies, managed policies, and automatic cleanup of attached policies during deletion.

Props

PolicyDocument
required
Policy that defines which entities can assume this role.
string
Name of the IAM role.Default: ${app}-${stage}-${id}
string
Optional description of the role’s purpose.
string
Optional path prefix for the role.
number
Maximum session duration in seconds when assumed.Default: 3600 (1 hour)
string
ARN of the policy used to set the permissions boundary.
Array<object>
Inline policies to embed in the role. Each policy must have a unique name and policy document.
string[]
List of managed policy ARNs to attach to the role.
Record<string, string>
Resource tags for the role.

Output

string
ARN of the role.
string
Name of the Role.
string
Unique identifier for the role.
string
The stable and unique string identifying the role.
Date
When the role was created.

Examples

Basic Lambda execution role with inline policy

Role with AWS managed policies

Role with multiple inline policies and custom session duration