Class ApplicationInferenceProfile
- All Implemented Interfaces:
IEnvironmentAware,IResource,IBedrockInvokable,IInferenceProfile,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
These are inference profiles created by users (user defined). This helps to track costs and model usage.
Application inference profiles are user-defined profiles that help you track costs and model usage. They can be created for a single region or for multiple regions using a cross-region inference profile.
Example:
// Create a cross-region inference profile
CrossRegionInferenceProfile crossRegionProfile = CrossRegionInferenceProfile.fromConfig(CrossRegionInferenceProfileProps.builder()
.geoRegion(CrossRegionInferenceProfileRegion.US)
.model(BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V2_0)
.build());
// Create an application inference profile across regions
ApplicationInferenceProfile appProfile = ApplicationInferenceProfile.Builder.create(this, "MyMultiRegionProfile")
.applicationInferenceProfileName("claude-35-sonnet-v2-multi-region")
.modelSource(crossRegionProfile)
.description("Multi-region application profile for cost tracking")
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class(experimental) A fluent builder forApplicationInferenceProfile.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.bedrock.alpha.IBedrockInvokable
IBedrockInvokable.Jsii$Default, IBedrockInvokable.Jsii$ProxyNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.bedrock.alpha.IInferenceProfile
IInferenceProfile.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String(experimental) Uniquely identifies this class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedApplicationInferenceProfile(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedApplicationInferenceProfile(software.amazon.jsii.JsiiObjectRef objRef) ApplicationInferenceProfile(software.constructs.Construct scope, String id, ApplicationInferenceProfileProps props) -
Method Summary
Modifier and TypeMethodDescriptionstatic IInferenceProfilefromApplicationInferenceProfileAttributes(software.constructs.Construct scope, String id, ApplicationInferenceProfileAttributes attrs) (experimental) Import an Application Inference Profile given its attributes.static IInferenceProfilefromCfnApplicationInferenceProfile(CfnApplicationInferenceProfile cfnApplicationInferenceProfile) (experimental) Import a low-level L1 Cfn Application Inference Profile.(experimental) Time Stamp for Application Inference Profile creation.(experimental) The ARN of the application inference profile.(experimental) The unique identifier of the application inference profile.(experimental) The underlying model/cross-region model used by the application inference profile.(experimental) The name of the application inference profile.(experimental) The ARN used for invoking this inference profile.(experimental) The status of the application inference profile.getType()(experimental) The type of the inference profile.(experimental) Time Stamp for Application Inference Profile update.grantInvoke(IGrantable grantee) (experimental) Gives the appropriate policies to invoke and use the application inference profile.grantProfileUsage(IGrantable grantee) (experimental) Grants appropriate permissions to use the application inference profile (AIP).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.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
(experimental) Uniquely identifies this class.
-
-
Constructor Details
-
ApplicationInferenceProfile
protected ApplicationInferenceProfile(software.amazon.jsii.JsiiObjectRef objRef) -
ApplicationInferenceProfile
protected ApplicationInferenceProfile(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
ApplicationInferenceProfile
@Stability(Experimental) public ApplicationInferenceProfile(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ApplicationInferenceProfileProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props- This parameter is required.
-
-
Method Details
-
fromApplicationInferenceProfileAttributes
@Stability(Experimental) @NotNull public static IInferenceProfile fromApplicationInferenceProfileAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ApplicationInferenceProfileAttributes attrs) (experimental) Import an Application Inference Profile given its attributes.- Parameters:
scope-- The construct scope.
id-- Identifier of the construct.
attrs-- Attributes of the existing application inference profile.
- Returns:
- An IInferenceProfile reference to the existing application inference profile
-
fromCfnApplicationInferenceProfile
@Stability(Experimental) @NotNull public static IInferenceProfile fromCfnApplicationInferenceProfile(@NotNull CfnApplicationInferenceProfile cfnApplicationInferenceProfile) (experimental) Import a low-level L1 Cfn Application Inference Profile.- Parameters:
cfnApplicationInferenceProfile-- The L1 CfnApplicationInferenceProfile to import.
- Returns:
- An IInferenceProfile reference to the imported application inference profile
-
grantInvoke
(experimental) Gives the appropriate policies to invoke and use the application inference profile.This method ensures the appropriate permissions are given to use either the inference profile or the underlying foundation model/cross-region profile.
- Specified by:
grantInvokein interfaceIBedrockInvokable- Parameters:
grantee-- The IAM principal to grant permissions to.
- Returns:
- An IAM Grant object representing the granted permissions
-
grantProfileUsage
(experimental) Grants appropriate permissions to use the application inference profile (AIP).This method adds the necessary IAM permissions to allow the grantee to:
- Get inference profile details (bedrock:GetInferenceProfile)
- Invoke the model through the inference profile (bedrock:InvokeModel)
Note: This does not grant permissions to use the underlying model/cross-region profile in the AIP. For comprehensive permissions, use grantInvoke() instead.
- Specified by:
grantProfileUsagein interfaceIInferenceProfile- Specified by:
grantProfileUsagein classInferenceProfileBase- Parameters:
grantee-- The IAM principal to grant permissions to.
- Returns:
- An IAM Grant object representing the granted permissions
-
getCreatedAt
(experimental) Time Stamp for Application Inference Profile creation. -
getInferenceProfileArn
(experimental) The ARN of the application inference profile.- Specified by:
getInferenceProfileArnin interfaceIInferenceProfile- Specified by:
getInferenceProfileArnin classInferenceProfileBase
-
getInferenceProfileId
(experimental) The unique identifier of the application inference profile.- Specified by:
getInferenceProfileIdin interfaceIInferenceProfile- Specified by:
getInferenceProfileIdin classInferenceProfileBase
-
getInferenceProfileModel
(experimental) The underlying model/cross-region model used by the application inference profile. -
getInferenceProfileName
(experimental) The name of the application inference profile. -
getInvokableArn
(experimental) The ARN used for invoking this inference profile.This equals to the inferenceProfileArn property, useful for implementing IBedrockInvokable interface.
- Specified by:
getInvokableArnin interfaceIBedrockInvokable
-
getStatus
(experimental) The status of the application inference profile.ACTIVE means that the inference profile is ready to be used.
-
getType
(experimental) The type of the inference profile.Always APPLICATION for application inference profiles.
- Specified by:
getTypein interfaceIInferenceProfile- Specified by:
getTypein classInferenceProfileBase
-
getUpdatedAt
(experimental) Time Stamp for Application Inference Profile update.
-