Class CrossRegionInferenceProfile
- All Implemented Interfaces:
IBedrockInvokable
,IInferenceProfile
,software.amazon.jsii.JsiiSerializable
With cross-region inference, you can distribute traffic across multiple AWS Regions, enabling higher throughput and enhanced resilience during periods of peak demands.
This construct represents a system-defined inference profile that routes requests across multiple regions based on availability and demand.
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 classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.bedrock.alpha.IBedrockInvokable
IBedrockInvokable.Jsii$Default, IBedrockInvokable.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.bedrock.alpha.IInferenceProfile
IInferenceProfile.Jsii$Default, IInferenceProfile.Jsii$Proxy
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
CrossRegionInferenceProfile
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CrossRegionInferenceProfile
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionstatic CrossRegionInferenceProfile
(experimental) Creates a Cross-Region Inference Profile from the provided configuration.(experimental) The ARN of the inference profile.(experimental) The unique identifier of the inference profile.(experimental) The underlying foundation model supporting cross-region inference.(experimental) The ARN used for invoking this inference profile.getType()
(experimental) The type of inference profile.grantInvoke
(IGrantable grantee) (experimental) Gives the appropriate policies to invoke and use the Foundation Model.grantProfileUsage
(IGrantable grantee) (experimental) Grants appropriate permissions to use the cross-region inference profile.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
CrossRegionInferenceProfile
protected CrossRegionInferenceProfile(software.amazon.jsii.JsiiObjectRef objRef) -
CrossRegionInferenceProfile
protected CrossRegionInferenceProfile(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
-
Method Details
-
fromConfig
@Stability(Experimental) @NotNull public static CrossRegionInferenceProfile fromConfig(@NotNull CrossRegionInferenceProfileProps config) (experimental) Creates a Cross-Region Inference Profile from the provided configuration.- Parameters:
config
-- Configuration for the cross-region inference profile.
- Returns:
- A new CrossRegionInferenceProfile instance
-
grantInvoke
(experimental) Gives the appropriate policies to invoke and use the Foundation Model.For cross-region inference profiles, this method grants permissions to:
- Invoke the model in all regions where the inference profile can route requests
- Use the inference profile itself
- Specified by:
grantInvoke
in 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 cross-region inference profile.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 directly. For comprehensive permissions, use grantInvoke() instead.
- Specified by:
grantProfileUsage
in interfaceIInferenceProfile
- Parameters:
grantee
-- The IAM principal to grant permissions to.
- Returns:
- An IAM Grant object representing the granted permissions
-
getInferenceProfileArn
(experimental) The ARN of the inference profile.- Specified by:
getInferenceProfileArn
in interfaceIInferenceProfile
-
getInferenceProfileId
(experimental) The unique identifier of the inference profile.Format: {geoRegion}.{modelId}
- Specified by:
getInferenceProfileId
in interfaceIInferenceProfile
-
getInferenceProfileModel
(experimental) The underlying foundation model supporting cross-region inference. -
getInvokableArn
(experimental) The ARN used for invoking this inference profile.This equals to the inferenceProfileArn property, useful for implementing IBedrockInvokable interface.
- Specified by:
getInvokableArn
in interfaceIBedrockInvokable
-
getType
(experimental) The type of inference profile.Always SYSTEM_DEFINED for cross-region profiles.
- Specified by:
getType
in interfaceIInferenceProfile
-