interface InstanceProfileProps
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.IAM.InstanceProfileProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsiam#InstanceProfileProps |
Java | software.amazon.awscdk.services.iam.InstanceProfileProps |
Python | aws_cdk.aws_iam.InstanceProfileProps |
TypeScript (source) | aws-cdk-lib » aws_iam » InstanceProfileProps |
Properties of an Instance Profile.
Example
const role = new iam.Role(this, 'Role', {
assumedBy: new iam.ServicePrincipal('ec2.amazonaws.com'),
});
const instanceProfile = new iam.InstanceProfile(this, 'InstanceProfile', {
role,
instanceProfileName: 'MyInstanceProfile',
path: '/sample/path/',
});
Properties
| Name | Type | Description |
|---|---|---|
| instance | string | The name of the InstanceProfile to create. |
| path? | string | The path to the InstanceProfile. |
| role? | IRole | An IAM role to associate with the instance profile that is used by EC2 instances. |
instanceProfileName?
Type:
string
(optional, default: generated by CloudFormation)
The name of the InstanceProfile to create.
path?
Type:
string
(optional, default: /)
The path to the InstanceProfile.
role?
Type:
IRole
(optional, default: a role will be automatically created, it can be accessed via the role property)
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:
Example
const role = new iam.Role(this, 'MyRole', {
assumedBy: new iam.ServicePrincipal('ec2.amazonaws.com')
});

.NET
Go
Java
Python
TypeScript (