Class InstanceProfile.Builder
java.lang.Object
software.amazon.awscdk.services.iam.InstanceProfile.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<InstanceProfile>
- Enclosing class:
InstanceProfile
@Stability(Stable)
public static final class InstanceProfile.Builder
extends Object
implements software.amazon.jsii.Builder<InstanceProfile>
A fluent builder for
InstanceProfile
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
static InstanceProfile.Builder
instanceProfileName
(String instanceProfileName) The name of the InstanceProfile to create.The path to the InstanceProfile.An IAM role to associate with the instance profile that is used by EC2 instances.
-
Method Details
-
create
@Stability(Stable) public static InstanceProfile.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope
- This parameter is required.id
- This parameter is required.- Returns:
- a new instance of
InstanceProfile.Builder
.
-
instanceProfileName
The name of the InstanceProfile to create.Default: - generated by CloudFormation
- Parameters:
instanceProfileName
- The name of the InstanceProfile to create. This parameter is required.- Returns:
this
-
path
The path to the InstanceProfile.Default: /
- Parameters:
path
- The path to the InstanceProfile. This parameter is required.- Returns:
this
-
role
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();
- Parameters:
role
- An IAM role to associate with the instance profile that is used by EC2 instances. This parameter is required.- Returns:
this
-
build
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<InstanceProfile>
- Returns:
- a newly built instance of
InstanceProfile
.
-