Class InstanceProfile
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.iam.InstanceProfile
- All Implemented Interfaces:
IResource,IInstanceProfile,IInstanceProfileRef,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-29T11:15:41.198Z")
@Stability(Stable)
public class InstanceProfile
extends Resource
implements IInstanceProfile
IAM Instance Profile.
Example:
Role role = Role.Builder.create(this, "Role")
.assumedBy(new ServicePrincipal("ec2.amazonaws.com"))
.build();
IInstanceProfile instanceProfile = InstanceProfile.fromInstanceProfileAttributes(this, "ImportedInstanceProfile", InstanceProfileAttributes.builder()
.instanceProfileArn("arn:aws:iam::account-id:instance-profile/MyInstanceProfile")
.role(role)
.build());
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.iam.IInstanceProfile
IInstanceProfile.Jsii$Default, IInstanceProfile.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInstanceProfile(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedInstanceProfile(software.amazon.jsii.JsiiObjectRef objRef) InstanceProfile(software.constructs.Construct scope, String id) InstanceProfile(software.constructs.Construct scope, String id, InstanceProfileProps props) -
Method Summary
Modifier and TypeMethodDescriptionstatic IInstanceProfilefromInstanceProfileArn(software.constructs.Construct scope, String id, String instanceProfileArn) Import an existing InstanceProfile from an InstanceProfile ARN.static IInstanceProfilefromInstanceProfileAttributes(software.constructs.Construct scope, String id, InstanceProfileAttributes attrs) Import an existing InstanceProfile from given InstanceProfile attributes.static IInstanceProfilefromInstanceProfileName(software.constructs.Construct scope, String id, String instanceProfileName) Import an existing InstanceProfile from an InstanceProfile name.Returns the ARN of this InstanceProfile.Returns the name of this InstanceProfile.A reference to a InstanceProfile resource.getRole()Returns the role associated with this InstanceProfile.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.awscdk.services.iam.IInstanceProfile
getNodeMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
Uniquely identifies this class.
-
-
Constructor Details
-
InstanceProfile
protected InstanceProfile(software.amazon.jsii.JsiiObjectRef objRef) -
InstanceProfile
protected InstanceProfile(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
InstanceProfile
@Stability(Stable) public InstanceProfile(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable InstanceProfileProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props-
-
InstanceProfile
@Stability(Stable) public InstanceProfile(@NotNull software.constructs.Construct scope, @NotNull String id) - Parameters:
scope- This parameter is required.id- This parameter is required.
-
-
Method Details
-
fromInstanceProfileArn
@Stability(Stable) @NotNull public static IInstanceProfile fromInstanceProfileArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String instanceProfileArn) Import an existing InstanceProfile from an InstanceProfile ARN.If the ARN comes from a Token, the InstanceProfile cannot have a path; if so, any attempt to reference its instanceProfileName will fail.
- Parameters:
scope- construct scope. This parameter is required.id- construct id. This parameter is required.instanceProfileArn- the ARN of the exiting InstanceProfile to import. This parameter is required.
-
fromInstanceProfileAttributes
@Stability(Stable) @NotNull public static IInstanceProfile fromInstanceProfileAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull InstanceProfileAttributes attrs) Import an existing InstanceProfile from given InstanceProfile attributes.If the ARN comes from a Token, the InstanceProfile cannot have a path; if so, any attempt to reference its instanceProfileName will fail.
- Parameters:
scope- construct scope. This parameter is required.id- construct id. This parameter is required.attrs- the attributes of the InstanceProfile to import. This parameter is required.
-
fromInstanceProfileName
@Stability(Stable) @NotNull public static IInstanceProfile fromInstanceProfileName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String instanceProfileName) Import an existing InstanceProfile from an InstanceProfile name.- Parameters:
scope- construct scope. This parameter is required.id- construct id. This parameter is required.instanceProfileName- the name of the existing InstanceProfile to import. This parameter is required.
-
getInstanceProfileArn
Returns the ARN of this InstanceProfile.- Specified by:
getInstanceProfileArnin interfaceIInstanceProfile
-
getInstanceProfileName
Returns the name of this InstanceProfile.- Specified by:
getInstanceProfileNamein interfaceIInstanceProfile
-
getInstanceProfileRef
A reference to a InstanceProfile resource.- Specified by:
getInstanceProfileRefin interfaceIInstanceProfileRef
-
getRole
Returns the role associated with this InstanceProfile.- Specified by:
getRolein interfaceIInstanceProfile
-