AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

InstanceProfile

IAM Instance Profile.

Import

import { InstanceProfile } from 'aws-cdk-lib/aws-iam';

Or use the module namespace:

import * as iam from 'aws-cdk-lib/aws-iam';
// iam.InstanceProfile

Properties

Configuration passed to the constructor as InstanceProfileProps.

instanceProfileNameOptional
string

The name of the InstanceProfile to create.

Default: - generated by CloudFormation

pathOptional
string

The path to the InstanceProfile.

Default: /

roleOptional
IRole

An IAM role to associate with the instance profile that is used by EC2 instances. The role must be assumable by the service principal `ec2.amazonaws.com`:

Default: - a role will be automatically created, it can be accessed via the `role` property

Get the AWS IAM Cheat Sheet

Everything you need to know about AWS IAM on one page. HD quality, print-friendly.

Download Free Infographic