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();
 
  • Method Details

    • getInstanceProfileName

      @Stability(Stable) @Nullable default String getInstanceProfileName()
      The name of the InstanceProfile to create.

      Default: - generated by CloudFormation

    • getPath

      @Stability(Stable) @Nullable default String getPath()
      The path to the InstanceProfile.

      Default: /

    • getRole

      @Stability(Stable) @Nullable default IRole 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

      @Stability(Stable) static InstanceProfileProps.Builder builder()
      Returns:
      a InstanceProfileProps.Builder of InstanceProfileProps