Interface InstanceProfileProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
InstanceProfileProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.120.0 (build 192dc88)",
date="2025-12-05T22:26:37.916Z")
@Stability(Stable)
public interface InstanceProfileProps
extends software.amazon.jsii.JsiiSerializable
Properties of an Instance Profile.
Example:
Vpc vpc;
Role role = Role.Builder.create(this, "Role")
.assumedBy(new ServicePrincipal("ec2.amazonaws.com"))
.build();
InstanceProfile instanceProfile = InstanceProfile.Builder.create(this, "InstanceProfile")
.role(role)
.build();
LaunchTemplate template = LaunchTemplate.Builder.create(this, "LaunchTemplate")
.launchTemplateName("MyTemplateV1")
.versionDescription("This is my v1 template")
.machineImage(MachineImage.latestAmazonLinux2023())
.securityGroup(SecurityGroup.Builder.create(this, "LaunchTemplateSG")
.vpc(vpc)
.build())
.instanceProfile(instanceProfile)
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forInstanceProfilePropsstatic final classAn implementation forInstanceProfileProps -
Method Summary
Modifier and TypeMethodDescriptionstatic InstanceProfileProps.Builderbuilder()default StringThe name of the InstanceProfile to create.default StringgetPath()The path to the InstanceProfile.default IRolegetRole()An IAM role to associate with the instance profile that is used by EC2 instances.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getInstanceProfileName
The name of the InstanceProfile to create.Default: - generated by CloudFormation
-
getPath
The path to the InstanceProfile.Default: /
-
getRole
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
Example:
Role role = Role.Builder.create(this, "MyRole") .assumedBy(new ServicePrincipal("ec2.amazonaws.com")) .build(); -
builder
- Returns:
- a
InstanceProfileProps.BuilderofInstanceProfileProps
-