> **Experimental**
>
> `@aws-cdk/aws-bedrock-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# ApplicationInferenceProfile

Class to create an Application Inference Profile with CDK.

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.

Extends: Construct › Resource › InferenceProfileBase › ApplicationInferenceProfile
Implements: IBedrockInvokable, IInferenceProfile, IResource, IEnvironmentAware, IConstruct, IDependable

- Stability: [Experimental](/cdk/api/stability.html)
- CloudFormation: [`AWS::Bedrock::ApplicationInferenceProfile`](https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-create.html)
- Source: [`bedrock/inference-profiles/application-inference-profile.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0-alpha.0/packages/@aws-cdk/aws-bedrock-alpha/bedrock/inference-profiles/application-inference-profile.ts#L100)

## Example

```ts
// Create a cross-region inference profile
const crossRegionProfile = bedrock.CrossRegionInferenceProfile.fromConfig({
  geoRegion: bedrock.CrossRegionInferenceProfileRegion.US,
  model: bedrock.BedrockFoundationModel.ANTHROPIC_CLAUDE_3_5_SONNET_V2_0,
});

// Create an application inference profile across regions
const appProfile = new bedrock.ApplicationInferenceProfile(this, 'MyMultiRegionProfile', {
  applicationInferenceProfileName: 'claude-35-sonnet-v2-multi-region',
  modelSource: crossRegionProfile,
  description: 'Multi-region application profile for cost tracking',
});
```

## Initializer

```ts
new ApplicationInferenceProfile(scope: Construct, id: string, props: ApplicationInferenceProfileProps)
```

## Construct Props

- `applicationInferenceProfileName`: string (required) — The name of the application inference profile.

  This name will be used to identify the inference profile in the AWS console and APIs.
  - Required:  Yes
  - Maximum length: 64 characters
  - Pattern: `^([0-9a-zA-Z:.][ _-]?)+$`

- `description`: string — Description of the inference profile. Provides additional context about the purpose and usage of this inference profile.

  **Default:** No description is provided

  - Maximum length: 200 characters when provided
  - Pattern: `^([0-9a-zA-Z:.][ _-]?)+$`

- `modelSource`: [IBedrockInvokable](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.IBedrockInvokable.html) (required) — The model source for this inference profile.

  To create an application inference profile for one Region, specify a foundation model.
  Usage and costs for requests made to that Region with that model will be tracked.

  To create an application inference profile for multiple Regions,
  specify a cross region (system-defined) inference profile.
  The inference profile will route requests to the Regions defined in
  the cross region (system-defined) inference profile that you choose.
  Usage and costs for requests made to the Regions in the inference profile will be tracked.

- `tags`: { [key: string]: string } — A list of tags associated with the inference profile.

  **Default:** No tags are applied

  Tags help you organize and categorize your AWS resources.

## Properties

- `createdAt`: string — Time Stamp for Application Inference Profile creation.

- `env`: [ResourceEnvironment](/cdk/api/v2/docs/aws-cdk-lib.interfaces.ResourceEnvironment.html) — The environment this resource belongs to.

  For resources that are created and managed in a Stack (those created by
  creating new class instances like `new Role()`, `new Bucket()`, etc.), this
  is always the same as the environment of the stack they belong to.

  For referenced resources (those obtained from referencing methods like
  `Role.fromRoleArn()`, `Bucket.fromBucketName()`, etc.), they might be
  different than the stack they were imported into.

- `inferenceProfileArn`: string — The ARN of the application inference profile.

- `inferenceProfileId`: string — The unique identifier of the application inference profile.

- `inferenceProfileModel`: [IBedrockInvokable](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.IBedrockInvokable.html) — The underlying model/cross-region model used by the application inference profile.

- `inferenceProfileName`: string — The name of the application inference profile.

- `invokableArn`: string — The ARN used for invoking this inference profile.

  This equals to the inferenceProfileArn property, useful for implementing IBedrockInvokable interface.

- `node`: [Node](/cdk/api/v2/docs/constructs.Node.html) — The tree node.

