Interface InstanceProfileProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
InstanceProfileProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.91.0 (build 1b1f239)", date="2023-11-16T22:34:06.112Z") @Stability(Stable) public interface InstanceProfileProps extends software.amazon.jsii.JsiiSerializable
Properties of an Instance Profile.

Example:

 Role role = Role.Builder.create(this, "Role")
         .assumedBy(new ServicePrincipal("ec2.amazonaws.com"))
         .build();
 InstanceProfile instanceProfile = InstanceProfile.Builder.create(this, "InstanceProfile")
         .role(role)
         .instanceProfileName("MyInstanceProfile")
         .path("/sample/path/")
         .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