- `PROPERTY_INJECTION_ID`: string (static) — Uniquely identifies this class.

- `stack`: [Stack](/cdk/api/v2/docs/aws-cdk-lib.Stack.html) — The stack in which this resource is defined.

- `status`: string — The status of the application inference profile.

  ACTIVE means that the inference profile is ready to be used.

- `type`: [InferenceProfileType](/cdk/api/v2/docs/@aws-cdk_aws-bedrock-alpha.InferenceProfileType.html) — The type of the inference profile.

  Always APPLICATION for application inference profiles.

- `updatedAt`: string — Time Stamp for Application Inference Profile update.

## Methods

- `applyCrossStackReferenceStrength(strength: ReferenceStrength): void` — Override the cross-stack reference strength for this resource.

  When set, any cross-stack reference to this resource will use the specified
  mechanism instead of the global default determined by the
  `@aws-cdk/core:defaultCrossStackReferences` context key. This is useful for
  selectively weakening specific references to avoid the "deadly embrace" problem
  without changing the app-wide default.

  **Parameters**

  - `strength` — - The reference strength to use for this resource.

- `applyRemovalPolicy(policy: RemovalPolicy): void` — Apply the given removal policy to this resource.

  The Removal Policy controls what happens to this resource when it stops
  being managed by CloudFormation, either because you've removed it from the
  CDK application or because you've made a change that requires the resource
  to be replaced.

  The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
  account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).

- `fromApplicationInferenceProfileAttributes(scope: Construct, id: string, attrs: ApplicationInferenceProfileAttributes): IInferenceProfile` (static) — Import an Application Inference Profile given its attributes.

  [disable-awslint:no-grants]

  **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(cfnApplicationInferenceProfile: CfnApplicationInferenceProfile): IInferenceProfile` (static) — Import a low-level L1 Cfn Application Inference Profile.

  [disable-awslint:no-grants]

  **Parameters**

  - `cfnApplicationInferenceProfile` — - The L1 CfnApplicationInferenceProfile to import.

  **Returns:** An IInferenceProfile reference to the imported application inference profile

- `grantInvoke(grantee: IGrantable): Grant` — 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.
  [disable-awslint:no-grants]

  **Parameters**

  - `grantee` — - The IAM principal to grant permissions to.

  **Returns:** An IAM Grant object representing the granted permissions

- `grantProfileUsage(grantee: IGrantable): Grant` — 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.
  [disable-awslint:no-grants]

  **Parameters**

  - `grantee` — - The IAM principal to grant permissions to.

  **Returns:** An IAM Grant object representing the granted permissions

- `isConstruct(x: any): boolean` (static) — Checks if `x` is a construct.

  Use this method instead of `instanceof` to properly detect `Construct`
  instances, even when the construct library is symlinked.

  Explanation: in JavaScript, multiple copies of the `constructs` library on
  disk are seen as independent, completely different libraries. As a
  consequence, the class `Construct` in each copy of the `constructs` library
  is seen as a different class, and an instance of one class will not test as
  `instanceof` the other class. `npm install` will not create installations
  like this, but users may manually symlink construct libraries together or
  use a monorepo tool: in those cases, multiple copies of the `constructs`
  library can be accidentally installed, and `instanceof` will behave
  unpredictably. It is safest to avoid using `instanceof`, and using
  this type-testing method instead.

  **Parameters**

  - `x` — Any object.

  **Returns:** true if `x` is an object created from a class which extends `Construct`.

- `isOwnedResource(construct: IConstruct): boolean` (static) — Returns true if the construct was created by CDK, and false otherwise.

- `isResource(construct: IConstruct): boolean` (static) — Check whether the given construct is a Resource.

- `toString(): string` — Returns a string representation of this construct.

- `with(...mixins: IMixin[]): IConstruct` — Applies one or more mixins to this construct.

  Mixins are applied in order. The list of constructs is captured at the
  start of the call, so constructs added by a mixin will not be visited.
  Use multiple `with()` calls if subsequent mixins should apply to added
  constructs.
